1ef39d40dSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3ef39d40dSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4ef39d40dSAndrew Rist * or more contributor license agreements. See the NOTICE file 5ef39d40dSAndrew Rist * distributed with this work for additional information 6ef39d40dSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7ef39d40dSAndrew Rist * to you under the Apache License, Version 2.0 (the 8ef39d40dSAndrew Rist * "License"); you may not use this file except in compliance 9ef39d40dSAndrew Rist * with the License. You may obtain a copy of the License at 10ef39d40dSAndrew Rist * 11ef39d40dSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12ef39d40dSAndrew Rist * 13ef39d40dSAndrew Rist * Unless required by applicable law or agreed to in writing, 14ef39d40dSAndrew Rist * software distributed under the License is distributed on an 15ef39d40dSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16ef39d40dSAndrew Rist * KIND, either express or implied. See the License for the 17ef39d40dSAndrew Rist * specific language governing permissions and limitations 18ef39d40dSAndrew Rist * under the License. 19ef39d40dSAndrew Rist * 20ef39d40dSAndrew Rist *************************************************************/ 21ef39d40dSAndrew Rist 22ef39d40dSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir package ifc.sdb; 25cdf0e10cSrcweir 26cdf0e10cSrcweir import com.sun.star.sdb.XSingleSelectQueryComposer; 27cdf0e10cSrcweir import lib.MultiMethodTest; 28cdf0e10cSrcweir import com.sun.star.sdb.XSingleSelectQueryAnalyzer; 29cdf0e10cSrcweir import com.sun.star.uno.AnyConverter; 30cdf0e10cSrcweir import com.sun.star.uno.UnoRuntime; 31cdf0e10cSrcweir import lib.StatusException; 32cdf0e10cSrcweir import lib.Status; 33cdf0e10cSrcweir import com.sun.star.beans.PropertyValue; 34cdf0e10cSrcweir import com.sun.star.beans.XPropertySet; 35cdf0e10cSrcweir import com.sun.star.sdb.SQLFilterOperator; 36cdf0e10cSrcweir 37cdf0e10cSrcweir /** 38cdf0e10cSrcweir * Testing <code>com.sun.star.sdb.XSingleSelectQueryComposer</code> 39cdf0e10cSrcweir * interface methods : 40cdf0e10cSrcweir * <ul> 41cdf0e10cSrcweir * <li><code>setFilter()</code></li> 42cdf0e10cSrcweir * <li><code>setStructuredFilter()</code></li> 43cdf0e10cSrcweir * <li><code>appendFilterByColumn()</code></li> 44cdf0e10cSrcweir * <li><code>appendGroupByColumn()</code></li> 45cdf0e10cSrcweir * <li><code>setGroup()</code></li> 46cdf0e10cSrcweir * <li><code>setHavingClause()</code></li> 47cdf0e10cSrcweir * <li><code>setStructuredHavingClause()</code></li> 48cdf0e10cSrcweir * <li><code>appendHavingClauseByColumn()</code></li> 49cdf0e10cSrcweir * <li><code>appendOrderByColumn()</code></li> 50cdf0e10cSrcweir * <li><code>setOrder()</code></li> 51cdf0e10cSrcweir 52cdf0e10cSrcweir * </ul> <p> 53cdf0e10cSrcweir * @see com.sun.star.sdb.XSingleSelectQueryComposer 54cdf0e10cSrcweir */ 55cdf0e10cSrcweir public class _XSingleSelectQueryComposer extends MultiMethodTest { 56cdf0e10cSrcweir 57cdf0e10cSrcweir // oObj filled by MultiMethodTest 58cdf0e10cSrcweir public XSingleSelectQueryComposer oObj = null ; 59cdf0e10cSrcweir 60cdf0e10cSrcweir private String queryString = "SELECT * FROM \"biblio\""; 61cdf0e10cSrcweir 62cdf0e10cSrcweir private XSingleSelectQueryAnalyzer xQueryAna = null; 63cdf0e10cSrcweir 64cdf0e10cSrcweir private XPropertySet xProp = null; 65cdf0e10cSrcweir 66cdf0e10cSrcweir private String colName = null; 67cdf0e10cSrcweir 68cdf0e10cSrcweir /** 69cdf0e10cSrcweir * Retcieves the object relations: 70cdf0e10cSrcweir * <ul> 71cdf0e10cSrcweir * <li><code>XSingleSelectQueryAnalyzer xQueryAna</code></li> 72cdf0e10cSrcweir * <li><code>XPropertySet xProp</code></li> 73cdf0e10cSrcweir * <li><code>String colName</code></li> 74cdf0e10cSrcweir * </ul> <p> 75*e6b649b5SPedro Giffuni * @see com.sun.star.sdb.XSingleSelectQueryAnalyzer 76cdf0e10cSrcweir * @see com.sun.star.beans.XPropertySet 77cdf0e10cSrcweir */ before()78cdf0e10cSrcweir protected void before() /* throws Exception*/ { 79cdf0e10cSrcweir 80cdf0e10cSrcweir xQueryAna = (XSingleSelectQueryAnalyzer) 81cdf0e10cSrcweir UnoRuntime.queryInterface(XSingleSelectQueryAnalyzer.class, 82cdf0e10cSrcweir tEnv.getObjRelation("xQueryAna")); 83cdf0e10cSrcweir 84cdf0e10cSrcweir if (xQueryAna == null) { 85cdf0e10cSrcweir throw new StatusException(Status.failed( 86cdf0e10cSrcweir "Couldn't get object relation 'xQueryAna'. Test must be modified")); 87cdf0e10cSrcweir 88cdf0e10cSrcweir } 89cdf0e10cSrcweir 90cdf0e10cSrcweir xProp = (XPropertySet) 91cdf0e10cSrcweir UnoRuntime.queryInterface(XPropertySet.class, 92cdf0e10cSrcweir tEnv.getObjRelation("xProp")); 93cdf0e10cSrcweir 94cdf0e10cSrcweir if (xProp == null) { 95cdf0e10cSrcweir throw new StatusException(Status.failed( 96cdf0e10cSrcweir "Couldn't get object relation 'xProp'. Test must be modified")); 97cdf0e10cSrcweir 98cdf0e10cSrcweir } 99cdf0e10cSrcweir 100cdf0e10cSrcweir try 101cdf0e10cSrcweir { 102cdf0e10cSrcweir colName = AnyConverter.toString(tEnv.getObjRelation("colName")); 103cdf0e10cSrcweir } 104cdf0e10cSrcweir catch (com.sun.star.lang.IllegalArgumentException e) 105cdf0e10cSrcweir { 106cdf0e10cSrcweir colName = null; 107cdf0e10cSrcweir } 108cdf0e10cSrcweir 109cdf0e10cSrcweir if (colName == null) { 110cdf0e10cSrcweir throw new StatusException(Status.failed( 111cdf0e10cSrcweir "Couldn't get object relation 'colName'. Test must be modified")); 112cdf0e10cSrcweir 113cdf0e10cSrcweir } 114cdf0e10cSrcweir 115cdf0e10cSrcweir } 116cdf0e10cSrcweir 117cdf0e10cSrcweir 118cdf0e10cSrcweir /** 119cdf0e10cSrcweir * Object relation <code>xQueryAna</code> set a filter. This filter 120cdf0e10cSrcweir * must returned while calling <code>getFilter</code> 121cdf0e10cSrcweir */ _setFilter()122cdf0e10cSrcweir public void _setFilter() { 123cdf0e10cSrcweir try{ 124cdf0e10cSrcweir String filter = "\"Identifier\" = 'BOR02b'"; 125cdf0e10cSrcweir oObj.setFilter(filter); 126cdf0e10cSrcweir tRes.tested("setFilter()", (xQueryAna.getFilter().equals(filter))); 127cdf0e10cSrcweir 128cdf0e10cSrcweir } catch (com.sun.star.sdbc.SQLException e){ 129cdf0e10cSrcweir log.println("unexpected Exception: " + e.toString()); 130cdf0e10cSrcweir tRes.tested("setFilter()", false); 131cdf0e10cSrcweir } 132cdf0e10cSrcweir } 133cdf0e10cSrcweir 134cdf0e10cSrcweir /** 135cdf0e10cSrcweir * Object relation <code>xQueryAna</code> set a complex filter with method 136cdf0e10cSrcweir . <code>setFilter</code>. Then <code>getStructuredFilter</code> returns a 137cdf0e10cSrcweir * sequenze of <code>PropertyValue</code> which was set with method 138cdf0e10cSrcweir * <code>setStructuredFilter</code> from <code>xQueryAna</code>. 139cdf0e10cSrcweir * Then test has ok status if <code>getFilter</code> returns the complex filter. 140cdf0e10cSrcweir */ _setStructuredFilter()141cdf0e10cSrcweir public void _setStructuredFilter() { 142cdf0e10cSrcweir requiredMethod("setFilter()"); 143cdf0e10cSrcweir try{ 144cdf0e10cSrcweir xQueryAna.setQuery("SELECT \"Identifier\", \"Type\", \"Address\" FROM \"biblio\" \"biblio\""); 145cdf0e10cSrcweir String complexFilter = "( \"Identifier\" = '1' AND \"Type\" = '4' ) OR ( \"Identifier\" = '2' AND \"Type\" = '5' ) OR ( \"Identifier\" = '3' AND \"Type\" = '6' AND \"Address\" = '7' ) OR ( \"Address\" = '8' ) OR ( \"Type\" = '9' )"; 146cdf0e10cSrcweir oObj.setFilter(complexFilter); 147cdf0e10cSrcweir PropertyValue[][] aStructuredFilter = xQueryAna.getStructuredFilter(); 148cdf0e10cSrcweir oObj.setFilter(""); 149cdf0e10cSrcweir oObj.setStructuredFilter(aStructuredFilter); 150cdf0e10cSrcweir tRes.tested("setStructuredFilter()", (xQueryAna.getFilter().equals(complexFilter))); 151cdf0e10cSrcweir 152cdf0e10cSrcweir } catch (com.sun.star.sdbc.SQLException e){ 153cdf0e10cSrcweir log.println("unexpected Exception: " + e.toString()); 154cdf0e10cSrcweir tRes.tested("setStructuredFilter()", false); 155cdf0e10cSrcweir } catch (com.sun.star.lang.IllegalArgumentException e){ 156cdf0e10cSrcweir log.println("unexpected Exception: " + e.toString()); 157cdf0e10cSrcweir tRes.tested("setStructuredFilter()", false); 158cdf0e10cSrcweir } 159cdf0e10cSrcweir } 160cdf0e10cSrcweir 161cdf0e10cSrcweir /** 162cdf0e10cSrcweir * At first the object relation <code>xProp</code> was set as parameter. 163cdf0e10cSrcweir * Relation <code>xQueryAna</code> was used to chek if realtion 164cdf0e10cSrcweir * <code>colName</code> was found. 165cdf0e10cSrcweir * Second an empty <code>XPropertySet</code> was used as parameter. A 166cdf0e10cSrcweir * <code>com.sun.star.sdbc.SQLException</code> must be thrown. 167cdf0e10cSrcweir */ _appendFilterByColumn()168cdf0e10cSrcweir public void _appendFilterByColumn() { 169cdf0e10cSrcweir boolean ok = true; 170cdf0e10cSrcweir try{ 171cdf0e10cSrcweir 172cdf0e10cSrcweir oObj.appendFilterByColumn(xProp, true,SQLFilterOperator.EQUAL); 173cdf0e10cSrcweir log.println("appendFilterByColumn: " + xQueryAna.getFilter()); 174cdf0e10cSrcweir ok = ok && (xQueryAna.getFilter().indexOf(colName) > 0); 175cdf0e10cSrcweir 176cdf0e10cSrcweir } catch (com.sun.star.sdbc.SQLException e){ 177cdf0e10cSrcweir log.println("unexpected Exception: " + e.toString()); 178cdf0e10cSrcweir tRes.tested("appendFilterByColumn()", false); 179cdf0e10cSrcweir } 180cdf0e10cSrcweir 181cdf0e10cSrcweir try{ 182cdf0e10cSrcweir 183cdf0e10cSrcweir oObj.appendFilterByColumn(xProp, false,SQLFilterOperator.EQUAL); 184cdf0e10cSrcweir log.println("appendFilterByColumn: " + xQueryAna.getFilter()); 185cdf0e10cSrcweir ok = ok && (xQueryAna.getFilter().indexOf(colName) > 0); 186cdf0e10cSrcweir 187cdf0e10cSrcweir } catch (com.sun.star.sdbc.SQLException e){ 188cdf0e10cSrcweir log.println("unexpected Exception: " + e.toString()); 189cdf0e10cSrcweir tRes.tested("appendFilterByColumn()", false); 190cdf0e10cSrcweir } 191cdf0e10cSrcweir 192cdf0e10cSrcweir try{ 193cdf0e10cSrcweir XPropertySet dummy = null; 194cdf0e10cSrcweir oObj.appendFilterByColumn(dummy, true,SQLFilterOperator.EQUAL); 195cdf0e10cSrcweir log.println("expected Exception was not thrown"); 196cdf0e10cSrcweir tRes.tested("appendFilterByColumn()", false); 197cdf0e10cSrcweir 198cdf0e10cSrcweir } catch (com.sun.star.sdbc.SQLException e){ 199cdf0e10cSrcweir log.println("expected Exception"); 200cdf0e10cSrcweir ok = ok && true; 201cdf0e10cSrcweir } 202cdf0e10cSrcweir tRes.tested("appendFilterByColumn()", ok); 203cdf0e10cSrcweir } 204cdf0e10cSrcweir 205cdf0e10cSrcweir /** 206cdf0e10cSrcweir * At first the object relation <code>xProp</code> was used as parameter. 207cdf0e10cSrcweir * Relation <code>xQueryAna</code> was used to chek if realtion 208cdf0e10cSrcweir * <code>colName</code> was found. 209cdf0e10cSrcweir * Second an empty <code>XPropertySet</code> was used as parameter. An 210cdf0e10cSrcweir * <code>com.sun.star.sdbc.SQLException</code> must be thrown. 211cdf0e10cSrcweir */ _appendGroupByColumn()212cdf0e10cSrcweir public void _appendGroupByColumn() { 213cdf0e10cSrcweir boolean ok = true; 214cdf0e10cSrcweir try{ 215cdf0e10cSrcweir 216cdf0e10cSrcweir oObj.appendGroupByColumn(xProp); 217cdf0e10cSrcweir log.println("appendGroupByColumn: " + xQueryAna.getFilter()); 218cdf0e10cSrcweir ok = ok && (xQueryAna.getFilter().indexOf(colName) > 0); 219cdf0e10cSrcweir 220cdf0e10cSrcweir } catch (com.sun.star.sdbc.SQLException e){ 221cdf0e10cSrcweir log.println("unexpected Exception: " + e.toString()); 222cdf0e10cSrcweir tRes.tested("appendGroupByColumn()", false); 223cdf0e10cSrcweir } 224cdf0e10cSrcweir try{ 225cdf0e10cSrcweir XPropertySet dummy = null; 226cdf0e10cSrcweir oObj.appendGroupByColumn(dummy); 227cdf0e10cSrcweir log.println("expected Exception was not thrown"); 228cdf0e10cSrcweir tRes.tested("appendGroupByColumn()", false); 229cdf0e10cSrcweir 230cdf0e10cSrcweir } catch (com.sun.star.sdbc.SQLException e){ 231cdf0e10cSrcweir log.println("expected Exception"); 232cdf0e10cSrcweir ok = ok && true; 233cdf0e10cSrcweir } 234cdf0e10cSrcweir tRes.tested("appendGroupByColumn()", ok); 235cdf0e10cSrcweir } 236cdf0e10cSrcweir 237cdf0e10cSrcweir /** 238cdf0e10cSrcweir * The group which was setted by <code>setGroup</code> must be returned 239cdf0e10cSrcweir * while calling from object relation <code>XQueryAna</code> 240cdf0e10cSrcweir * method <code>getGroup</code> 241cdf0e10cSrcweir */ _setGroup()242cdf0e10cSrcweir public void _setGroup() { 243cdf0e10cSrcweir try{ 244cdf0e10cSrcweir String group = "\"Identifier\""; 245cdf0e10cSrcweir oObj.setGroup(group); 246cdf0e10cSrcweir tRes.tested("setGroup()", (xQueryAna.getGroup().equals(group))); 247cdf0e10cSrcweir 248cdf0e10cSrcweir } catch (com.sun.star.sdbc.SQLException e){ 249cdf0e10cSrcweir log.println("unexpected Exception: " + e.toString()); 250cdf0e10cSrcweir tRes.tested("setGroup()", false); 251cdf0e10cSrcweir } 252cdf0e10cSrcweir } 253cdf0e10cSrcweir 254cdf0e10cSrcweir 255cdf0e10cSrcweir /** 256cdf0e10cSrcweir * The cluase which was setted by <code>setHavingClause</code> must be returned 257cdf0e10cSrcweir * while calling from object relation <code>XQueryAna</code> 258cdf0e10cSrcweir * method <code>getHavingClause</code> 259cdf0e10cSrcweir */ _setHavingClause()260cdf0e10cSrcweir public void _setHavingClause() { 261cdf0e10cSrcweir try{ 262cdf0e10cSrcweir String clause = "\"Identifier\" = 'BOR02b'"; 263cdf0e10cSrcweir oObj.setHavingClause(clause); 264cdf0e10cSrcweir tRes.tested("setHavingClause()", ( 265cdf0e10cSrcweir xQueryAna.getHavingClause().equals(clause))); 266cdf0e10cSrcweir 267cdf0e10cSrcweir } catch (com.sun.star.sdbc.SQLException e){ 268cdf0e10cSrcweir log.println("unexpected Exception: " + e.toString()); 269cdf0e10cSrcweir tRes.tested("setHavingClause()", false); 270cdf0e10cSrcweir } 271cdf0e10cSrcweir } 272cdf0e10cSrcweir 273cdf0e10cSrcweir /** 274cdf0e10cSrcweir * At first <code>setHavingClause</code> sets a complex clause. 275cdf0e10cSrcweir * Then method <code>getStructuredHavingClause</code> from object relation 276cdf0e10cSrcweir * <code>xQueryAna</code> returns a valid <code>PropertyValue[][]</code> 277cdf0e10cSrcweir * Method <code>setHavingClause</code> was called with an empty sting to 278cdf0e10cSrcweir * reset filter. Now <code>setStructuredHavingClause</code> with the valid 279cdf0e10cSrcweir * <code>PropertyValue[][]</code> as parameter was called. 280cdf0e10cSrcweir * Test is ok if <code>getHavingClause</code> from <code>xQueryAna</code> 281cdf0e10cSrcweir * returns the complex clause from beginning. 282cdf0e10cSrcweir * <p> 283cdf0e10cSrcweir * required methods: 284cdf0e10cSrcweir *<ul> 285cdf0e10cSrcweir * <li><code>setHavingClause</code></li> 286cdf0e10cSrcweir * <li><code>setStructuredFilter</code></li> 287cdf0e10cSrcweir *</ul> 288cdf0e10cSrcweir */ _setStructuredHavingClause()289cdf0e10cSrcweir public void _setStructuredHavingClause() { 290cdf0e10cSrcweir requiredMethod("setHavingClause()"); 291cdf0e10cSrcweir executeMethod("setStructuredFilter()"); 292cdf0e10cSrcweir String complexFilter = "( \"Identifier\" = '1' AND \"Type\" = '4' ) OR ( \"Identifier\" = '2' AND \"Type\" = '5' ) OR ( \"Identifier\" = '3' AND \"Type\" = '6' AND \"Address\" = '7' ) OR ( \"Address\" = '8' ) OR ( \"Type\" = '9' )"; 293cdf0e10cSrcweir 294cdf0e10cSrcweir try{ 295cdf0e10cSrcweir oObj.setHavingClause(complexFilter); 296cdf0e10cSrcweir PropertyValue[][] aStructuredHaving = 297cdf0e10cSrcweir xQueryAna.getStructuredHavingClause(); 298cdf0e10cSrcweir oObj.setHavingClause(""); 299cdf0e10cSrcweir oObj.setStructuredHavingClause(aStructuredHaving); 300cdf0e10cSrcweir tRes.tested("setStructuredHavingClause()", 301cdf0e10cSrcweir (xQueryAna.getHavingClause().equals(complexFilter))); 302cdf0e10cSrcweir 303cdf0e10cSrcweir } catch (com.sun.star.sdbc.SQLException e){ 304cdf0e10cSrcweir log.println("unexpected Exception: " + e.toString()); 305cdf0e10cSrcweir tRes.tested("setStructuredHavingClause()", false); 306cdf0e10cSrcweir } 307cdf0e10cSrcweir } 308cdf0e10cSrcweir 309cdf0e10cSrcweir /** 310cdf0e10cSrcweir * First object relation <code>xProp</code> was used as parameter. Relation 311cdf0e10cSrcweir * <code>xQueryAna</code> was used to chek if realtion <code>colName</code> 312cdf0e10cSrcweir * was found. 313cdf0e10cSrcweir * Second an empty <code>XPropertySet</code> was given as parameter. An 314cdf0e10cSrcweir * <code>com.sun.star.sdbc.SQLException</code> must be thrown. 315cdf0e10cSrcweir */ _appendHavingClauseByColumn()316cdf0e10cSrcweir public void _appendHavingClauseByColumn() { 317cdf0e10cSrcweir boolean ok = true; 318cdf0e10cSrcweir try{ 319cdf0e10cSrcweir 320cdf0e10cSrcweir oObj.appendHavingClauseByColumn(xProp, true,SQLFilterOperator.EQUAL); 321cdf0e10cSrcweir log.println("appendHavingClauseByColumn: " + xQueryAna.getFilter()); 322cdf0e10cSrcweir ok = ok && (xQueryAna.getFilter().indexOf(colName) > 0); 323cdf0e10cSrcweir 324cdf0e10cSrcweir } catch (com.sun.star.sdbc.SQLException e){ 325cdf0e10cSrcweir log.println("unexpected Exception: " + e.toString()); 326cdf0e10cSrcweir tRes.tested("appendHavingClauseByColumn()", false); 327cdf0e10cSrcweir } 328cdf0e10cSrcweir try{ 329cdf0e10cSrcweir XPropertySet dummy = null; 330cdf0e10cSrcweir oObj.appendHavingClauseByColumn(dummy, true,SQLFilterOperator.EQUAL); 331cdf0e10cSrcweir log.println("expected Exception was not thrown"); 332cdf0e10cSrcweir tRes.tested("appendHavingClauseByColumn()", false); 333cdf0e10cSrcweir 334cdf0e10cSrcweir } catch (com.sun.star.sdbc.SQLException e){ 335cdf0e10cSrcweir log.println("expected Exception"); 336cdf0e10cSrcweir ok = ok && true; 337cdf0e10cSrcweir } 338cdf0e10cSrcweir tRes.tested("appendHavingClauseByColumn()", ok); 339cdf0e10cSrcweir } 340cdf0e10cSrcweir 341cdf0e10cSrcweir /** 342cdf0e10cSrcweir * First object relation <code>xProp</code> was set as parameter. Relation 343cdf0e10cSrcweir * <code>xQueryAna</code> was used to chek if realtion <code>colName</code> 344cdf0e10cSrcweir * was found. 345cdf0e10cSrcweir * Second an empty <code>XPropertySet</code> was given as parameter. An 346cdf0e10cSrcweir * <code>com.sun.star.sdbc.SQLException</code> must be thrown. 347cdf0e10cSrcweir */ _appendOrderByColumn()348cdf0e10cSrcweir public void _appendOrderByColumn() { 349cdf0e10cSrcweir boolean ok = true; 350cdf0e10cSrcweir try{ 351cdf0e10cSrcweir 352cdf0e10cSrcweir oObj.appendOrderByColumn(xProp, true); 353cdf0e10cSrcweir log.println("appendOrderByColumn: " + xQueryAna.getFilter()); 354cdf0e10cSrcweir ok = ok && (xQueryAna.getFilter().indexOf(colName) > 0); 355cdf0e10cSrcweir 356cdf0e10cSrcweir } catch (com.sun.star.sdbc.SQLException e){ 357cdf0e10cSrcweir log.println("unexpected Exception: " + e.toString()); 358cdf0e10cSrcweir tRes.tested("appendOrderByColumn()", false); 359cdf0e10cSrcweir } 360cdf0e10cSrcweir try{ 361cdf0e10cSrcweir XPropertySet dummy = null; 362cdf0e10cSrcweir oObj.appendOrderByColumn(dummy, true); 363cdf0e10cSrcweir log.println("expected Exception was not thrown"); 364cdf0e10cSrcweir tRes.tested("appendOrderByColumn()", false); 365cdf0e10cSrcweir 366cdf0e10cSrcweir } catch (com.sun.star.sdbc.SQLException e){ 367cdf0e10cSrcweir log.println("expected Exception"); 368cdf0e10cSrcweir ok = ok && true; 369cdf0e10cSrcweir } 370cdf0e10cSrcweir tRes.tested("appendOrderByColumn()", ok); 371cdf0e10cSrcweir } 372cdf0e10cSrcweir 373cdf0e10cSrcweir 374cdf0e10cSrcweir /** 375cdf0e10cSrcweir * Method <code>getOrder</code> from object relation <code>xQueryAna</code> 376cdf0e10cSrcweir * checks the order which was setted while calling <code>setOrder</code> 377cdf0e10cSrcweir */ _setOrder()378cdf0e10cSrcweir public void _setOrder() { 379cdf0e10cSrcweir try{ 380cdf0e10cSrcweir String order = "\"Identifier\""; 381cdf0e10cSrcweir oObj.setOrder(order); 382cdf0e10cSrcweir tRes.tested("setOrder()", (xQueryAna.getOrder().equals(order))); 383cdf0e10cSrcweir 384cdf0e10cSrcweir } catch (com.sun.star.sdbc.SQLException e){ 385cdf0e10cSrcweir log.println("unexpected Exception: " + e.toString()); 386cdf0e10cSrcweir tRes.tested("setOrder()", false); 387cdf0e10cSrcweir } 388cdf0e10cSrcweir } 389cdf0e10cSrcweir 390cdf0e10cSrcweir 391cdf0e10cSrcweir 392cdf0e10cSrcweir } // finish class _XSingleSelectQueryComposer 393