summaryrefslogtreecommitdiff
path: root/qadevOOo/tests/java/ifc/sdb
diff options
context:
space:
mode:
Diffstat (limited to 'qadevOOo/tests/java/ifc/sdb')
-rw-r--r--qadevOOo/tests/java/ifc/sdb/_DataAccessDescriptor.java125
-rw-r--r--qadevOOo/tests/java/ifc/sdb/_DataSource.java171
-rw-r--r--qadevOOo/tests/java/ifc/sdb/_DatasourceAdministrationDialog.java45
-rw-r--r--qadevOOo/tests/java/ifc/sdb/_ErrorMessageDialog.java69
-rw-r--r--qadevOOo/tests/java/ifc/sdb/_QueryDefinition.java55
-rw-r--r--qadevOOo/tests/java/ifc/sdb/_RowSet.java149
-rw-r--r--qadevOOo/tests/java/ifc/sdb/_SingleSelectQueryComposer.java50
-rw-r--r--qadevOOo/tests/java/ifc/sdb/_XBookmarksSupplier.java60
-rw-r--r--qadevOOo/tests/java/ifc/sdb/_XCompletedConnection.java84
-rwxr-xr-xqadevOOo/tests/java/ifc/sdb/_XCompletedExecution.java84
-rw-r--r--qadevOOo/tests/java/ifc/sdb/_XFormDocumentsSupplier.java64
-rw-r--r--qadevOOo/tests/java/ifc/sdb/_XParametersSupplier.java61
-rw-r--r--qadevOOo/tests/java/ifc/sdb/_XQueryDefinitionsSupplier.java69
-rw-r--r--qadevOOo/tests/java/ifc/sdb/_XReportDocumentsSupplier.java64
-rw-r--r--qadevOOo/tests/java/ifc/sdb/_XResultSetAccess.java69
-rw-r--r--qadevOOo/tests/java/ifc/sdb/_XRowSetApproveBroadcaster.java214
-rw-r--r--qadevOOo/tests/java/ifc/sdb/_XSQLErrorBroadcaster.java38
-rw-r--r--qadevOOo/tests/java/ifc/sdb/_XSingleSelectQueryAnalyzer.java299
-rw-r--r--qadevOOo/tests/java/ifc/sdb/_XSingleSelectQueryComposer.java396
19 files changed, 2166 insertions, 0 deletions
diff --git a/qadevOOo/tests/java/ifc/sdb/_DataAccessDescriptor.java b/qadevOOo/tests/java/ifc/sdb/_DataAccessDescriptor.java
new file mode 100644
index 000000000000..8ac12a3bba8b
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sdb/_DataAccessDescriptor.java
@@ -0,0 +1,125 @@
+/*************************************************************************
+ *
+ * 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
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package ifc.sdb;
+
+import com.sun.star.sdbc.XConnection;
+import com.sun.star.sdbc.XResultSet;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiPropertyTest;
+
+public class _DataAccessDescriptor extends MultiPropertyTest {
+
+ /**
+ * Tested with custom property tester.
+ */
+ public void _ResultSet() {
+ String propName = "ResultSet";
+ try{
+
+ log.println("try to get value from property...");
+ XResultSet oldValue = (XResultSet) UnoRuntime.queryInterface(XResultSet.class,oObj.getPropertyValue(propName));
+
+ log.println("try to get value from object relation...");
+ XResultSet newValue = (XResultSet) UnoRuntime.queryInterface(XResultSet.class,tEnv.getObjRelation("DataAccessDescriptor.XResultSet"));
+
+ log.println("set property to a new value...");
+ oObj.setPropertyValue(propName, newValue);
+
+ log.println("get the new value...");
+ XResultSet getValue = (XResultSet) UnoRuntime.queryInterface(XResultSet.class,oObj.getPropertyValue(propName));
+
+ tRes.tested(propName, this.compare(newValue, getValue));
+ } catch (com.sun.star.beans.PropertyVetoException e){
+ log.println("could not set property '"+ propName +"' to a new value!");
+ tRes.tested(propName, false);
+ } catch (com.sun.star.lang.IllegalArgumentException e){
+ log.println("could not set property '"+ propName +"' to a new value!");
+ tRes.tested(propName, false);
+ } catch (com.sun.star.beans.UnknownPropertyException e){
+ if (this.isOptional(propName)){
+ // skipping optional property test
+ log.println("Property '" + propName
+ + "' is optional and not supported");
+ tRes.tested(propName,true);
+
+ } else {
+ log.println("could not get property '"+ propName +"' from XPropertySet!");
+ tRes.tested(propName, false);
+ }
+ } catch (com.sun.star.lang.WrappedTargetException e){
+ log.println("could not get property '"+ propName +"' from XPropertySet!");
+ tRes.tested(propName, false);
+ }
+ }
+
+ /**
+ * Tested with custom property tester.
+ */
+ public void _ActiveConnection() {
+ String propName = "ActiveConnection";
+ try{
+
+ log.println("try to get value from property...");
+ XConnection oldValue = (XConnection) UnoRuntime.queryInterface(XConnection.class,oObj.getPropertyValue(propName));
+
+ log.println("try to get value from object relation...");
+ XConnection newValue = (XConnection) UnoRuntime.queryInterface(XConnection.class,tEnv.getObjRelation("DataAccessDescriptor.XConnection"));
+
+ log.println("set property to a new value...");
+ oObj.setPropertyValue(propName, newValue);
+
+ log.println("get the new value...");
+ XConnection getValue = (XConnection) UnoRuntime.queryInterface(XConnection.class,oObj.getPropertyValue(propName));
+
+ tRes.tested(propName, this.compare(newValue, getValue));
+ } catch (com.sun.star.beans.PropertyVetoException e){
+ log.println("could not set property '"+ propName +"' to a new value! " + e.toString());
+ tRes.tested(propName, false);
+ } catch (com.sun.star.lang.IllegalArgumentException e){
+ log.println("could not set property '"+ propName +"' to a new value! " + e.toString());
+ tRes.tested(propName, false);
+ } catch (com.sun.star.beans.UnknownPropertyException e){
+ if (this.isOptional(propName)){
+ // skipping optional property test
+ log.println("Property '" + propName
+ + "' is optional and not supported");
+ tRes.tested(propName,true);
+
+ } else {
+ log.println("could not get property '"+ propName +"' from XPropertySet!");
+ tRes.tested(propName, false);
+ }
+ } catch (com.sun.star.lang.WrappedTargetException e){
+ log.println("could not get property '"+ propName +"' from XPropertySet!");
+ tRes.tested(propName, false);
+ }
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/sdb/_DataSource.java b/qadevOOo/tests/java/ifc/sdb/_DataSource.java
new file mode 100644
index 000000000000..dc275fe5df7a
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sdb/_DataSource.java
@@ -0,0 +1,171 @@
+/*************************************************************************
+ *
+ * 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
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package ifc.sdb;
+
+import lib.MultiPropertyTest;
+
+import com.sun.star.beans.PropertyValue;
+
+/**
+ * Testing <code>com.sun.star.sdb.DataSource</code>
+ * service properties :
+ * <ul>
+ * <li><code> Name</code></li>
+ * <li><code> URL</code></li>
+ * <li><code> Info</code></li>
+ * <li><code> User</code></li>
+ * <li><code> Password</code></li>
+ * <li><code> IsPasswordRequired</code></li>
+ * <li><code> SuppressVersionColumns</code></li>
+ * <li><code> IsReadOnly</code></li>
+ * <li><code> NumberFormatsSupplier</code></li>
+ * <li><code> TableFilter</code></li>
+ * <li><code> TableTypeFilter</code></li>
+ * </ul> <p>
+ * Properties testing is automated by <code>lib.MultiPropertyTest</code> <p>.
+* After this interface test <b>it's better to recreate</b> object tested.
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.beans.XPropertySetInfo
+* @see com.sun.star.beans.Property
+* @see com.sun.star.lang.XServiceInfo
+*/
+public class _DataSource extends MultiPropertyTest {
+
+ /**
+ * This property is an array of additional parameters for database
+ * connecting. Parameter is <code>PropertyValue</code> structure.
+ * The test just changes existing array onto array with a single
+ * element <code>("user", "API_QA_Tester")</code> <p>
+ *
+ * After testing old value is set for this property. <p>
+ *
+ * Result is OK: if property successfully changed with no excepions.
+ * @see com.sun.star.beans.PropertyValue
+ */
+ public void _Info() {
+ try {
+ Object oldInfo = oObj.getPropertyValue("Info") ;
+
+ testProperty("Info", new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+
+ PropertyValue propUsr = new PropertyValue(),
+ propPass = new PropertyValue() ;
+
+ propUsr.Name = "user" ;
+ propUsr.Value = "API_QA_Tester" ;
+ propPass.Name = "password" ;
+ propPass.Value = "guest" ;
+
+ return new PropertyValue[] { propUsr, propPass } ;
+ }
+ }) ;
+
+ oObj.setPropertyValue("Info", oldInfo) ;
+ } catch(com.sun.star.beans.UnknownPropertyException e) {}
+ catch(com.sun.star.beans.PropertyVetoException e) {}
+ catch(com.sun.star.lang.IllegalArgumentException e) {}
+ catch(com.sun.star.lang.WrappedTargetException e) {}
+ }
+
+ /**
+ * Property is tested by the common method, but after testing
+ * old value is set for this property.
+ */
+ public void _URL() {
+ try {
+ Object oldURL = oObj.getPropertyValue("URL") ;
+
+ testProperty("URL") ;
+
+ oObj.setPropertyValue("URL", oldURL) ;
+ } catch(com.sun.star.beans.UnknownPropertyException e) {}
+ catch(com.sun.star.beans.PropertyVetoException e) {}
+ catch(com.sun.star.lang.IllegalArgumentException e) {}
+ catch(com.sun.star.lang.WrappedTargetException e) {}
+ }
+
+ /**
+ * Property is tested by the common method, but after testing
+ * old value is set for this property.
+ */
+ public void _User() {
+ try {
+ Object oldUser = oObj.getPropertyValue("User") ;
+
+ testProperty("User") ;
+
+ oObj.setPropertyValue("User", oldUser) ;
+ } catch(com.sun.star.beans.UnknownPropertyException e) {}
+ catch(com.sun.star.beans.PropertyVetoException e) {}
+ catch(com.sun.star.lang.IllegalArgumentException e) {}
+ catch(com.sun.star.lang.WrappedTargetException e) {}
+ }
+
+ /**
+ * Property is tested by the common method, but after testing
+ * old value is set for this property.
+ */
+ public void _Password() {
+ try {
+ Object oldPass = oObj.getPropertyValue("Password") ;
+
+ testProperty("Password") ;
+
+ oObj.setPropertyValue("Password", oldPass) ;
+ } catch(com.sun.star.beans.UnknownPropertyException e) {}
+ catch(com.sun.star.beans.PropertyVetoException e) {}
+ catch(com.sun.star.lang.IllegalArgumentException e) {}
+ catch(com.sun.star.lang.WrappedTargetException e) {}
+ }
+
+ /**
+ * New value for the test is always <code>null</code>.
+ */
+ public void _NumberFormatsSupplier() {
+ testProperty("NumberFormatsSupplier", new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ return null ;
+ }
+ }) ;
+ }
+
+ /**
+ * If object test allows to recreate environment it is better to do it.
+ */
+ public void after() {
+ try {
+ oObj.setPropertyValue("IsPasswordRequired",new Boolean(false));
+ } catch (Exception e) {
+ log.println("Couldn't set 'IsPasswordRequired' to false");
+ }
+ }
+
+} // finish class _DataSource
+
+
diff --git a/qadevOOo/tests/java/ifc/sdb/_DatasourceAdministrationDialog.java b/qadevOOo/tests/java/ifc/sdb/_DatasourceAdministrationDialog.java
new file mode 100644
index 000000000000..9d62bab6405c
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sdb/_DatasourceAdministrationDialog.java
@@ -0,0 +1,45 @@
+/*************************************************************************
+ *
+ * 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
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package ifc.sdb;
+
+import lib.MultiPropertyTest;
+
+/**
+ * Testing <code>com.sun.star.sdb.DatasourceAdministrationDialog</code>
+ * service properties :
+ * <ul>
+ * <li><code> Title</code></li>
+ * <li><code> ParentWindow</code></li>
+ * </ul> <p>
+ * Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+ * @see com.sun.star.sdb.DatasourceAdministrationDialog
+ */
+public class _DatasourceAdministrationDialog extends MultiPropertyTest {
+
+} // EOF DatasourceAdministrationDialog
+
diff --git a/qadevOOo/tests/java/ifc/sdb/_ErrorMessageDialog.java b/qadevOOo/tests/java/ifc/sdb/_ErrorMessageDialog.java
new file mode 100644
index 000000000000..f9af42b69173
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sdb/_ErrorMessageDialog.java
@@ -0,0 +1,69 @@
+/*************************************************************************
+ *
+ * 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
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package ifc.sdb;
+
+import lib.MultiPropertyTest;
+
+/**
+ * Testing <code>com.sun.star.sdb.ErrorMessageDialog</code>
+ * service properties :
+ * <ul>
+ * <li><code> Title</code></li>
+ * <li><code> ParentWindow</code></li>
+ * <li><code> SQLException</code></li>
+ * </ul> <p>
+ * This test needs the following object relations :
+ * <ul>
+ * <li> <code>'ERR1', 'ERR2'</code>
+ * (of type <code>com.sun.star.sdbc.SQLException</code>):
+ * two objects which are used for changing 'SQLException'
+ * property. </li>
+ * <ul> <p>
+ * Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+ * @see com.sun.star.sdb.ErrorMessageDialog
+ */
+public class _ErrorMessageDialog extends MultiPropertyTest {
+
+ /**
+ * <code>SQLException</code> instances must be used as property
+ * value.
+ */
+ public void _SQLException() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("SQLException", tEnv.getObjRelation("ERR1"),
+ tEnv.getObjRelation("ERR2")) ;
+ }
+
+ public void _ParentWindow(){
+ log.println("Testing with custom Property tester");
+ testProperty("ParentWindow", tEnv.getObjRelation("ERR_XWindow"), null);
+ }
+
+} // finish class _ErrorMessageDialog
+
+
diff --git a/qadevOOo/tests/java/ifc/sdb/_QueryDefinition.java b/qadevOOo/tests/java/ifc/sdb/_QueryDefinition.java
new file mode 100644
index 000000000000..a87733c044ff
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sdb/_QueryDefinition.java
@@ -0,0 +1,55 @@
+/*************************************************************************
+ *
+ * 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
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package ifc.sdb;
+
+import lib.MultiPropertyTest;
+
+/**
+ * Testing <code>com.sun.star.sdb.QueryDefinition</code>
+ * service properties :
+ * <ul>
+ * <li><code> Name</code></li>
+ * <li><code> Command</code></li>
+ * <li><code> EscapeProcessing</code></li>
+ * <li><code> UpdateTableName</code></li>
+ * <li><code> UpdateCatalogName</code></li>
+ * <li><code> UpdateSchemaName</code></li>
+ * </ul> <p>
+ * Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+ * @see com.sun.star.sdb.QueryDefinition
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.beans.XPropertySetInfo
+ * @see com.sun.star.beans.Property
+ * @see com.sun.star.lang.XServiceInfo
+ */
+public class _QueryDefinition extends MultiPropertyTest {
+
+
+} // finish class _QueryDefinition
+
+
diff --git a/qadevOOo/tests/java/ifc/sdb/_RowSet.java b/qadevOOo/tests/java/ifc/sdb/_RowSet.java
new file mode 100644
index 000000000000..593092780a1e
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sdb/_RowSet.java
@@ -0,0 +1,149 @@
+/*************************************************************************
+ *
+ * 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
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package ifc.sdb;
+
+import lib.MultiPropertyTest;
+import lib.StatusException;
+
+import com.sun.star.sdbc.XConnection;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+
+/**
+ * Testing <code>com.sun.star.sdb.RowSet</code>
+ * service properties :
+ * <ul>
+ * <li><code> ActiveConnection</code></li>
+ * <li><code> DataSourceName</code></li>
+ * <li><code> Command</code></li>
+ * <li><code> CommandType</code></li>
+ * <li><code> ActiveCommand</code></li>
+ * <li><code> IgnoreResult</code></li>
+ * <li><code> Filter</code></li>
+ * <li><code> ApplyFilter</code></li>
+ * <li><code> Order</code></li>
+ * <li><code> Privileges</code></li>
+ * <li><code> IsModified</code></li>
+ * <li><code> IsNew</code></li>
+ * <li><code> RowCount</code></li>
+ * <li><code> IsRowCountFinal</code></li>
+ * <li><code> UpdateTableName</code></li>
+ * <li><code> UpdateCatalogName</code></li>
+ * <li><code> UpdateSchemaName</code></li>
+ * </ul> <p>
+ *
+ * Properties are tested in a safe way, this means that old
+ * properties' values are restored to their previous values
+ * after testing. These values are meaningfull for further
+ * testing. <p>
+ *
+ * Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+ * @see com.sun.star.sdb.RowSet
+ */
+public class _RowSet extends MultiPropertyTest {
+
+ /**
+ * The tester implementation which restores properties
+ * values after testing.
+ */
+ protected class SafeTester extends PropertyTester {
+ Object oldValue = null ;
+
+ protected Object getNewValue(String prop, Object old) {
+ log.println("Testing with SafeTester ...") ;
+ oldValue = old ;
+ return super.getNewValue(prop, old) ;
+ }
+
+ protected void checkResult(String propName, Object oldValue,
+ Object newValue, Object resValue, Exception exception)
+ throws Exception {
+
+ super.checkResult(propName, oldValue, newValue, resValue, exception);
+
+ try {
+ oObj.setPropertyValue(propName, this.oldValue);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Exception while setting property to its old value '" +
+ this.oldValue + "' (ignoring) : " + e );
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Exception while setting property to its old value '" +
+ this.oldValue + "' (ignoring) : " + e );
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ log.println("Exception while setting property to its old value '" +
+ this.oldValue + "' (ignoring) : " + e );
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Exception while setting property to its old value '" +
+ this.oldValue + "' (ignoring) : " + e );
+ }
+
+ }
+ }
+
+ /**
+ * Overriden method which tests all the properties
+ * with <code>SafeTester</code>.
+ *
+ * @see #SafeTester
+ */
+ protected void testProperty(String propName) {
+ testProperty(propName, new SafeTester()) ;
+ }
+
+ public void _ActiveConnection() {
+ boolean result = false;
+ try {
+ XConnection the_connection = null;
+
+ try {
+ the_connection = (XConnection) AnyConverter.toObject(
+ new Type(XConnection.class),
+ oObj.getPropertyValue("ActiveConnection"));
+ } catch (com.sun.star.lang.IllegalArgumentException iae) {
+ throw new StatusException("couldn't convert Any",iae);
+ }
+
+ result = (the_connection != null);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println("the property is unknown");
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println(e.getMessage());
+ }
+
+ tRes.tested("ActiveConnection", result) ;
+ }
+
+ /**
+ * Forces environment recreation.
+ */
+ protected void after() {
+ disposeEnvironment();
+ }
+
+} // EOF DatasourceAdministrationDialog
+
diff --git a/qadevOOo/tests/java/ifc/sdb/_SingleSelectQueryComposer.java b/qadevOOo/tests/java/ifc/sdb/_SingleSelectQueryComposer.java
new file mode 100644
index 000000000000..0ccbf0420602
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sdb/_SingleSelectQueryComposer.java
@@ -0,0 +1,50 @@
+/*************************************************************************
+ *
+ * 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
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package ifc.sdb;
+
+import lib.MultiPropertyTest;
+
+/**
+ * Testing <code>com.sun.star.sdb.SingleSelectQueryComposer</code>
+ * service properties :
+ * <ul>
+ * <li><code> Original</code></li>
+ * </ul> <p>
+ * Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+ * @see com.sun.star.sdb.SingleSelectQueryComposer
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.beans.XPropertySetInfo
+ * @see com.sun.star.beans.Property
+ * @see com.sun.star.lang.XServiceInfo
+ */
+public class _SingleSelectQueryComposer extends MultiPropertyTest {
+
+
+} // finish class _SingleSelectQueryComposer
+
+
diff --git a/qadevOOo/tests/java/ifc/sdb/_XBookmarksSupplier.java b/qadevOOo/tests/java/ifc/sdb/_XBookmarksSupplier.java
new file mode 100644
index 000000000000..47a1f501224e
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sdb/_XBookmarksSupplier.java
@@ -0,0 +1,60 @@
+/*************************************************************************
+ *
+ * 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
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package ifc.sdb;
+
+import lib.MultiMethodTest;
+
+import com.sun.star.container.XNameAccess;
+import com.sun.star.sdb.XBookmarksSupplier;
+
+
+/**
+ * Testing <code>com.sun.star.sdb.XBookmarksSupplier</code>
+ * interface methods :
+ * <ul>
+ * <li><code> getBookmarks()</code></li>
+ * </ul> <p>
+ * Test is <b> NOT </b> multithread compilant. <p>
+ * @see com.sun.star.sdb.XBookmarksSupplier
+ */
+public class _XBookmarksSupplier extends MultiMethodTest {
+
+ public XBookmarksSupplier oObj = null ;
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method returns not
+ * <code>null</code> value.
+ */
+ public void _getBookmarks() {
+ XNameAccess bookmarks = oObj.getBookmarks();
+ tRes.tested("getBookmarks()",bookmarks != null);
+ }
+
+} // finish class _XBookmarksSupplier
+
diff --git a/qadevOOo/tests/java/ifc/sdb/_XCompletedConnection.java b/qadevOOo/tests/java/ifc/sdb/_XCompletedConnection.java
new file mode 100644
index 000000000000..6d36198bfa0f
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sdb/_XCompletedConnection.java
@@ -0,0 +1,84 @@
+/*************************************************************************
+ *
+ * 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
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package ifc.sdb;
+
+import lib.MultiMethodTest;
+import lib.StatusException;
+
+import com.sun.star.sdb.XCompletedConnection;
+import com.sun.star.sdbc.XConnection;
+import com.sun.star.task.XInteractionHandler;
+
+/**
+ * Testing <code>com.sun.star.sdb.XCompletedConnection</code>
+ * interface methods :
+ * <ul>
+ * <li><code> connectWithCompletion()</code></li>
+ * </ul> <p>
+* The following object relations required :
+* <ul>
+* <li> <code>'XCompletedConnection.Handler'</code> : passed as parameter
+* to <code>connectWithCompletion</code> method. </li>
+* </ul>
+* @see com.sun.star.sdb.XCompletedConnection
+* @see com.sun.star.task.XInteractionHandler
+* @see com.sun.star.sdbc.XConnection
+*/
+public class _XCompletedConnection extends MultiMethodTest {
+
+ // oObj filled by MultiMethodTest
+ public XCompletedConnection oObj = null ;
+
+ /**
+ * Test call the method with handler passed as object relation.
+ * Then value returned is checked.<p>
+ * Has OK status if not null value returned. <&nbsp>
+ * FAILED if exception occured, null value returned or object
+ * relation was not found.
+ */
+ public void _connectWithCompletion() throws StatusException {
+ XInteractionHandler handler = (XInteractionHandler)
+ tEnv.getObjRelation("XCompletedConnection.Handler") ;
+
+ if (handler == null) {
+ log.println("Required object relation not found !") ;
+ tRes.tested("connectWithCompletion()", false) ;
+ return ;
+ }
+
+ XConnection con = null ;
+ try {
+ con = oObj.connectWithCompletion(handler) ;
+ } catch (com.sun.star.sdbc.SQLException e) {
+ throw new StatusException("Exception while method calling", e) ;
+ }
+
+ tRes.tested("connectWithCompletion()", con != null) ;
+ }
+} // finish class _XCompletedConnection
+
diff --git a/qadevOOo/tests/java/ifc/sdb/_XCompletedExecution.java b/qadevOOo/tests/java/ifc/sdb/_XCompletedExecution.java
new file mode 100755
index 000000000000..3d1c28c6aea0
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sdb/_XCompletedExecution.java
@@ -0,0 +1,84 @@
+/*************************************************************************
+ *
+ * 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
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package ifc.sdb;
+
+import com.sun.star.sdb.XCompletedExecution;
+import com.sun.star.task.XInteractionHandler;
+import java.io.PrintWriter;
+import lib.MultiMethodTest;
+import lib.StatusException;
+
+/**
+ *
+ */
+public class _XCompletedExecution extends MultiMethodTest {
+
+ // oObj filled by MultiMethodTest
+ public XCompletedExecution oObj = null ;
+
+ private CheckInteractionHandler checkHandler = null;
+ /**
+ * Interface to implement so the call of the listener can be checked.
+ */
+ public static interface CheckInteractionHandler extends XInteractionHandler {
+ /**
+ * Set a log of the listener, so messages of the listener get printed
+ * into the file of the interface
+ */
+ public void setLog(PrintWriter log);
+ /**
+ * Return True, when the listener was called correctly.
+ */
+ public boolean checkInteractionHandler();
+ }
+
+ protected void before() {
+ checkHandler = (CheckInteractionHandler)
+ tEnv.getObjRelation("InteractionHandlerChecker");
+ if (checkHandler == null)
+ throw new StatusException("Missing object relation 'InteractionHandlerChecker'", new Exception());
+ checkHandler.setLog((PrintWriter)log);
+ }
+
+
+ public void _executeWithCompletion() {
+ try {
+ oObj.executeWithCompletion(checkHandler);
+ }
+ catch(com.sun.star.sdbc.SQLException e) {
+ e.printStackTrace((PrintWriter)log);
+ tRes.tested("executeWithCompletion()", false);
+ return;
+ }
+
+ tRes.tested("executeWithCompletion()", checkHandler.checkInteractionHandler());
+ }
+
+ protected void after() {
+ disposeEnvironment();
+ }
+}
diff --git a/qadevOOo/tests/java/ifc/sdb/_XFormDocumentsSupplier.java b/qadevOOo/tests/java/ifc/sdb/_XFormDocumentsSupplier.java
new file mode 100644
index 000000000000..b8985324e96a
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sdb/_XFormDocumentsSupplier.java
@@ -0,0 +1,64 @@
+/*************************************************************************
+ *
+ * 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
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package ifc.sdb;
+
+import lib.MultiMethodTest;
+
+import com.sun.star.container.XNameAccess;
+import com.sun.star.sdb.XFormDocumentsSupplier;
+
+/**
+* <code>com.sun.star.sdb.XFormDocumentsSupplier</code> interface
+* testing.
+* @see com.sun.star.sdb.XFormDocumentsSupplier
+*/
+public class _XFormDocumentsSupplier extends MultiMethodTest {
+
+ // oObj filled by MultiMethodTest
+ public XFormDocumentsSupplier oObj = null ;
+
+ /**
+ * Has OK status if not null returned. <p>
+ */
+ public void _getFormDocuments() {
+
+ XNameAccess docs = oObj.getFormDocuments() ;
+
+ String[] docNames = docs.getElementNames() ;
+ if (docNames != null) {
+ log.println("Totally " + docNames.length + " documents :") ;
+ for (int i = 0; i < docNames.length; i++)
+ log.println(" " + docNames[i]) ;
+ }
+
+ tRes.tested("getFormDocuments()", docNames != null) ;
+ }
+
+} // finish class _XFormDocumentsSupplier
+
+
diff --git a/qadevOOo/tests/java/ifc/sdb/_XParametersSupplier.java b/qadevOOo/tests/java/ifc/sdb/_XParametersSupplier.java
new file mode 100644
index 000000000000..865c3f15e47f
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sdb/_XParametersSupplier.java
@@ -0,0 +1,61 @@
+/*************************************************************************
+ *
+ * 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
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package ifc.sdb;
+
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.sdb.XParametersSupplier;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.sdb.XParametersSupplier</code>
+* interface methods :
+* <ul>
+* <li><code> getParameters()</code></li>
+* </ul> <p>
+* Test is multithread compilant. <p>
+* @see com.sun.star.sdb.XParametersSupplier
+*/
+public class _XParametersSupplier extends MultiMethodTest {
+
+ // oObj filled by MultiMethodTest
+ public XParametersSupplier oObj = null ;
+
+ /**
+ * checks of the return of <code>getParameters()</code>
+ * is not null
+ */
+ public void _getParameters() {
+
+ XIndexAccess the_Set = oObj.getParameters();
+ if (the_Set == null) log.println("'getParameters()' returns NULL");
+ tRes.tested("getParameters()",the_Set != null);
+
+ }
+} // finish class _XParametersSupplier
+
+
diff --git a/qadevOOo/tests/java/ifc/sdb/_XQueryDefinitionsSupplier.java b/qadevOOo/tests/java/ifc/sdb/_XQueryDefinitionsSupplier.java
new file mode 100644
index 000000000000..2c9d83716d2f
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sdb/_XQueryDefinitionsSupplier.java
@@ -0,0 +1,69 @@
+/*************************************************************************
+ *
+ * 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
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package ifc.sdb;
+
+import lib.MultiMethodTest;
+
+import com.sun.star.container.XNameAccess;
+import com.sun.star.sdb.XQueryDefinitionsSupplier;
+
+/**
+ * Testing <code>com.sun.star.sdb.XQueryDefinitionsSupplier</code>
+ * interface methods :
+ * <ul>
+ * <li><code> getQueryDefinitions()</code></li>
+ * </ul> <p>
+ * Test is <b> NOT </b> multithread compilant. <p>
+ * @see com.sun.star.sdb.XQueryDefinitionsSupplier
+ */
+public class _XQueryDefinitionsSupplier extends MultiMethodTest {
+
+ // oObj filled by MultiMethodTest
+ public XQueryDefinitionsSupplier oObj = null ;
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method returns not
+ * <code>null</code> value.
+ */
+ public void _getQueryDefinitions() {
+
+ XNameAccess docs = oObj.getQueryDefinitions() ;
+
+ String[] docNames = docs.getElementNames() ;
+ if (docNames != null) {
+ log.println("Totally " + docNames.length + " queries :") ;
+ for (int i = 0; i < docNames.length; i++)
+ log.println(" " + docNames[i]) ;
+ }
+
+ tRes.tested("getQueryDefinitions()", docNames != null) ;
+ }
+
+} // finish class _XQueryDefinitionsSupplier
+
diff --git a/qadevOOo/tests/java/ifc/sdb/_XReportDocumentsSupplier.java b/qadevOOo/tests/java/ifc/sdb/_XReportDocumentsSupplier.java
new file mode 100644
index 000000000000..2abe69303961
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sdb/_XReportDocumentsSupplier.java
@@ -0,0 +1,64 @@
+/*************************************************************************
+ *
+ * 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
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package ifc.sdb;
+
+import lib.MultiMethodTest;
+
+import com.sun.star.container.XNameAccess;
+import com.sun.star.sdb.XReportDocumentsSupplier;
+
+/**
+* <code>com.sun.star.sdb.XReportDocumentsSupplier</code> interface
+* testing.
+* @see com.sun.star.sdb.XReportDocumentsSupplier
+*/
+public class _XReportDocumentsSupplier extends MultiMethodTest {
+
+ // oObj filled by MultiMethodTest
+ public XReportDocumentsSupplier oObj = null ;
+
+ /**
+ * Has OK status if not null returned. <p>
+ */
+ public void _getReportDocuments() {
+
+ XNameAccess docs = oObj.getReportDocuments() ;
+
+ String[] docNames = docs.getElementNames() ;
+ if (docNames != null) {
+ log.println("Totally " + docNames.length + " documents :") ;
+ for (int i = 0; i < docNames.length; i++)
+ log.println(" " + docNames[i]) ;
+ }
+
+ tRes.tested("getReportDocuments()", docNames != null) ;
+ }
+
+} // finish class _XReportDocumentsSupplier
+
+
diff --git a/qadevOOo/tests/java/ifc/sdb/_XResultSetAccess.java b/qadevOOo/tests/java/ifc/sdb/_XResultSetAccess.java
new file mode 100644
index 000000000000..29711bff9f33
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sdb/_XResultSetAccess.java
@@ -0,0 +1,69 @@
+/*************************************************************************
+ *
+ * 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
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package ifc.sdb;
+
+import lib.MultiMethodTest;
+
+import com.sun.star.sdb.XResultSetAccess;
+import com.sun.star.sdbc.XResultSet;
+
+/**
+* Testing <code>com.sun.star.sdb.XResultSetAccess</code>
+* interface methods :
+* <ul>
+* <li><code> createResultSet()</code></li>
+* </ul> <p>
+* Test is multithread compilant. <p>
+* @see com.sun.star.sdb.XResultSetAccess
+*/
+public class _XResultSetAccess extends MultiMethodTest {
+
+ // oObj filled by MultiMethodTest
+ public XResultSetAccess oObj = null ;
+
+ /**
+ * tries to create a ResultSet for the Object</br>
+ * an XResultSet is returned.</br>
+ * The test is OK if an not null ResultSet is returned
+ */
+ public void _createResultSet() {
+
+ try {
+ XResultSet the_Set = oObj.createResultSet();
+ if (the_Set == null) log.println("'createResulSet()' returns NULL");
+ tRes.tested("createResultSet()",the_Set != null);
+ } catch (com.sun.star.sdbc.SQLException e) {
+ log.println("Exception while checking 'createResultSet()'");
+ e.printStackTrace(log);
+ tRes.tested("createResultSet()",false);
+ }
+
+ }
+} // finish class _XResultSetAccess
+
+
diff --git a/qadevOOo/tests/java/ifc/sdb/_XRowSetApproveBroadcaster.java b/qadevOOo/tests/java/ifc/sdb/_XRowSetApproveBroadcaster.java
new file mode 100644
index 000000000000..cd4a0490559b
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sdb/_XRowSetApproveBroadcaster.java
@@ -0,0 +1,214 @@
+/*************************************************************************
+ *
+ * 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
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package ifc.sdb;
+
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+import com.sun.star.lang.EventObject;
+import com.sun.star.sdb.RowChangeEvent;
+import com.sun.star.sdb.XRowSetApproveBroadcaster;
+import com.sun.star.sdb.XRowSetApproveListener;
+
+/**
+* <code>com.sun.star.sdb.XRowSetApproveBroadcaster</code> interface test. <p>
+* Required object relations :
+* <ul>
+* <li> <code>'XRowSetApproveBroadcaster.ApproveChecker'</code>:
+* implementation of inner interface <code>RowSetApproveChecker</code>
+* which can move cursor within a rowset, change row, and change the
+* whole rowset. </li>
+* </ul> <p>
+* It is better to recreate the object after test, because of unknown
+* actions made by <code>RowSetApproveChecker</code> interface implementation.
+*
+* @see com.sun.star.sdb.XRowSetApproveBroadcaster
+* @see _XRowSetApproveBroadcaster.RowSetApproveChecker
+*/
+public class _XRowSetApproveBroadcaster extends MultiMethodTest {
+
+ // oObj filled by MultiMethodTest
+ public XRowSetApproveBroadcaster oObj = null ;
+
+ /**
+ * The purpose of this interface is to pass to this test
+ * relation which can make some operations with row set
+ * on which <code>XRowSetApproveListener</code>s can react.
+ * @see com.sun.star.sdb.XRowSetApproveListener
+ */
+ public static interface RowSetApproveChecker {
+ /**
+ * Moves cursor within row set. Method <code>approveCursorMove</code>
+ * of <code>XRowSetApproveListener</code> must be called.
+ */
+ public void moveCursor() ;
+ /**
+ * Change rows in row set. Method <code>approveRowChange</code>
+ * of <code>XRowSetApproveListener</code> must be called.
+ * @return <code>RowChangeEvent</code> structure which contains
+ * what type of change was made and how many rows it affected.
+ * @see com.sun.star.sdb.RowChangeEvent
+ */
+ public RowChangeEvent changeRow() ;
+ /**
+ * Change the whole row set. Method <code>approveRowSetChange</code>
+ * of <code>XRowSetApproveListener</code> must be called.
+ */
+ public void changeRowSet() ;
+ }
+
+ /**
+ * Implementation of <code>XRowSetApproveListener</code> interface
+ * which just detects and stores approve requipements. They are checked
+ * later.
+ */
+ private class TestListener implements XRowSetApproveListener {
+ public boolean approveRequests = true ;
+ public boolean approveCursorMoveCalled = false ;
+ public boolean approveRowChangeCalled = false ;
+ public RowChangeEvent approveRowChangeEvent = null ;
+ public boolean approveRowSetChangeCalled = false ;
+
+ public TestListener(boolean approve) {
+ approveRequests = approve ;
+ }
+
+ public void reset() {
+ approveCursorMoveCalled = false ;
+ approveRowChangeCalled = false ;
+ approveRowSetChangeCalled = false ;
+ }
+ public boolean approveCursorMove(EventObject ev) {
+ approveCursorMoveCalled = true ;
+ return approveRequests ;
+ }
+ public boolean approveRowChange(RowChangeEvent ev) {
+ approveRowChangeCalled = true ;
+ approveRowChangeEvent = ev ;
+ return approveRequests ;
+ }
+ public boolean approveRowSetChange(EventObject ev) {
+ approveRowSetChangeCalled = true ;
+ return approveRequests ;
+ }
+ public void disposing(EventObject ev) {}
+ }
+ private TestListener listener1 = null ;
+
+ private RowSetApproveChecker checker = null ;
+
+ /**
+ * Tries to retrieve object relation.
+ */
+ public void before() {
+ checker = (RowSetApproveChecker) tEnv.getObjRelation
+ ("XRowSetApproveBroadcaster.ApproveChecker") ;
+
+ if (checker == null) {
+ log.println("!!! Relation for test not found !!!") ;
+ throw new StatusException(Status.failed
+ ("!!! Relation for test not found !!!")) ;
+ }
+ }
+
+ /**
+ * Creates and adds listener, then call <code>RowSetApproveChecker</code>
+ * methods for listener methods to be called. Then checks if
+ * listener methods were called on appropriate actions. <p>
+ * Has OK status : If and only if appropriate listener methods called,
+ * and listener <code>approveRowChange</code> method has write parameter,
+ * i.e. type and rows number expected.
+ */
+ public void _addRowSetApproveListener() {
+ listener1 = new TestListener(true) ;
+ oObj.addRowSetApproveListener(listener1) ;
+ log.println("Listener added.") ;
+
+ boolean result = true ;
+
+ checker.moveCursor() ;
+ log.println("Cursor moved.") ;
+ result &= listener1.approveCursorMoveCalled ;
+
+ listener1.reset() ;
+ RowChangeEvent actualEvent = checker.changeRow() ;
+ log.println("Row changed.") ;
+
+ RowChangeEvent event = listener1.approveRowChangeEvent ;
+ result &= listener1.approveRowChangeCalled ;
+
+ boolean eventOK = event.Action == actualEvent.Action &&
+ event.Rows == actualEvent.Rows ;
+
+ result &= eventOK ;
+
+ listener1.reset() ;
+ checker.changeRowSet();
+ log.println("Row set changed.") ;
+ result &= listener1.approveRowSetChangeCalled ;
+
+ tRes.tested("addRowSetApproveListener()", result) ;
+ }
+
+ /**
+ * Removes listener inserted before, then perform all actions
+ * on which listener must react. <p>
+ * Has OK status if no listener methods were called. <p>
+ * Methods required to pass before :
+ * <ul>
+ * <li> <code>_addRowSetApproveListener</code> </li>
+ * </ul>
+ */
+ public void _removeRowSetApproveListener() {
+ requiredMethod("addRowSetApproveListener()") ;
+
+ listener1.reset() ;
+
+ oObj.removeRowSetApproveListener(listener1) ;
+
+ checker.moveCursor() ;
+ checker.changeRow() ;
+ checker.changeRowSet() ;
+
+ tRes.tested("removeRowSetApproveListener()",
+ !listener1.approveCursorMoveCalled &&
+ !listener1.approveRowChangeCalled &&
+ !listener1.approveRowSetChangeCalled) ;
+ }
+
+ /**
+ * Disposes object environment.
+ */
+ public void after() {
+ disposeEnvironment() ;
+ }
+
+} // finish class _XRowSetApproveBroadcaster
+
+
diff --git a/qadevOOo/tests/java/ifc/sdb/_XSQLErrorBroadcaster.java b/qadevOOo/tests/java/ifc/sdb/_XSQLErrorBroadcaster.java
new file mode 100644
index 000000000000..2b5d7f1513a7
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sdb/_XSQLErrorBroadcaster.java
@@ -0,0 +1,38 @@
+/*************************************************************************
+ *
+ * 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
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package ifc.sdb;
+
+import com.sun.star.sdb.XSQLErrorBroadcaster;
+import lib.MultiMethodTest;
+
+/**
+ *
+ */
+public class _XSQLErrorBroadcaster extends MultiMethodTest {
+
+ public XSQLErrorBroadcaster oObj = null;
+}
diff --git a/qadevOOo/tests/java/ifc/sdb/_XSingleSelectQueryAnalyzer.java b/qadevOOo/tests/java/ifc/sdb/_XSingleSelectQueryAnalyzer.java
new file mode 100644
index 000000000000..cc88075a9b8b
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sdb/_XSingleSelectQueryAnalyzer.java
@@ -0,0 +1,299 @@
+/*************************************************************************
+ *
+ * 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
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package ifc.sdb;
+
+import com.sun.star.sdb.XSingleSelectQueryAnalyzer;
+import lib.MultiMethodTest;
+import com.sun.star.sdb.XSingleSelectQueryComposer;
+import com.sun.star.uno.UnoRuntime;
+import lib.StatusException;
+import lib.Status;
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.container.XIndexAccess;
+
+/**
+* Testing <code>com.sun.star.sdb.XSingleSelectQueryAnalyzer</code>
+* interface methods :
+* <ul>
+* <li><code>getQuery()</code></li>
+* <li><code>setQuery()</code></li>
+* <li><code>getFilter()</code></li>
+* <li><code>getStructuredFilter()</code></li>
+* <li><code>getGroup()</code></li>
+* <li><code>getGroupColumns()</code></li>
+* <li><code>getHavingClause()</code></li>
+* <li><code>getStructuredHavingClause()</code></li>
+* <li><code>getOrder()</code></li>
+* <li><code>getOrderColumns()</code></li>
+
+* </ul> <p>
+* @see com.sun.star.sdb.XSingleSelectQueryAnalyzer
+*/
+public class _XSingleSelectQueryAnalyzer extends MultiMethodTest {
+
+ // oObj filled by MultiMethodTest
+ public XSingleSelectQueryAnalyzer oObj = null ;
+
+ private String queryString = "SELECT * FROM \"biblio\"";
+
+ private XSingleSelectQueryComposer xComposer = null;
+
+ /**
+ * Recieves the object relations:
+ * <ul>
+ * <li><code>XSingleSelectQueryComposer xCompoer</code></li>
+ * </ul> <p>
+ * @see om.sun.star.sdb.XSingleSelectQueryComposer
+ */
+ protected void before() {
+
+ xComposer = (XSingleSelectQueryComposer)
+ UnoRuntime.queryInterface(XSingleSelectQueryComposer.class,
+ tEnv.getObjRelation("xComposer"));
+
+ if (xComposer == null) {
+ throw new StatusException(Status.failed(
+ "Couldn't get object relation 'xComposer'. Test must be modified"));
+
+ }
+
+ }
+ /**
+ * call <code>setQuery()</code> once with valid query, once with invalid
+ * query. Has ok if only on sceond call <code>SQLException</code> was thrwon
+ */
+ public void _setQuery() {
+
+ try{
+ oObj.setQuery("This is an invalid SQL query");
+ } catch (com.sun.star.sdbc.SQLException e){
+ log.println("expected Exception. ");
+ }
+
+ try{
+ oObj.setQuery(queryString);
+ } catch (com.sun.star.sdbc.SQLException e){
+ log.println("unexpected Exception: " + e.toString());
+ tRes.tested("setQuery()", false);
+ }
+ tRes.tested("setQuery()", true);
+ }
+
+ /**
+ * checks of the returned value of <code>getQuery()</code>
+ * equals the string which was set by <code>setQuery()</code>
+ * <p>
+ * required methods:
+ *<ul>
+ * <li><code>setQuery</code></li>
+ *</ul>
+ */
+ public void _getQuery() {
+ this.requiredMethod("setQuery()");
+
+ boolean res = false;
+
+ res = oObj.getQuery().equals(queryString);
+
+ tRes.tested("getQuery()", res);
+ }
+
+
+ /**
+ * Object relation <code>xComposer</code> set a filter. This filter
+ * must returned while calling <code>getFilter</code>
+ */
+ public void _getFilter() {
+ try{
+ String filter = "\"Identifier\" = 'BOR02b'";
+ xComposer.setFilter(filter);
+ tRes.tested("getFilter()", (oObj.getFilter().equals(filter)));
+
+ } catch (com.sun.star.sdbc.SQLException e){
+ log.println("unexpected Exception: " + e.toString());
+ tRes.tested("getFilter()", false);
+ }
+ }
+
+ /**
+ * Object relation <code>xComposer</code> set a complex filter with method
+ . <code>setFilter</code>. Then <code>getStructuredFilter</code> returns a
+ * sequenze of <code>PropertyValue</code> which was set with method
+ * <code>setStructuredFilter</code> from <xComposer>.
+ * Then test has ok status if <getFilter> returns the complex filter.
+ * <p>
+ * required methods:
+ *<ul>
+ * <li><code>setQuery</code></li>
+ * <li><code>getFilter</code></li>
+ *</ul>
+ */
+ public void _getStructuredFilter() {
+ requiredMethod("setQuery()");
+ requiredMethod("getFilter()");
+ try{
+ oObj.setQuery("SELECT \"Identifier\", \"Type\", \"Address\" FROM \"biblio\" \"biblio\"");
+ 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' )";
+ xComposer.setFilter(complexFilter);
+ PropertyValue[][] aStructuredFilter = oObj.getStructuredFilter();
+ xComposer.setFilter("");
+ xComposer.setStructuredFilter(aStructuredFilter);
+ tRes.tested("getStructuredFilter()", (oObj.getFilter().equals(complexFilter)));
+
+ } catch (com.sun.star.sdbc.SQLException e){
+ log.println("unexpected Exception: " + e.toString());
+ tRes.tested("getStructuredFilter()", false);
+ } catch (com.sun.star.lang.IllegalArgumentException e){
+ log.println("unexpected Exception: " + e.toString());
+ tRes.tested("getStructuredFilter()", false);
+ }
+ }
+
+ /**
+ * Object relation <code>xComposer</code> set a goup. This group
+ * must returned while calling <code>getGroup</code>
+ */
+ public void _getGroup() {
+ try{
+ String group = "\"Identifier\"";
+ xComposer.setGroup(group);
+ tRes.tested("getGroup()", (oObj.getGroup().equals(group)));
+
+ } catch (com.sun.star.sdbc.SQLException e){
+ log.println("unexpected Exception: " + e.toString());
+ tRes.tested("getGroup()", false);
+ }
+ }
+
+ /**
+ * Method <code>getGroupColumns</code> retunrs a <code>XIndexAccess</code>
+ * Test has ok status if returned value is an useable <code>XIndexAccess</code>
+ */
+ public void _getGroupColumns() {
+ try{
+ XIndexAccess xGroupColumns = oObj.getGroupColumns();
+
+ tRes.tested("getGroupColumns()", (xGroupColumns != null &&
+ xGroupColumns.getCount() == 1 &&
+ xGroupColumns.getByIndex(0) != null));
+
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e){
+ log.println("unexpected Exception: " + e.toString());
+ tRes.tested("getGroupColumns()", false);
+ } catch (com.sun.star.lang.WrappedTargetException e){
+ log.println("unexpected Exception: " + e.toString());
+ tRes.tested("getGroupColumns()", false);
+ }
+ }
+
+ /**
+ * Object relation <code>xComposer</code> set a clause. This clause
+ * must returned while calling <code>getHavingClause</code>
+ */
+ public void _getHavingClause() {
+ try{
+ String clause = "\"Identifier\" = 'BOR02b'";
+ xComposer.setHavingClause(clause);
+ tRes.tested("getHavingClause()", (
+ oObj.getHavingClause().equals(clause)));
+
+ } catch (com.sun.star.sdbc.SQLException e){
+ log.println("unexpected Exception: " + e.toString());
+ tRes.tested("getHavingClause()", false);
+ }
+ }
+
+ /**
+ * Object relation <code>xComposer</code> set a clause. This clause
+ * must returned while calling <code>getHavingClause</code>
+ * <p>
+ * required methods:
+ *<ul>
+ * <li><code>setQuery</code></li>
+ * <li><code>getFilter</code></li>
+ * <li><code>getStructuredFilter</code></li>
+ *</ul>
+ */
+ public void _getStructuredHavingClause() {
+ requiredMethod("setQuery()");
+ requiredMethod("getFilter()");
+ executeMethod("getStructuredFilter()");
+ 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{
+ xComposer.setHavingClause(complexFilter);
+ PropertyValue[][] aStructuredHaving = oObj.getStructuredHavingClause();
+ xComposer.setHavingClause("");
+ xComposer.setStructuredHavingClause(aStructuredHaving);
+ tRes.tested("getStructuredHavingClause()",
+ (oObj.getHavingClause().equals(complexFilter)));
+
+ } catch (com.sun.star.sdbc.SQLException e){
+ log.println("unexpected Exception: " + e.toString());
+ tRes.tested("getStructuredHavingClause()", false);
+ }
+ }
+
+ /**
+ * Object relation <code>xComposer</code> set an order. This order
+ * must returned while calling <code>getOrder</code>
+ */
+ public void _getOrder() {
+ try{
+ String order = "\"Identifier\"";
+ xComposer.setOrder(order);
+ tRes.tested("getOrder()", (oObj.getOrder().equals(order)));
+
+ } catch (com.sun.star.sdbc.SQLException e){
+ log.println("unexpected Exception: " + e.toString());
+ tRes.tested("getOrder()", false);
+ }
+ }
+
+ /**
+ * Method <code>getGroupColumns</code> retunrs a <code>XIndexAccess</code>
+ * Test has ok status if returned value is an useable <code>XIndexAccess</code>
+ */
+ public void _getOrderColumns() {
+ try{
+ XIndexAccess xOrderColumns = oObj.getOrderColumns();
+ tRes.tested("getOrderColumns()", (xOrderColumns != null &&
+ xOrderColumns.getCount() == 1 &&
+ xOrderColumns.getByIndex(0) != null));
+
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e){
+ log.println("unexpected Exception: " + e.toString());
+ tRes.tested("getOrderColumns()", false);
+ } catch (com.sun.star.lang.WrappedTargetException e){
+ log.println("unexpected Exception: " + e.toString());
+ tRes.tested("getOrderColumns()", false);
+ }
+ }
+
+
+} // finish class _XSingleSelectQueryAnalyzer
diff --git a/qadevOOo/tests/java/ifc/sdb/_XSingleSelectQueryComposer.java b/qadevOOo/tests/java/ifc/sdb/_XSingleSelectQueryComposer.java
new file mode 100644
index 000000000000..12562abde2b9
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sdb/_XSingleSelectQueryComposer.java
@@ -0,0 +1,396 @@
+/*************************************************************************
+ *
+ * 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
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package ifc.sdb;
+
+import com.sun.star.sdb.XSingleSelectQueryComposer;
+import lib.MultiMethodTest;
+import com.sun.star.sdb.XSingleSelectQueryAnalyzer;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.UnoRuntime;
+import lib.StatusException;
+import lib.Status;
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.sdb.SQLFilterOperator;
+
+/**
+* Testing <code>com.sun.star.sdb.XSingleSelectQueryComposer</code>
+* interface methods :
+* <ul>
+* <li><code>setFilter()</code></li>
+* <li><code>setStructuredFilter()</code></li>
+* <li><code>appendFilterByColumn()</code></li>
+* <li><code>appendGroupByColumn()</code></li>
+* <li><code>setGroup()</code></li>
+* <li><code>setHavingClause()</code></li>
+* <li><code>setStructuredHavingClause()</code></li>
+* <li><code>appendHavingClauseByColumn()</code></li>
+* <li><code>appendOrderByColumn()</code></li>
+* <li><code>setOrder()</code></li>
+
+* </ul> <p>
+* @see com.sun.star.sdb.XSingleSelectQueryComposer
+*/
+public class _XSingleSelectQueryComposer extends MultiMethodTest {
+
+ // oObj filled by 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>
+ * <li><code>XSingleSelectQueryAnalyzer xQueryAna</code></li>
+ * <li><code>XPropertySet xProp</code></li>
+ * <li><code>String colName</code></li>
+ * </ul> <p>
+ * @see om.sun.star.sdb.XSingleSelectQueryAnalyzer
+ * @see com.sun.star.beans.XPropertySet
+ */
+ protected void before() /* throws Exception*/ {
+
+ xQueryAna = (XSingleSelectQueryAnalyzer)
+ UnoRuntime.queryInterface(XSingleSelectQueryAnalyzer.class,
+ tEnv.getObjRelation("xQueryAna"));
+
+ 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"));
+
+ 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"));
+ }
+ catch (com.sun.star.lang.IllegalArgumentException e)
+ {
+ colName = null;
+ }
+
+ 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>
+ */
+ public void _setFilter() {
+ try{
+ 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
+ * sequenze of <code>PropertyValue</code> which was set with method
+ * <code>setStructuredFilter</code> from <code>xQueryAna</code>.
+ * Then test has ok status if <code>getFilter</code> returns the complex filter.
+ */
+ public void _setStructuredFilter() {
+ requiredMethod("setFilter()");
+ try{
+ xQueryAna.setQuery("SELECT \"Identifier\", \"Type\", \"Address\" FROM \"biblio\" \"biblio\"");
+ 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' )";
+ oObj.setFilter(complexFilter);
+ PropertyValue[][] aStructuredFilter = xQueryAna.getStructuredFilter();
+ 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);
+ } catch (com.sun.star.lang.IllegalArgumentException e){
+ log.println("unexpected Exception: " + e.toString());
+ 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
+ * <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.
+ */
+ 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);
+ }
+
+ try{
+ XPropertySet dummy = null;
+ 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;
+ }
+ tRes.tested("appendFilterByColumn()", ok);
+ }
+
+ /**
+ * At first the object relation <code>xProp</code> was used 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. An
+ * <code>com.sun.star.sdbc.SQLException</code> must be thrown.
+ */
+ 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);
+ }
+ try{
+ XPropertySet dummy = null;
+ 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);
+ }
+
+ /**
+ * The group which was setted by <code>setGroup</code> must be returned
+ * while calling from object relation <code>XQueryAna</code>
+ * method <code>getGroup</code>
+ */
+ public void _setGroup() {
+ try{
+ 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>
+ * method <code>getHavingClause</code>
+ */
+ public void _setHavingClause() {
+ try{
+ String clause = "\"Identifier\" = 'BOR02b'";
+ 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>
+ * 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.
+ * Test is ok if <code>getHavingClause</code> from <code>xQueryAna</code>
+ * returns the complex clause from beginning.
+ * <p>
+ * required methods:
+ *<ul>
+ * <li><code>setHavingClause</code></li>
+ * <li><code>setStructuredFilter</code></li>
+ *</ul>
+ */
+ public void _setStructuredHavingClause() {
+ 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 =
+ xQueryAna.getStructuredHavingClause();
+ oObj.setHavingClause("");
+ oObj.setStructuredHavingClause(aStructuredHaving);
+ tRes.tested("setStructuredHavingClause()",
+ (xQueryAna.getHavingClause().equals(complexFilter)));
+
+ } catch (com.sun.star.sdbc.SQLException e){
+ log.println("unexpected Exception: " + e.toString());
+ tRes.tested("setStructuredHavingClause()", false);
+ }
+ }
+
+ /**
+ * First object relation <code>xProp</code> was used as parameter. Relation
+ * <code>xQueryAna</code> was used to chek if realtion <code>colName</code>
+ * was found.
+ * Second an empty <code>XPropertySet</code> was given as parameter. An
+ * <code>com.sun.star.sdbc.SQLException</code> must be thrown.
+ */
+ 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);
+ }
+ try{
+ XPropertySet dummy = null;
+ 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;
+ }
+ tRes.tested("appendHavingClauseByColumn()", ok);
+ }
+
+ /**
+ * First 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 given as parameter. An
+ * <code>com.sun.star.sdbc.SQLException</code> must be thrown.
+ */
+ 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);
+ }
+ try{
+ XPropertySet dummy = null;
+ 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;
+ }
+ tRes.tested("appendOrderByColumn()", ok);
+ }
+
+
+ /**
+ * Method <code>getOrder</code> from object relation <code>xQueryAna</code>
+ * checks the order which was setted while calling <code>setOrder</code>
+ */
+ public void _setOrder() {
+ try{
+ 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