diff options
author | Ocke Janssen [oj] <Ocke.Janssen@oracle.com> | 2011-02-23 09:40:45 +0100 |
---|---|---|
committer | Ocke Janssen [oj] <Ocke.Janssen@oracle.com> | 2011-02-23 09:40:45 +0100 |
commit | a6eb263876d1bcb01c4111b745f34a3e8b358c18 (patch) | |
tree | 799a01fc7de2ea291bdb219409530b94e0ed5c89 /dbaccess | |
parent | 1917dfb80bf466be483466adf94c36376c96f3be (diff) |
dba34c: #i117046# check if query exists
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/qa/complex/dbaccess/Query.java | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/dbaccess/qa/complex/dbaccess/Query.java b/dbaccess/qa/complex/dbaccess/Query.java index c7f4674ee..b4a88e1da 100644 --- a/dbaccess/qa/complex/dbaccess/Query.java +++ b/dbaccess/qa/complex/dbaccess/Query.java @@ -90,23 +90,26 @@ public class Query extends TestCase { for ( int i = 0; i < queryNames.length; ++i ) { - final XPropertySet query = UnoRuntime.queryInterface( - XPropertySet.class, queries.getByName( queryNames[i] ) ); + if (queries.hasByName(queryNames[i])) + { + final XPropertySet query = UnoRuntime.queryInterface( + XPropertySet.class, queries.getByName( queryNames[i] ) ); - final XColumnsSupplier suppCols = UnoRuntime.queryInterface( - XColumnsSupplier.class, query); - final XIndexAccess columns = UnoRuntime.queryInterface( - XIndexAccess.class, suppCols.getColumns()); + final XColumnsSupplier suppCols = UnoRuntime.queryInterface( + XColumnsSupplier.class, query); + final XIndexAccess columns = UnoRuntime.queryInterface( + XIndexAccess.class, suppCols.getColumns()); - // check whether the columns supplied by the query match what we expected - assertTrue( "invalid column count (found " + columns.getCount() + ", expected: " + expectedColumnNames[i].length + ") for query \"" + queryNames[i] + "\"", - columns.getCount() == expectedColumnNames[i].length ); - for ( int col = 0; col < columns.getCount(); ++col ) - { - final XNamed columnName = UnoRuntime.queryInterface( - XNamed.class, columns.getByIndex(col) ); - assertTrue( "column no. " + col + " of query \"" + queryNames[i] + "\" not matching", - columnName.getName().equals( expectedColumnNames[i][col] ) ); + // check whether the columns supplied by the query match what we expected + assertTrue( "invalid column count (found " + columns.getCount() + ", expected: " + expectedColumnNames[i].length + ") for query \"" + queryNames[i] + "\"", + columns.getCount() == expectedColumnNames[i].length ); + for ( int col = 0; col < columns.getCount(); ++col ) + { + final XNamed columnName = UnoRuntime.queryInterface( + XNamed.class, columns.getByIndex(col) ); + assertTrue( "column no. " + col + " of query \"" + queryNames[i] + "\" not matching", + columnName.getName().equals( expectedColumnNames[i][col] ) ); + } } } } |