diff options
Diffstat (limited to 'qadevOOo/tests/java/ifc/sdb/_XSingleSelectQueryComposer.java')
-rw-r--r-- | qadevOOo/tests/java/ifc/sdb/_XSingleSelectQueryComposer.java | 98 |
1 files changed, 49 insertions, 49 deletions
diff --git a/qadevOOo/tests/java/ifc/sdb/_XSingleSelectQueryComposer.java b/qadevOOo/tests/java/ifc/sdb/_XSingleSelectQueryComposer.java index fa987a09a227..12562abde2b9 100644 --- a/qadevOOo/tests/java/ifc/sdb/_XSingleSelectQueryComposer.java +++ b/qadevOOo/tests/java/ifc/sdb/_XSingleSelectQueryComposer.java @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -62,13 +62,13 @@ public class _XSingleSelectQueryComposer extends MultiMethodTest { public XSingleSelectQueryComposer oObj = null ; private String queryString = "SELECT * FROM \"biblio\""; - + private XSingleSelectQueryAnalyzer xQueryAna = null; - + private XPropertySet xProp = null; - + private String colName = null; - + /** * Retcieves the object relations: * <ul> @@ -88,9 +88,9 @@ public class _XSingleSelectQueryComposer extends MultiMethodTest { if (xQueryAna == null) { throw new StatusException(Status.failed( "Couldn't get object relation 'xQueryAna'. Test must be modified")); - + } - + xProp = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, tEnv.getObjRelation("xProp")); @@ -98,9 +98,9 @@ public class _XSingleSelectQueryComposer extends MultiMethodTest { if (xProp == null) { throw new StatusException(Status.failed( "Couldn't get object relation 'xProp'. Test must be modified")); - + } - + try { colName = AnyConverter.toString(tEnv.getObjRelation("colName")); @@ -113,12 +113,12 @@ public class _XSingleSelectQueryComposer extends MultiMethodTest { if (colName == null) { throw new StatusException(Status.failed( "Couldn't get object relation 'colName'. Test must be modified")); - + } - + } - - + + /** * Object relation <code>xQueryAna</code> set a filter. This filter * must returned while calling <code>getFilter</code> @@ -128,13 +128,13 @@ public class _XSingleSelectQueryComposer extends MultiMethodTest { String filter = "\"Identifier\" = 'BOR02b'"; oObj.setFilter(filter); tRes.tested("setFilter()", (xQueryAna.getFilter().equals(filter))); - + } catch (com.sun.star.sdbc.SQLException e){ log.println("unexpected Exception: " + e.toString()); tRes.tested("setFilter()", false); } } - + /** * Object relation <code>xQueryAna</code> set a complex filter with method . <code>setFilter</code>. Then <code>getStructuredFilter</code> returns a @@ -152,7 +152,7 @@ public class _XSingleSelectQueryComposer extends MultiMethodTest { oObj.setFilter(""); oObj.setStructuredFilter(aStructuredFilter); tRes.tested("setStructuredFilter()", (xQueryAna.getFilter().equals(complexFilter))); - + } catch (com.sun.star.sdbc.SQLException e){ log.println("unexpected Exception: " + e.toString()); tRes.tested("setStructuredFilter()", false); @@ -161,10 +161,10 @@ public class _XSingleSelectQueryComposer extends MultiMethodTest { tRes.tested("setStructuredFilter()", false); } } - + /** - * At first the object relation <code>xProp</code> was set as parameter. - * Relation <code>xQueryAna</code> was used to chek if realtion + * At first the object relation <code>xProp</code> was set as parameter. + * Relation <code>xQueryAna</code> was used to chek if realtion * <code>colName</code> was found. * Second an empty <code>XPropertySet</code> was used as parameter. A * <code>com.sun.star.sdbc.SQLException</code> must be thrown. @@ -172,22 +172,22 @@ public class _XSingleSelectQueryComposer extends MultiMethodTest { public void _appendFilterByColumn() { boolean ok = true; try{ - + oObj.appendFilterByColumn(xProp, true,SQLFilterOperator.EQUAL); log.println("appendFilterByColumn: " + xQueryAna.getFilter()); ok = ok && (xQueryAna.getFilter().indexOf(colName) > 0); - + } catch (com.sun.star.sdbc.SQLException e){ log.println("unexpected Exception: " + e.toString()); tRes.tested("appendFilterByColumn()", false); } try{ - + oObj.appendFilterByColumn(xProp, false,SQLFilterOperator.EQUAL); log.println("appendFilterByColumn: " + xQueryAna.getFilter()); ok = ok && (xQueryAna.getFilter().indexOf(colName) > 0); - + } catch (com.sun.star.sdbc.SQLException e){ log.println("unexpected Exception: " + e.toString()); tRes.tested("appendFilterByColumn()", false); @@ -198,7 +198,7 @@ public class _XSingleSelectQueryComposer extends MultiMethodTest { oObj.appendFilterByColumn(dummy, true,SQLFilterOperator.EQUAL); log.println("expected Exception was not thrown"); tRes.tested("appendFilterByColumn()", false); - + } catch (com.sun.star.sdbc.SQLException e){ log.println("expected Exception"); ok = ok && true; @@ -216,11 +216,11 @@ public class _XSingleSelectQueryComposer extends MultiMethodTest { public void _appendGroupByColumn() { boolean ok = true; try{ - + oObj.appendGroupByColumn(xProp); log.println("appendGroupByColumn: " + xQueryAna.getFilter()); ok = ok && (xQueryAna.getFilter().indexOf(colName) > 0); - + } catch (com.sun.star.sdbc.SQLException e){ log.println("unexpected Exception: " + e.toString()); tRes.tested("appendGroupByColumn()", false); @@ -230,17 +230,17 @@ public class _XSingleSelectQueryComposer extends MultiMethodTest { oObj.appendGroupByColumn(dummy); log.println("expected Exception was not thrown"); tRes.tested("appendGroupByColumn()", false); - + } catch (com.sun.star.sdbc.SQLException e){ log.println("expected Exception"); ok = ok && true; } - tRes.tested("appendGroupByColumn()", ok); + tRes.tested("appendGroupByColumn()", ok); } /** * The group which was setted by <code>setGroup</code> must be returned - * while calling from object relation <code>XQueryAna</code> + * while calling from object relation <code>XQueryAna</code> * method <code>getGroup</code> */ public void _setGroup() { @@ -248,17 +248,17 @@ public class _XSingleSelectQueryComposer extends MultiMethodTest { String group = "\"Identifier\""; oObj.setGroup(group); tRes.tested("setGroup()", (xQueryAna.getGroup().equals(group))); - + } catch (com.sun.star.sdbc.SQLException e){ log.println("unexpected Exception: " + e.toString()); tRes.tested("setGroup()", false); } } - - + + /** * The cluase which was setted by <code>setHavingClause</code> must be returned - * while calling from object relation <code>XQueryAna</code> + * while calling from object relation <code>XQueryAna</code> * method <code>getHavingClause</code> */ public void _setHavingClause() { @@ -267,17 +267,17 @@ public class _XSingleSelectQueryComposer extends MultiMethodTest { oObj.setHavingClause(clause); tRes.tested("setHavingClause()", ( xQueryAna.getHavingClause().equals(clause))); - + } catch (com.sun.star.sdbc.SQLException e){ log.println("unexpected Exception: " + e.toString()); tRes.tested("setHavingClause()", false); } } - + /** * At first <code>setHavingClause</code> sets a complex clause. * Then method <code>getStructuredHavingClause</code> from object relation - * <code>xQueryAna</code> returns a valid <code>PropertyValue[][]</code> + * <code>xQueryAna</code> returns a valid <code>PropertyValue[][]</code> * Method <code>setHavingClause</code> was called with an empty sting to * reset filter. Now <code>setStructuredHavingClause</code> with the valid * <code>PropertyValue[][]</code> as parameter was called. @@ -294,16 +294,16 @@ public class _XSingleSelectQueryComposer extends MultiMethodTest { requiredMethod("setHavingClause()"); executeMethod("setStructuredFilter()"); 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' )"; - + try{ oObj.setHavingClause(complexFilter); - PropertyValue[][] aStructuredHaving = + PropertyValue[][] aStructuredHaving = xQueryAna.getStructuredHavingClause(); oObj.setHavingClause(""); oObj.setStructuredHavingClause(aStructuredHaving); - tRes.tested("setStructuredHavingClause()", + tRes.tested("setStructuredHavingClause()", (xQueryAna.getHavingClause().equals(complexFilter))); - + } catch (com.sun.star.sdbc.SQLException e){ log.println("unexpected Exception: " + e.toString()); tRes.tested("setStructuredHavingClause()", false); @@ -320,11 +320,11 @@ public class _XSingleSelectQueryComposer extends MultiMethodTest { public void _appendHavingClauseByColumn() { boolean ok = true; try{ - + oObj.appendHavingClauseByColumn(xProp, true,SQLFilterOperator.EQUAL); log.println("appendHavingClauseByColumn: " + xQueryAna.getFilter()); ok = ok && (xQueryAna.getFilter().indexOf(colName) > 0); - + } catch (com.sun.star.sdbc.SQLException e){ log.println("unexpected Exception: " + e.toString()); tRes.tested("appendHavingClauseByColumn()", false); @@ -334,7 +334,7 @@ public class _XSingleSelectQueryComposer extends MultiMethodTest { oObj.appendHavingClauseByColumn(dummy, true,SQLFilterOperator.EQUAL); log.println("expected Exception was not thrown"); tRes.tested("appendHavingClauseByColumn()", false); - + } catch (com.sun.star.sdbc.SQLException e){ log.println("expected Exception"); ok = ok && true; @@ -352,11 +352,11 @@ public class _XSingleSelectQueryComposer extends MultiMethodTest { public void _appendOrderByColumn() { boolean ok = true; try{ - + oObj.appendOrderByColumn(xProp, true); log.println("appendOrderByColumn: " + xQueryAna.getFilter()); ok = ok && (xQueryAna.getFilter().indexOf(colName) > 0); - + } catch (com.sun.star.sdbc.SQLException e){ log.println("unexpected Exception: " + e.toString()); tRes.tested("appendOrderByColumn()", false); @@ -366,7 +366,7 @@ public class _XSingleSelectQueryComposer extends MultiMethodTest { oObj.appendOrderByColumn(dummy, true); log.println("expected Exception was not thrown"); tRes.tested("appendOrderByColumn()", false); - + } catch (com.sun.star.sdbc.SQLException e){ log.println("expected Exception"); ok = ok && true; @@ -384,13 +384,13 @@ public class _XSingleSelectQueryComposer extends MultiMethodTest { String order = "\"Identifier\""; oObj.setOrder(order); tRes.tested("setOrder()", (xQueryAna.getOrder().equals(order))); - + } catch (com.sun.star.sdbc.SQLException e){ log.println("unexpected Exception: " + e.toString()); tRes.tested("setOrder()", false); } } - - + + } // finish class _XSingleSelectQueryComposer |