summaryrefslogtreecommitdiff
path: root/qadevOOo/tests/java/ifc/form
diff options
context:
space:
mode:
Diffstat (limited to 'qadevOOo/tests/java/ifc/form')
-rw-r--r--qadevOOo/tests/java/ifc/form/_DataAwareControlModel.java168
-rw-r--r--qadevOOo/tests/java/ifc/form/_FormComponent.java43
-rw-r--r--qadevOOo/tests/java/ifc/form/_FormControlModel.java45
-rw-r--r--qadevOOo/tests/java/ifc/form/_XApproveActionBroadcaster.java110
-rw-r--r--qadevOOo/tests/java/ifc/form/_XBoundComponent.java58
-rw-r--r--qadevOOo/tests/java/ifc/form/_XBoundControl.java82
-rw-r--r--qadevOOo/tests/java/ifc/form/_XChangeBroadcaster.java200
-rw-r--r--qadevOOo/tests/java/ifc/form/_XConfirmDeleteBroadcaster.java75
-rwxr-xr-xqadevOOo/tests/java/ifc/form/_XDatabaseParameterBroadcaster.java100
-rw-r--r--qadevOOo/tests/java/ifc/form/_XFormController.java173
-rw-r--r--qadevOOo/tests/java/ifc/form/_XFormsSupplier.java44
-rw-r--r--qadevOOo/tests/java/ifc/form/_XGrid.java83
-rw-r--r--qadevOOo/tests/java/ifc/form/_XGridColumnFactory.java80
-rw-r--r--qadevOOo/tests/java/ifc/form/_XGridFieldDataSupplier.java68
-rw-r--r--qadevOOo/tests/java/ifc/form/_XImageProducerSupplier.java61
-rw-r--r--qadevOOo/tests/java/ifc/form/_XLoadListener.java94
-rw-r--r--qadevOOo/tests/java/ifc/form/_XLoadable.java247
-rw-r--r--qadevOOo/tests/java/ifc/form/_XReset.java194
-rw-r--r--qadevOOo/tests/java/ifc/form/_XSubmit.java191
-rw-r--r--qadevOOo/tests/java/ifc/form/_XUpdateBroadcaster.java248
-rw-r--r--qadevOOo/tests/java/ifc/form/binding/_BindableDatabaseCheckBox.java36
-rw-r--r--qadevOOo/tests/java/ifc/form/binding/_BindableDatabaseRadioButton.java36
-rw-r--r--qadevOOo/tests/java/ifc/form/binding/_XBindableValue.java122
-rw-r--r--qadevOOo/tests/java/ifc/form/component/_CheckBox.java44
-rw-r--r--qadevOOo/tests/java/ifc/form/component/_ComboBox.java43
-rw-r--r--qadevOOo/tests/java/ifc/form/component/_CommandButton.java45
-rw-r--r--qadevOOo/tests/java/ifc/form/component/_CurrencyField.java58
-rw-r--r--qadevOOo/tests/java/ifc/form/component/_DataForm.java89
-rw-r--r--qadevOOo/tests/java/ifc/form/component/_DatabaseComboBox.java46
-rw-r--r--qadevOOo/tests/java/ifc/form/component/_DatabaseForm.java93
-rw-r--r--qadevOOo/tests/java/ifc/form/component/_DatabaseFormattedField.java44
-rw-r--r--qadevOOo/tests/java/ifc/form/component/_DatabaseImageControl.java44
-rw-r--r--qadevOOo/tests/java/ifc/form/component/_DatabaseListBox.java46
-rw-r--r--qadevOOo/tests/java/ifc/form/component/_DatabasePatternField.java45
-rw-r--r--qadevOOo/tests/java/ifc/form/component/_DatabaseTextField.java45
-rw-r--r--qadevOOo/tests/java/ifc/form/component/_DateField.java55
-rw-r--r--qadevOOo/tests/java/ifc/form/component/_FileControl.java44
-rw-r--r--qadevOOo/tests/java/ifc/form/component/_FormattedField.java35
-rw-r--r--qadevOOo/tests/java/ifc/form/component/_GridControl.java101
-rw-r--r--qadevOOo/tests/java/ifc/form/component/_HTMLForm.java47
-rw-r--r--qadevOOo/tests/java/ifc/form/component/_HiddenControl.java44
-rw-r--r--qadevOOo/tests/java/ifc/form/component/_ImageButton.java46
-rw-r--r--qadevOOo/tests/java/ifc/form/component/_ListBox.java46
-rw-r--r--qadevOOo/tests/java/ifc/form/component/_NavigationToolBar.java52
-rw-r--r--qadevOOo/tests/java/ifc/form/component/_NumericField.java57
-rw-r--r--qadevOOo/tests/java/ifc/form/component/_PatternField.java44
-rw-r--r--qadevOOo/tests/java/ifc/form/component/_RadioButton.java46
-rw-r--r--qadevOOo/tests/java/ifc/form/component/_RichTextControl.java34
-rw-r--r--qadevOOo/tests/java/ifc/form/component/_ScrollBar.java34
-rw-r--r--qadevOOo/tests/java/ifc/form/component/_SpinButton.java34
-rw-r--r--qadevOOo/tests/java/ifc/form/component/_TextField.java44
-rw-r--r--qadevOOo/tests/java/ifc/form/component/_TimeField.java57
-rw-r--r--qadevOOo/tests/java/ifc/form/submission/_XSubmission.java192
-rw-r--r--qadevOOo/tests/java/ifc/form/submission/_XSubmissionSupplier.java81
-rw-r--r--qadevOOo/tests/java/ifc/form/validation/_XValidatable.java85
-rw-r--r--qadevOOo/tests/java/ifc/form/validation/_XValidatableFormComponent.java247
-rw-r--r--qadevOOo/tests/java/ifc/form/validation/_XValidityConstraintListener.java90
57 files changed, 4715 insertions, 0 deletions
diff --git a/qadevOOo/tests/java/ifc/form/_DataAwareControlModel.java b/qadevOOo/tests/java/ifc/form/_DataAwareControlModel.java
new file mode 100644
index 000000000000..a43eaf6f53e8
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/_DataAwareControlModel.java
@@ -0,0 +1,168 @@
+/*************************************************************************
+ *
+ * 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.form;
+
+import lib.MultiPropertyTest;
+import util.utils;
+
+import com.sun.star.form.XLoadable;
+import com.sun.star.uno.XInterface;
+
+/**
+* Testing <code>com.sun.star.form.DataAwareControlModel</code>
+* service properties :
+* <ul>
+* <li><code> DataField</code></li>
+* <li><code> BoundField</code></li>
+* <li><code> LabelControl</code></li>
+* </ul> <p>
+* This test need the following object relations :
+* <ul>
+* <li> <code>'FL'</code> as <code>com.sun.star.form.XLoadable</code>
+* implementation : used to connect control to data source. </li>
+* <li> <code>'LC'</code> as <code>com.sun.star.uno.XInterface</code>
+* implementation : as value for LableControl property (see property
+* documentation). </li>
+* <li> <code>'DataAwareControlModel.NewFieldName'</code> :
+* <b>optional</b> <code>String</code> relation which is used
+* for new value of DataFiled proeprty.</li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* After test completion object environment has to be recreated.
+* @see com.sun.star.form.DataAwareControlModel
+*/
+public class _DataAwareControlModel extends MultiPropertyTest {
+
+ /**
+ * First checks if <code>com.sun.star.form.DataAwareControlModel</code>
+ * service is supported by the object. Then <code>load</code> method
+ * of <code>'FL'</code> relation is called to connect control model
+ * to data source. Because the property is READONLY its value is
+ * just checked to be non null. After that model is disconnected. <p>
+ * Has <b> OK </b> status if the property has non null value. <p>
+ * The following property tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> DataField </code> : to bind the control to some database
+ * field.</li>
+ * </ul>
+ */
+ public void _BoundField() {
+ requiredMethod("DataField") ;
+
+ // This property is TRANSIENT and READONLY.
+ boolean bResult = true;
+ Object gValue = null;
+
+ // get the loader to load the form
+ XLoadable loader = (XLoadable) tEnv.getObjRelation("FL");
+
+ try {
+ if (loader.isLoaded()) {
+ loader.unload() ;
+ }
+ loader.load();
+ gValue = oObj.getPropertyValue("BoundField");
+ loader.unload();
+ bResult &= gValue != null;
+ } catch(com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace(log) ;
+ bResult = false;
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log) ;
+ bResult = false;
+ }
+ tRes.tested("BoundField", bResult);
+ }
+
+ /**
+ * Sets the property to a Database field name, and then checks
+ * if it was properly set. If <code>'DataAwareControlModel.NewFieldName'
+ * </code> relation is not found, then new property value is
+ * 'Address'. <p>
+ * Has <b> OK </b> status if the proeprty was properly set
+ * and no exceptions were thrown. If old and new values are equal
+ * the test is OK if no exceptions occured and the value remains
+ * the same.<p>
+ */
+ public void _DataField() {
+ String relVal = (String) tEnv.getObjRelation
+ ("DataAwareControlModel.NewFieldName") ;
+ final String newVal = relVal == null ? "Address" : relVal ;
+ testProperty("DataField", new PropertyTester() {
+ protected Object getNewValue(String p, Object oldVal) {
+ return newVal ;
+ }
+ protected void checkResult(String propName, Object oldValue,
+ Object newValue, Object resValue, Exception exception)
+ throws java.lang.Exception{
+
+ if (exception == null && oldValue.equals(newValue)) {
+ boolean res = true ;
+ if (newValue.equals(resValue)) {
+ log.println("Old value is equal to new value ('" +
+ oldValue + "'). Possibly no other suitable fields found.") ;
+ } else {
+ log.println("The value was '" + oldValue + "', set to the" +
+ " same value, but result is '" + resValue + "' : FAILED") ;
+ res = false ;
+ }
+
+ tRes.tested(propName, res) ;
+ } else {
+ super.checkResult(propName, oldValue, newValue,
+ resValue, exception);
+ }
+ }
+ }) ;
+ }
+
+ /**
+ * Sets the new value (<code>'LC'</code> relation if <code>null</code>
+ * was before, and <code> null </code> otherwise and then checks if
+ * the value have successfully changed. <p>
+ * Has <b>OK</b> status if the value successfully changed.
+ */
+ public void _LabelControl() {
+ final XInterface xTextLabel = (XInterface)tEnv.getObjRelation("LC");
+
+ testProperty("LabelControl", new PropertyTester() {
+ protected Object getNewValue(String p, Object oldVal) {
+ if (utils.isVoid(oldVal)) return xTextLabel ;
+ else return super.getNewValue("LabelControl",oldVal);
+ }
+ }) ;
+ }
+
+ /**
+ * Forces environment recreateation.
+ */
+ public void after() {
+ disposeEnvironment() ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/form/_FormComponent.java b/qadevOOo/tests/java/ifc/form/_FormComponent.java
new file mode 100644
index 000000000000..094edfea935e
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/_FormComponent.java
@@ -0,0 +1,43 @@
+/*************************************************************************
+ *
+ * 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.form;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.form.FormComponent</code>
+* service properties :
+* <ul>
+* <li><code> Name</code></li>
+* </ul>
+* @see com.sun.star.form.FormComponent
+*/
+public class _FormComponent extends MultiPropertyTest {
+
+} // finish class _FormComponent
+
diff --git a/qadevOOo/tests/java/ifc/form/_FormControlModel.java b/qadevOOo/tests/java/ifc/form/_FormControlModel.java
new file mode 100644
index 000000000000..b33b70cfd1d5
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/_FormControlModel.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.form;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.form.FormControlModel</code>
+* service properties :
+* <ul>
+* <li><code> ClassId</code></li>
+* <li><code> TabIndex</code></li>
+* <li><code> Tag</code></li>
+* </ul>
+* @see com.sun.star.form.FormControlModel
+*/
+public class _FormControlModel extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/form/_XApproveActionBroadcaster.java b/qadevOOo/tests/java/ifc/form/_XApproveActionBroadcaster.java
new file mode 100644
index 000000000000..fc7112312b44
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/_XApproveActionBroadcaster.java
@@ -0,0 +1,110 @@
+/*************************************************************************
+ *
+ * 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.form;
+
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+import com.sun.star.form.XApproveActionBroadcaster;
+import com.sun.star.form.XApproveActionListener;
+import com.sun.star.lang.EventObject;
+
+/**
+* Testing <code>com.sun.star.form.XApproveActionBroadcaster</code>
+* interface methods:
+* <ul>
+* <li><code> addApproveActionListener() </code></li>
+* <li><code> removeApproveActionListener() </code></li>
+* </ul><p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.form.XApproveActionBroadcaster
+*/
+public class _XApproveActionBroadcaster extends MultiMethodTest {
+ public XApproveActionBroadcaster oObj = null;
+
+ /**
+ * Class we need to test methods.
+ */
+ protected class TestListener implements XApproveActionListener {
+ public boolean approve = false ;
+
+ public void init() {
+ approve = false ;
+ }
+ public void disposing(EventObject ev) {}
+ public boolean approveAction(EventObject ev) {
+ log.println("XApproveActionListener: ActionListener was called");
+ return approve ;
+ }
+
+ }
+
+ private TestListener listener = new TestListener();
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown.
+ */
+ public void _addApproveActionListener() {
+ oObj.addApproveActionListener(listener) ;
+ tRes.tested("addApproveActionListener()", true);
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addApproveActionListener() </code> : adds listener to an
+ * object </li>
+ * </ul>
+ */
+ public void _removeApproveActionListener() {
+ requiredMethod("addApproveActionListener()");
+ listener.init() ;
+ listener.approve = true ;
+ oObj.removeApproveActionListener(listener);
+ tRes.tested("removeApproveActionListener()", true);
+ }
+
+
+ /**
+ * Just log output
+ */
+ protected void after() {
+ log.println("Skipping all XApproveActionBroadcaster methods, since they"
+ + " need user interaction");
+ throw new StatusException(Status.skipped(true));
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/form/_XBoundComponent.java b/qadevOOo/tests/java/ifc/form/_XBoundComponent.java
new file mode 100644
index 000000000000..a95dd18649a5
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/_XBoundComponent.java
@@ -0,0 +1,58 @@
+/*************************************************************************
+ *
+ * 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.form;
+
+import lib.MultiMethodTest;
+
+import com.sun.star.form.XBoundComponent;
+
+/**
+* Testing <code>com.sun.star.form.XBoundComponent</code>
+* interface methods :
+* <ul>
+* <li><code> commit()</code></li>
+* </ul> <p>
+* More deep tests of this interface are made in
+* <code>com.sun.star.form.XUpdateBroadcaster</code> interface
+* test as it is the ancestor of <code>XBoundComponent</code>
+* interface.
+* @see com.sun.star.form.XBoundComponent
+*/
+public class _XBoundComponent extends MultiMethodTest {
+
+ public XBoundComponent oObj = null;
+
+ public void _commit() {
+ oObj.commit() ;
+
+ tRes.tested("commit()",true);
+ }
+
+} //EOF of XBoundComponent
+
+
diff --git a/qadevOOo/tests/java/ifc/form/_XBoundControl.java b/qadevOOo/tests/java/ifc/form/_XBoundControl.java
new file mode 100644
index 000000000000..0015c812ff3b
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/_XBoundControl.java
@@ -0,0 +1,82 @@
+/*************************************************************************
+ *
+ * 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.form;
+
+import lib.MultiMethodTest;
+
+import com.sun.star.form.XBoundControl;
+
+/**
+* Testing <code>com.sun.star.form.XBoundControl</code>
+* interface methods:
+* <ul>
+* <li><code> getLock() </code></li>
+* <li><code> setLock() </code></li>
+* </ul><p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.form.XBoundControl
+*/
+public class _XBoundControl extends MultiMethodTest {
+ public XBoundControl oObj = null;
+ public boolean defaultState = false;
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown.
+ */
+ public void _getLock() {
+ boolean res = false;
+ defaultState = oObj.getLock();
+ res = true;
+ tRes.tested("getLock()",res);
+ }
+
+ /**
+ * Test calls the method, then result is checked. <p>
+ * Has <b> OK </b> status if method locks input (set and gotten values are
+ * equal). <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getLock() </code>: determines whether the input is
+ * currently locked or not </li>
+ * </ul>
+ */
+ public void _setLock() {
+ boolean res = false;
+ boolean toSet = !defaultState;
+
+ requiredMethod("getLock()");
+ oObj.setLock(toSet);
+ res = (oObj.getLock() != defaultState);
+ oObj.setLock(defaultState);
+ tRes.tested("setLock()", res);
+ }
+
+} //EOF of XBoundControl
+
diff --git a/qadevOOo/tests/java/ifc/form/_XChangeBroadcaster.java b/qadevOOo/tests/java/ifc/form/_XChangeBroadcaster.java
new file mode 100644
index 000000000000..e4ad44e55185
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/_XChangeBroadcaster.java
@@ -0,0 +1,200 @@
+/*************************************************************************
+ *
+ * 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.form;
+
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+import com.sun.star.awt.XTextComponent;
+import com.sun.star.awt.XWindow;
+import com.sun.star.form.XChangeBroadcaster;
+import com.sun.star.form.XChangeListener;
+import com.sun.star.lang.EventObject;
+import com.sun.star.uno.UnoRuntime;
+
+/**
+* Testing <code>com.sun.star.form.XChangeBroadcaster</code>
+* interface methods:
+* <ul>
+* <li><code> addChangeListener() </code></li>
+* <li><code> removeChangeListener() </code></li>
+* </ul><p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'Win1'</code> (of type <code>XWindow</code>):
+* used to change context when testing interface methods</li>
+* <li> <code>'Win2'</code> (of type <code>XWindow</code>):
+* used to change context when testing interface methods </li>
+* <li> <code>'CONTROL'</code> (of type <code>XControl</code> and
+* must implement <code>XTextComponent</code> interface):
+* used to change context when testing interface methods </li>
+* <li> <code>'XChangeBroadcaster.Changer'</code>
+* (of type <code>ifc.form._XChangeBroadcaster.Changer</code>)
+* <b>optional</b> : this relation <b>must be specified</b> when
+* <code>XTextComponent</code> is not supported by the tested
+* component. It is used to change some component content
+* which must cause listener call. </li>
+* </ul> <p>
+*
+* <b>Prerequisites:</b> component must implement <code>XTextComponent</code>
+* interface for changing component's text which must cause listener call.
+* If the component cann't support the interface, then the relation
+* <code>'XChangeBroadcaster.Changer'</code> must be passed. <p>
+*
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.form.XChangeBroadcaster
+*/
+public class _XChangeBroadcaster extends MultiMethodTest {
+ public static XChangeBroadcaster oObj = null;
+ protected boolean changed = false;
+
+ /**
+ * This interface must be implemented by component and passed
+ * in relation if it doesn't support <code>XTextComponent</code>
+ * interface. It used to change the content of component.
+ */
+ public static interface Changer {
+ /**
+ * The method must change the component's content to
+ * cause a listener call.
+ */
+ public void change() ;
+ }
+
+ /**
+ * Class we need to test methods
+ */
+ protected class MyChangeListener implements XChangeListener {
+ public void disposing ( EventObject oEvent ) {}
+ public void changed ( EventObject oEvent ) {
+ System.out.println("Listener called");
+ changed = true;
+ }
+ }
+
+ protected XChangeListener listener = new MyChangeListener();
+ protected XTextComponent xText = null ;
+ protected Changer changer = null ;
+
+ /**
+ * Tries to query the tested component for <code>XTextComponent</code>
+ * interface and retrieves a relation
+ * <code>'XChangeBroadcaster.Changer'</code>.
+ * @throw StatusException If neither relation is found nor interface
+ * is queried.
+ */
+ public void before() {
+ xText = (XTextComponent)
+ UnoRuntime.queryInterface(XTextComponent.class,oObj);
+ changer = (Changer) tEnv.getObjRelation("XChangeBroadcaster.Changer") ;
+
+ if (xText == null && changer == null)
+ throw new StatusException(Status.failed
+ ("Neither 'XChangeBroadcaster.Changer' relation found " +
+ "nor XTextComponent is supported")) ;
+ }
+
+ /**
+ * Test calls the method, then object relations 'Win1', 'Win2', 'CONTROL'
+ * are obtained, and context is changed.<p>
+ * Has <b> OK </b> status if listener was called after context has changed.
+ */
+ public void _addChangeListener() {
+ log.println("Testing addChangeListener ...");
+ oObj.addChangeListener( listener );
+ XWindow win1 = (XWindow) tEnv.getObjRelation("Win1");
+ XWindow win2 = (XWindow) tEnv.getObjRelation("Win2");
+ win1.setFocus();
+
+ changeContent() ;
+ shortWait();
+
+ win2.setFocus();
+ XTextComponent TC = (XTextComponent)UnoRuntime.queryInterface
+ (XTextComponent.class,tEnv.getObjRelation("CONTROL"));
+ TC.setText("NOXChangeBroadcaster");
+ shortWait();
+ tRes.tested("addChangeListener()", changed);
+ }
+
+ /**
+ * Test calls the method, then object relations 'Win1', 'Win2', 'CONTROL'
+ * are obtained, and context is changed.<p>
+ * Has <b> OK </b> status if listener was not called after context has
+ * changed.<p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addChangeListener() </code> : adds the specified listener
+ * to receive the "changed" event</li>
+ * </ul>
+ */
+ public void _removeChangeListener() {
+ requiredMethod("addChangeListener()");
+ changed = false;
+ log.println("Testing removeChangeListener ...");
+ oObj.addChangeListener( listener );
+ XWindow win2 = (XWindow) tEnv.getObjRelation("Win2");
+ win2.setFocus();
+
+ changeContent() ;
+
+ win2.setFocus();
+ shortWait();
+ tRes.tested("removeChangeListener()", !changed);
+ }
+
+ /**
+ * Sleeps for 0.2 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(2000) ;
+ } catch (InterruptedException e) {
+ log.println("While waiting :" + e) ;
+ }
+ }
+
+ /**
+ * Changes the content of the component depending on whether
+ * <code>XTextComponent</code> is supported or not. If yes
+ * then the text is chahged, if not the relation <code>change()</code>
+ * method is used.
+ */
+ protected void changeContent() {
+ if (xText != null) {
+ xText.setText("XChangeBroadcaster".equals(xText.getText()) ?
+ "NoXChangeBroadcaster" : "XChangeBroadcaster") ;
+ } else {
+ changer.change();
+ }
+ }
+
+} // finished class _XChangeBroadcaster
+
diff --git a/qadevOOo/tests/java/ifc/form/_XConfirmDeleteBroadcaster.java b/qadevOOo/tests/java/ifc/form/_XConfirmDeleteBroadcaster.java
new file mode 100644
index 000000000000..89359e331157
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/_XConfirmDeleteBroadcaster.java
@@ -0,0 +1,75 @@
+/*************************************************************************
+ *
+ * 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.form;
+
+import com.sun.star.form.XConfirmDeleteBroadcaster;
+import com.sun.star.form.XConfirmDeleteListener;
+import com.sun.star.lang.EventObject;
+import com.sun.star.sdb.RowChangeEvent;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.util.XConfirmDeleteBroadcaster</code>
+* interface methods :
+* <ul>
+* <li><code>addConfirmDeleteListener()</code></li>
+* <li><code>removeConfirmDeleteListener()</code></li>
+* </ul> <p>
+*
+* Result checking is not performed. Confirm delete
+* listeners are called only in case of
+* interaction with UI. <p>
+*
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.util.XConfirmDeleteBroadcaster
+*/
+public class _XConfirmDeleteBroadcaster extends MultiMethodTest {
+ public XConfirmDeleteBroadcaster oObj = null;
+ protected boolean confirmed = false;
+ protected XConfirmDeleteListener mxConfirmDeleteListener =
+ new ConfirmDeleteImpl();
+
+ private class ConfirmDeleteImpl implements XConfirmDeleteListener {
+ public boolean confirmDelete(RowChangeEvent rowChangeEvent) {
+ confirmed = true;
+ return true;
+ }
+ public void disposing(EventObject eventObject) {
+ }
+ }
+
+ protected void addConfirmDeleteListener() {
+ oObj.addConfirmDeleteListener(mxConfirmDeleteListener);
+ tRes.tested("addConfirmDeleteListener()", true);
+ }
+
+ protected void removeConfirmDeleteListener() {
+ oObj.removeConfirmDeleteListener(mxConfirmDeleteListener);
+ tRes.tested("removeConfirmDeleteListener()", true);
+ }
+}
diff --git a/qadevOOo/tests/java/ifc/form/_XDatabaseParameterBroadcaster.java b/qadevOOo/tests/java/ifc/form/_XDatabaseParameterBroadcaster.java
new file mode 100755
index 000000000000..c7c9e69bea38
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/_XDatabaseParameterBroadcaster.java
@@ -0,0 +1,100 @@
+/*************************************************************************
+ *
+ * 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.form;
+
+import com.sun.star.form.XDatabaseParameterBroadcaster;
+import com.sun.star.form.XDatabaseParameterListener;
+import com.sun.star.sdbc.XRowSet;
+import com.sun.star.uno.UnoRuntime;
+import java.io.PrintWriter;
+import lib.MultiMethodTest;
+
+/**
+ *
+ */
+public class _XDatabaseParameterBroadcaster extends MultiMethodTest {
+
+ // oObj filled by MultiMethodTest
+ public XDatabaseParameterBroadcaster oObj = null ;
+ private CheckParameterListener listenerChecker = null;
+
+ /**
+ * Interface to implement so the call of the listener can be checked.
+ */
+ public static interface CheckParameterListener extends XDatabaseParameterListener {
+ /**
+ * 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 checkListener();
+ }
+
+ /**
+ * Get the object relation 'ParameterListenerChecker' and
+ * set the log inside of the implementation.
+ */
+ protected void before() {
+ listenerChecker = (CheckParameterListener)
+ tEnv.getObjRelation("ParameterListenerChecker");
+ listenerChecker.setLog((PrintWriter)log);
+ }
+
+ /**
+ */
+ public void _addParameterListener() {
+ oObj.addParameterListener(listenerChecker);
+ tRes.tested("addParameterListener()", true);
+ }
+
+ /**
+ */
+ public void _removeParameterListener() {
+ requiredMethod("addParameterListener()");
+
+ // trigger the action.
+ try {
+ XRowSet xRowSet = (XRowSet)UnoRuntime.queryInterface(XRowSet.class, oObj);
+ xRowSet.execute();
+ }
+ catch(com.sun.star.sdbc.SQLException e) {
+ log.println("Exception in XDatabaseParameterBroadcaster test.");
+ log.println("This does not let the test fail, but should be inquired.");
+ e.printStackTrace((PrintWriter)log);
+ }
+ // was the listener called?
+ oObj.removeParameterListener(listenerChecker);
+ tRes.tested("removeParameterListener()", listenerChecker.checkListener());
+ }
+
+ protected void after() {
+ disposeEnvironment();
+ }
+}
diff --git a/qadevOOo/tests/java/ifc/form/_XFormController.java b/qadevOOo/tests/java/ifc/form/_XFormController.java
new file mode 100644
index 000000000000..1fa0c93f868b
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/_XFormController.java
@@ -0,0 +1,173 @@
+/*************************************************************************
+ *
+ * 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.form;
+
+import lib.MultiMethodTest;
+
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XWindow;
+import com.sun.star.form.XFormController;
+import com.sun.star.form.XFormControllerListener;
+import com.sun.star.lang.EventObject;
+import com.sun.star.uno.UnoRuntime;
+
+/**
+* Testing <code>com.sun.star.form.XFormController</code>
+* interface methods :
+* <ul>
+* <li><code> getCurrentControl()</code></li>
+* <li><code> addActivateListener()</code></li>
+* <li><code> removeActivateListener()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'otherWindow'</code>
+* (of type <code>com.sun.star.awt.XWindow</code>):
+* The another window is used to activate it, causing deactivating
+* of the component tested. </li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.form.XFormController
+*/
+public class _XFormController extends MultiMethodTest {
+
+ public static XFormController oObj = null;
+ XWindow otherWind = null;
+
+ /**
+ * Listener which determines and stores events occured.
+ */
+ protected class MyListener implements XFormControllerListener {
+ public boolean activated = false ;
+ public boolean deactivated = false ;
+ public void disposing ( EventObject oEvent ) {}
+
+ public void init() {
+ activated = false;
+ deactivated = false;
+ }
+
+ public void formActivated(EventObject ev) {
+ activated = true ;
+ }
+
+ public void formDeactivated(EventObject ev) {
+ deactivated = true ;
+ }
+ }
+
+ MyListener listener = new MyListener() ;
+
+ /**
+ * Adds a listener, then switches focus between two windows.
+ * The current controller must be deactivated and activated.<p>
+ *
+ * Has <b> OK </b> status if listener <code>deactivate</code>
+ * and <code>activate</code> methods was called. <p>
+ */
+ public void _addActivateListener() {
+ requiredMethod("getCurrentControl()");
+ oObj.addActivateListener(listener) ;
+
+ XWindow wind = (XWindow)UnoRuntime.queryInterface(XWindow.class, cntrl);
+ wind.setFocus();
+ shortWait();
+ XWindow otherWind = (XWindow)tEnv.getObjRelation("otherWindow");
+ otherWind.setFocus();
+ shortWait();
+ log.println("activated = " + listener.activated +
+ ", deactivated = " + listener.deactivated) ;
+
+ tRes.tested("addActivateListener()",
+ listener.deactivated && listener.activated) ;
+ }
+
+ /**
+ * Removes the litener added before, then switches focus between two windows.
+ *
+ * Has <b> OK </b> status if no listener methods were called. <p>
+ */
+ public void _removeActivateListener() {
+ requiredMethod("addActivateListener()") ;
+
+ oObj.removeActivateListener(listener);
+ log.println("ActiveListener removed");
+ listener.init();
+
+ XWindow wind = (XWindow)UnoRuntime.queryInterface(XWindow.class, cntrl);
+ wind.setFocus();
+ shortWait();
+ XWindow otherWind = (XWindow)tEnv.getObjRelation("otherWindow");
+ otherWind.setFocus();
+ shortWait();
+ log.println("activated = " + listener.activated +
+ ", deactivated = " + listener.deactivated) ;
+
+ tRes.tested("removeActivateListener()",
+ !listener.activated && !listener.deactivated);
+ }
+
+ XControl cntrl;
+
+ /**
+ * Retrieves current control and searches for it among child controls.
+ *
+ * Has <b>OK</b> status if the current control was found among component
+ * children.
+ */
+ public void _getCurrentControl() {
+ cntrl = oObj.getCurrentControl();
+ XControl[] children = oObj.getControls() ;
+
+ boolean res = false;
+ for(int i = 0; i < children.length; i++) {
+ if (children[i].equals(cntrl)) {
+ log.println("Current control is equal to the object control" +
+ " #" + i + ":");
+ log.println(cntrl);
+ res = true;
+ break;
+ }
+ }
+
+ tRes.tested("getCurrentControl()", res) ;
+ }
+
+ /**
+ * Sleeps for 0.2 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(1000) ;
+ } catch (InterruptedException e) {
+ System.out.println("While waiting :" + e) ;
+ }
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/form/_XFormsSupplier.java b/qadevOOo/tests/java/ifc/form/_XFormsSupplier.java
new file mode 100644
index 000000000000..1a8083413d6e
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/_XFormsSupplier.java
@@ -0,0 +1,44 @@
+/*************************************************************************
+ *
+ * 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.form;
+
+import com.sun.star.container.XNameContainer;
+
+public class _XFormsSupplier extends lib.MultiMethodTest {
+
+ public com.sun.star.form.XFormsSupplier oObj = null;
+
+ public void _getForms() {
+ XNameContainer forms = oObj.getForms();
+ if (!forms.hasElements()) {
+ log.println("NameContainer doesn't contain forms");
+ }
+ tRes.tested("getForms()",forms.hasElements());
+ }
+
+}
diff --git a/qadevOOo/tests/java/ifc/form/_XGrid.java b/qadevOOo/tests/java/ifc/form/_XGrid.java
new file mode 100644
index 000000000000..92b7332ef74a
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/_XGrid.java
@@ -0,0 +1,83 @@
+/*************************************************************************
+ *
+ * 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.form;
+
+import lib.MultiMethodTest;
+
+import com.sun.star.form.XGrid;
+
+/**
+* Testing <code>com.sun.star.form.XGrid</code>
+* interface methods :
+* <ul>
+* <li><code> getCurrentColumnPosition()</code></li>
+* <li><code> setCurrentColumnPosition(short nPos)</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.form.XGrid
+*/
+public class _XGrid extends MultiMethodTest {
+ public XGrid oObj = null;
+ public short positionValue;
+
+ /**
+ * The method called. Then CurrentColumnPosition is obtained and
+ * compared with previously changed value.
+ * Has <b> OK </b> status if the method successfully returns
+ * and the returned value is correct.
+ */
+ public void _getCurrentColumnPosition() {
+ boolean result;
+
+ requiredMethod("setCurrentColumnPosition()");
+ log.println("Testing getCurrentColumnPosition()...");
+ if (oObj.getCurrentColumnPosition() == positionValue) {
+ result = true;
+ } else {
+ result = false;
+ }
+ tRes.tested("getCurrentColumnPosition()", result);
+ }
+
+ /**
+ * The method called. Then CurrentColumnPosition is obtained, changed
+ * and saved.
+ * Has <b> OK </b> status if no exceptions was occured.
+ */
+ public void _setCurrentColumnPosition() {
+ log.println("Testing setCurrentColumnPosition()...");
+ if (oObj.getCurrentColumnPosition() != 0) {
+ positionValue = 0;
+ } else {
+ positionValue = 1;
+ }
+ oObj.setCurrentColumnPosition(positionValue);
+ tRes.tested("setCurrentColumnPosition()", true);
+ }
+
+}
diff --git a/qadevOOo/tests/java/ifc/form/_XGridColumnFactory.java b/qadevOOo/tests/java/ifc/form/_XGridColumnFactory.java
new file mode 100644
index 000000000000..4128b26847d2
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/_XGridColumnFactory.java
@@ -0,0 +1,80 @@
+/*************************************************************************
+ *
+ * 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.form;
+
+import lib.MultiMethodTest;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.form.XGridColumnFactory;
+
+
+/**
+* Testing <code>com.sun.star.form.XGridColumnFactory</code>
+* interface methods :
+* <ul>
+* <li><code> createColumn()</code></li>
+* <li><code> getColumnTypes()</code></li>
+* </ul>
+* Test is multithread compilant. <p>
+* @see com.sun.star.form.XGridColumnFactory
+*/
+public class _XGridColumnFactory extends MultiMethodTest {
+
+ public XGridColumnFactory oObj = null;
+
+
+ /**
+ * Test calls the method and checks return value. <p>
+ * Has <b> OK </b> status if the method returns
+ * non null value.
+ */
+ public void _getColumnTypes() {
+
+ String[] types = oObj.getColumnTypes();
+ tRes.tested("getColumnTypes()",types!=null);
+ }
+
+ /**
+ * Creates column of type 'TextField'. <p>
+ * Has <b>OK</b> status if non null value returned.
+ */
+ public void _createColumn() {
+
+ try {
+ XPropertySet column = oObj.createColumn("TextField");
+ tRes.tested("createColumn()",column!=null);
+ }
+ catch (com.sun.star.lang.IllegalArgumentException ex) {
+ log.println("Exception occured while creating Column");
+ tRes.tested("createColumn()",false);
+ }
+ }
+} // finish class _XGridColumnFactory
+
+
+
diff --git a/qadevOOo/tests/java/ifc/form/_XGridFieldDataSupplier.java b/qadevOOo/tests/java/ifc/form/_XGridFieldDataSupplier.java
new file mode 100644
index 000000000000..c3968a7e21ab
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/_XGridFieldDataSupplier.java
@@ -0,0 +1,68 @@
+/*************************************************************************
+ *
+ * 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.form;
+
+import lib.MultiMethodTest;
+
+import com.sun.star.form.XGridFieldDataSupplier;
+import com.sun.star.uno.Type;
+
+/**
+* Testing <code>com.sun.star.form.XGridFieldDataSupplier</code>
+* interface methods :
+* <ul>
+* <li><code>queryFieldDataType()</code></li>
+* <li><code>queryFieldData()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.form.XGridFieldDataSupplier
+*/
+public class _XGridFieldDataSupplier extends MultiMethodTest {
+ public XGridFieldDataSupplier oObj = null;
+
+ /**
+ * Calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if no runtime exceptions occured
+ * and returned value is not null.
+ */
+ public void _queryFieldDataType() {
+ boolean[] dataType = oObj.queryFieldDataType(new Type(String.class));
+ tRes.tested("queryFieldDataType()", dataType != null);
+ }
+
+ /**
+ * Calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if no runtime exceptions occured
+ * and returned value is not null.
+ */
+ public void _queryFieldData() {
+ Object[] data = oObj.queryFieldData(0, new Type(String.class));
+ tRes.tested("queryFieldData()", data != null);
+ }
+}// finish class _XGridFieldDataSupplier
+
diff --git a/qadevOOo/tests/java/ifc/form/_XImageProducerSupplier.java b/qadevOOo/tests/java/ifc/form/_XImageProducerSupplier.java
new file mode 100644
index 000000000000..63495f353872
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/_XImageProducerSupplier.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.form;
+
+import lib.MultiMethodTest;
+
+import com.sun.star.awt.XImageProducer;
+import com.sun.star.form.XImageProducerSupplier;
+
+/**
+* Testing <code>com.sun.star.form.XImageProducerSupplier</code>
+* interface methods :
+* <ul>
+* <li><code> getImageProducer()</code></li>
+* </ul>
+* @see com.sun.star.form.XImageProducerSupplier
+*/
+public class _XImageProducerSupplier extends MultiMethodTest {
+
+ public XImageProducerSupplier oObj = null;
+
+ /**
+ * Test calls the method and checks return value and that
+ * no exceptions were thrown. <p>
+ * Has <b> OK </b> status if the method returns non null value
+ * and no exceptions were thrown. <p>
+ */
+ public void _getImageProducer() {
+ boolean bResult = false;
+ XImageProducer ip = oObj.getImageProducer();
+ bResult = ip!=null;
+ tRes.tested("getImageProducer()", bResult);
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/form/_XLoadListener.java b/qadevOOo/tests/java/ifc/form/_XLoadListener.java
new file mode 100644
index 000000000000..fffc9c1178db
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/_XLoadListener.java
@@ -0,0 +1,94 @@
+/*************************************************************************
+ *
+ * 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.form;
+
+import lib.MultiMethodTest;
+
+import com.sun.star.form.XLoadListener;
+
+/**
+* Testing <code>com.sun.star.form.XLoadListener</code>
+* interface methods :
+* <ul>
+* <li><code> loaded()</code></li>
+* <li><code> unloading()</code></li>
+* <li><code> unloaded()</code></li>
+* <li><code> reloading()</code></li>
+* <li><code> reloaded()</code></li>
+* </ul> <p>
+* This interface methods are not testable, because their
+* behaviour is not documented.
+* @see com.sun.star.form.XLoadListener
+*/
+public class _XLoadListener extends MultiMethodTest {
+
+ public XLoadListener oObj = null;
+
+ /**
+ * Always has <b>OK</b> status.
+ */
+ public void _loaded() {
+ log.println("nothing to test here");
+ tRes.tested("loaded()",true);
+ }
+
+ /**
+ * Always has <b>OK</b> status.
+ */
+ public void _reloaded() {
+ log.println("nothing to test here");
+ tRes.tested("reloaded()",true);
+ }
+
+ /**
+ * Always has <b>OK</b> status.
+ */
+ public void _reloading() {
+ log.println("nothing to test here");
+ tRes.tested("reloading()",true);
+ }
+
+ /**
+ * Always has <b>OK</b> status.
+ */
+ public void _unloaded() {
+ log.println("nothing to test here");
+ tRes.tested("unloaded()",true);
+ }
+
+ /**
+ * Always has <b>OK</b> status.
+ */
+ public void _unloading() {
+ log.println("nothing to test here");
+ tRes.tested("unloading()",true);
+ }
+
+} //EOF of XLoadListener
+
+
diff --git a/qadevOOo/tests/java/ifc/form/_XLoadable.java b/qadevOOo/tests/java/ifc/form/_XLoadable.java
new file mode 100644
index 000000000000..347a3b7dc870
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/_XLoadable.java
@@ -0,0 +1,247 @@
+/*************************************************************************
+ *
+ * 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.form;
+
+
+import lib.MultiMethodTest;
+
+import com.sun.star.form.XLoadable;
+
+/**
+* Testing <code>com.sun.star.form.XLoadable</code>
+* interface methods :
+* <ul>
+* <li><code> load()</code></li>
+* <li><code> unload()</code></li>
+* <li><code> reload()</code></li>
+* <li><code> isLoaded()</code></li>
+* <li><code> addLoadListener()</code></li>
+* <li><code> removeLoadListener()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.form.XLoadable
+*/
+public class _XLoadable extends MultiMethodTest {
+
+ public XLoadable oObj = null;
+
+ /**
+ * Listener implementation which sets flags on appropriate method calls
+ */
+ protected class TestLoadListener implements com.sun.star.form.XLoadListener {
+ public boolean disposingCalled = false ;
+ public boolean loadedCalled = false ;
+ public boolean reloadedCalled = false ;
+ public boolean reloadingCalled = false ;
+ public boolean unloadedCalled = false ;
+ public boolean unloadingCalled = false ;
+ private java.io.PrintWriter log = null ;
+
+ public TestLoadListener(java.io.PrintWriter log) {
+ this.log = log ;
+ }
+
+ public void disposing(com.sun.star.lang.EventObject e) {
+ disposingCalled = true ;
+ log.println(" disposing was called.") ;
+ }
+
+ public void loaded(com.sun.star.lang.EventObject e) {
+ loadedCalled = true ;
+ log.println(" loaded was called.") ;
+ }
+
+ public void reloaded(com.sun.star.lang.EventObject e) {
+ reloadedCalled = true ;
+ log.println(" reloaded was called.") ;
+ }
+
+ public void reloading(com.sun.star.lang.EventObject e) {
+ reloadingCalled = true ;
+ log.println(" reloading was called.") ;
+ }
+
+ public void unloaded(com.sun.star.lang.EventObject e) {
+ unloadedCalled = true ;
+ log.println(" unloaded was called.") ;
+ }
+
+ public void unloading(com.sun.star.lang.EventObject e) {
+ unloadingCalled = true ;
+ log.println(" unloading was called.") ;
+ }
+ }
+
+ TestLoadListener loadListener = null ;
+
+ /**
+ * Creates new listener.
+ */
+ public void before() {
+ loadListener = new TestLoadListener(log) ;
+ }
+
+ /**
+ * Waits for 0.1 second. Used to get time for load completion.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(100);
+ } catch (InterruptedException e) {}
+ }
+
+ /**
+ * Loads the form. <p>
+ * Has <b> OK </b> status if <code>isLoaded()</code> returns
+ * <code>true</code> and listener method <code>loaded()</code>
+ * is called.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> isLoaded() </code> : to be sure form is not loaded </li>
+ * <li> <code> addLoadListener() </code> : to check if this listener method
+ * is called. </li>
+ * </ul>
+ */
+ public void _load() {
+ requiredMethod("isLoaded()") ;
+ requiredMethod("addLoadListener()") ;
+
+ boolean result = true ;
+ oObj.load() ;
+
+ shortWait() ;
+ result = oObj.isLoaded() && loadListener.loadedCalled ;
+
+ tRes.tested("load()", result) ;
+ }
+
+ /**
+ * Unloads the form. <p>
+ * Has <b> OK </b> status if <code>isLoaded()</code> returns
+ * <code>false</code> and listener method <code>unloaded()</code>
+ * is called.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> reload() </code> : to be sure the form is loaded </li>
+ * <li> <code> addLoadListener() </code> : to check if this listener method
+ * is called. </li>
+ * </ul>
+ */
+ public void _unload() {
+ requiredMethod("reload()") ;
+ requiredMethod("addLoadListener()") ;
+
+ boolean result = true ;
+ oObj.unload() ;
+
+ shortWait() ;
+ result = !oObj.isLoaded() && loadListener.unloadedCalled ;
+
+ tRes.tested("unload()", result) ;
+ }
+
+ /**
+ * Reloads the form. <p>
+ * Has <b> OK </b> status if <code>isLoaded()</code> returns
+ * <code>true</code> and listener method <code>reloaded()</code>
+ * is called.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> load() </code> : to be sure form is loaded </li>
+ * <li> <code> addLoadListener() </code> : to check if this listener method
+ * is called. </li>
+ * </ul>
+ */
+ public void _reload() {
+ requiredMethod("load()") ;
+ requiredMethod("addLoadListener()") ;
+
+ boolean result = true ;
+ oObj.reload() ;
+
+ shortWait() ;
+ result = oObj.isLoaded() && loadListener.reloadedCalled;
+
+ tRes.tested("reload()", result) ;
+ }
+
+ /**
+ * Checks if the component is already loaded. If yes it unloads
+ * it <p>
+ * Has <b> OK </b> status if finally <code>isLoaded()</code> method
+ * returns <code>false</code>.
+ */
+ public void _isLoaded() {
+
+ boolean isLoaded = oObj.isLoaded() ;
+ if (isLoaded) oObj.unload();
+ isLoaded = oObj.isLoaded() ;
+
+ tRes.tested("isLoaded()", !isLoaded) ;
+ }
+
+ /**
+ * Adds a listener. If its methods are called or not is checked
+ * in other object methods. <p>
+ * Has <b> OK </b> status if no runtime exceptions occured.
+ */
+ public void _addLoadListener() {
+
+ boolean result = true ;
+ oObj.addLoadListener(loadListener) ;
+
+ tRes.tested("addLoadListener()", result) ;
+ }
+
+ /**
+ * Removes the listener added before. <p>
+ * Has <b> OK </b> status if after <code>load()</code> call no
+ * listener methods were called. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> unload() </code> : to make this test run finally.</li>
+ * </ul>
+ */
+ public void _removeLoadListener() {
+ requiredMethod("unload()") ;
+
+ boolean result = true ;
+ oObj.removeLoadListener(loadListener) ;
+ loadListener.loadedCalled = false ;
+ oObj.load();
+
+ result = ! loadListener.loadedCalled ;
+
+ tRes.tested("removeLoadListener()", result) ;
+ }
+
+ protected void after() {
+ disposeEnvironment();
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/form/_XReset.java b/qadevOOo/tests/java/ifc/form/_XReset.java
new file mode 100644
index 000000000000..324df29e9976
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/_XReset.java
@@ -0,0 +1,194 @@
+/*************************************************************************
+ *
+ * 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.form;
+
+import lib.MultiMethodTest;
+
+import com.sun.star.form.XReset;
+import com.sun.star.form.XResetListener;
+import com.sun.star.lang.EventObject;
+
+/**
+* Testing <code>com.sun.star.form.XReset</code>
+* interface methods :
+* <ul>
+* <li><code> reset()</code></li>
+* <li><code> addResetListener()</code></li>
+* <li><code> removeResetListener()</code></li>
+* </ul>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.form.XReset
+*/
+public class _XReset extends MultiMethodTest {
+
+ public static XReset oObj = null;
+
+ /**
+ * Indicates if listeners must approve restes requests or not.
+ */
+ protected boolean approve = true;
+ /**
+ * Array of two elements, each of them indicates <code>resetted</code>
+ * call of appropriate listener.
+ */
+ protected boolean resetted[] = new boolean[2];
+ /**
+ * Array of two elements, each of them indicates
+ * <code>approveReset</code> call of appropriate listener.
+ */
+ protected boolean approveReset[] = new boolean[2];
+
+ /**
+ * The listener which sets flags (in array elements with index 0)
+ * on <code>resetted</code> and
+ * <code>approveReset</code> events. It approves reset request
+ * depending on <code>approve</code> field.
+ */
+ protected class MyResetListener implements XResetListener {
+ public void disposing ( EventObject oEvent ) {}
+ public boolean approveReset ( EventObject oEvent ) {
+ approveReset[0] = true;
+ //cancel the reset action
+ return approve;
+ }
+ public void resetted ( EventObject oEvent ) {
+ resetted[0] = true;
+ }
+ }
+
+
+ /**
+ * The listener which sets flags (in array elements with index 1)
+ * on <code>resetted</code> and
+ * <code>approveReset</code> events. It approves reset request
+ * depending on <code>approve</code> field.
+ */
+ protected class MyResetListener2 implements XResetListener {
+ public void disposing ( EventObject oEvent ) {}
+ public boolean approveReset ( EventObject oEvent ) {
+ approveReset[1] = true;
+ //don't cancel the reset action
+ return true;
+ }
+ public void resetted ( EventObject oEvent ) {
+ resetted[1] = true;
+ }
+ }
+
+ /**
+ * Listener which is added in test
+ */
+ protected XResetListener listener1 = new MyResetListener();
+ /**
+ * Listener which is added in test
+ */
+ protected XResetListener listener2 = new MyResetListener2();
+
+ /**
+ * Just adds two reset listeners. <p>
+ * Status for it is set later in <code>reset</code> method test.
+ */
+ public void _addResetListener() {
+
+ log.println("Testing addResetListener ...");
+ oObj.addResetListener( listener2 );
+ oObj.addResetListener( listener1 );
+
+ } // finished _addResetListener()
+
+ /**
+ * First calls <code>reset</code> method without approving
+ * the request, in this case only <code>approveReset</code>
+ * event must be called. Second calls <code>reset</code> with
+ * approving the request. In this case both listener's events
+ * must be called. <p>
+ * Has <b>OK</b> status for <code>reset</code> method if in
+ * the first case only <code>approveReset</code> method was
+ * called. <p>
+ * Has <b>OK</b> status for <code>addResetListener</code> method
+ * if in the second case both listener's methods were called.<p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addResetListener </code> : to have listeners added.</li>
+ * </ul>
+ */
+ public void _reset() {
+
+ executeMethod("addResetListener()");
+ log.println("Testing reset() ...");
+ approve = false;
+ oObj.reset();
+ shortWait();
+ tRes.tested("reset()", (approveReset[0] && (! resetted[0])));
+ approve = true;
+ oObj.reset();
+ shortWait();
+ tRes.tested("addResetListener()", (approveReset[1] && resetted[1]));
+
+ } // finished _reset
+
+ /**
+ * Removes the first listener, clears it's call flags, and
+ * calls <code>reset</code> method.<p>
+ * Has <b> OK </b> status if no methods of the listener removed
+ * were called. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> reset </code> : to test this method last. </li>
+ * </ul>
+ */
+ public void _removeResetListener() {
+ requiredMethod("reset()");
+ log.println("Testing removeResetListener ...");
+ approveReset[0] = resetted[0] = false;
+ oObj.removeResetListener(listener1);
+ oObj.reset();
+ shortWait();
+ tRes.tested("removeResetListener()", !approveReset[0] && !resetted[0]);
+ //removing the second listener here may avoid crashing the office
+
+ return;
+
+ } // finished _removeResetListener()
+
+ /**
+ * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(500) ;
+ } catch (InterruptedException e) {
+ log.println("While waiting :" + e) ;
+ }
+ }
+
+
+} // finished class _XRefresh
+
+
diff --git a/qadevOOo/tests/java/ifc/form/_XSubmit.java b/qadevOOo/tests/java/ifc/form/_XSubmit.java
new file mode 100644
index 000000000000..0a7fd40f6e0c
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/_XSubmit.java
@@ -0,0 +1,191 @@
+/*************************************************************************
+ *
+ * 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.form;
+
+import lib.MultiMethodTest;
+
+import com.sun.star.awt.MouseEvent;
+import com.sun.star.awt.XControl;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.form.XSubmit;
+import com.sun.star.form.XSubmitListener;
+import com.sun.star.lang.EventObject;
+import com.sun.star.uno.UnoRuntime;
+
+/**
+* Testing <code>com.sun.star.form.XSubmit</code>
+* interface methods :
+* <ul>
+* <li><code> submit()</code></li>
+* <li><code> addSubmitListener()</code></li>
+* <li><code> removeSubmitListener()</code></li>
+* </ul> <p>
+*
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'XSubmit.Control'</code> <b>optional</b>
+* (of type <code>com.sun.star.awt.XControl</code>):
+* is used to pass as parameters to <code>submit</code>
+* method. <code>null</code> is passed if the relation
+* is not found.</li>
+* <ul> <p>
+*
+* Other <b> prerequicity </b> is the object must have
+* <code>TargetURL</code> property. <p>
+*
+* Short description : test adds two listeners, call
+* <code> submit </code> method and cecks if both listeners
+* were called. Then one listener is removed and after
+* <code> submit </code> method call it must not be called. <p>
+*
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.form.XSubmit
+*/
+public class _XSubmit extends MultiMethodTest {
+
+ public static XSubmit oObj = null;
+
+ public class MySubmitListener implements XSubmitListener {
+ public int called = 0 ;
+ public void disposing ( EventObject oEvent ) {
+ }
+ public boolean approveSubmit( EventObject oEvent ) {
+ called += 1;
+ System.out.println("Listener called");
+ return true;
+ }
+ }
+
+
+ MySubmitListener listener1 = new MySubmitListener();
+ MySubmitListener listener2 = new MySubmitListener();
+
+ /**
+ * Just adds two submit listeners. <p>
+ * Status of this method test is defined in <code>
+ * submit </code> method test.
+ */
+ public void _addSubmitListener() {
+ log.println("Testing addSubmitListener ...");
+ oObj.addSubmitListener( listener1 );
+ oObj.addSubmitListener( listener2 );
+ }
+
+ /**
+ * Before submision tries to set 'TargetURL' property
+ * of component to some value assuming that component
+ * supports <code>com.sun.star.form.HTMLForm</code>
+ * service.
+ * Then calls the <code> submit </code> method and checks
+ * if listener removed were not called, and other was
+ * called only once.<p>
+ *
+ * Has <b> OK </b> status for <code>submit</code> if
+ * listener was called at least ones, for
+ * <code>addSubmitListener</code> method if the remaining
+ * listener was called only once, for
+ * <code>removeSubmitListener</code> method if the removed
+ * listener was not called. <p>
+ *
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> removeSubmitListener </code> : to have one listener
+ * added and other removed.</li>
+ * </ul>
+ */
+ public void _submit() {
+ executeMethod("removeSubmitListener()");
+ log.println("Testing submit() ...");
+ XControl cntrl = (XControl) tEnv.getObjRelation("XSubmit.Control") ;
+
+ XPropertySet xPS = (XPropertySet) UnoRuntime.queryInterface
+ (XPropertySet.class, oObj) ;
+
+ if (xPS != null) {
+ try {
+ xPS.setPropertyValue("TargetURL", "someserver");
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ e.printStackTrace(log);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace(log);
+ }
+ } else {
+ log.println("!!! The tested compoennt doesn't support XPropertySet ");
+ }
+
+ oObj.submit(cntrl, new MouseEvent());
+ shortWait();
+
+ log.println("Listener1 called " + listener1.called + " times");
+ log.println("Listener2 called " + listener2.called + " times");
+
+ tRes.tested("addSubmitListener()", listener2.called == 1);
+ tRes.tested("removeSubmitListener()", listener1.called == 0);
+ tRes.tested("submit()", listener2.called > 0);
+ oObj.removeSubmitListener(listener2);
+ }
+
+ /**
+ * Just removes one of submit listeners. <p>
+ * Status of this method test is defined in <code>
+ * submit </code> method test.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> removeSubmitListener </code> : to have listeners added</li>
+ * </ul>
+ */
+ public void _removeSubmitListener() {
+ requiredMethod("addSubmitListener()");
+ oObj.removeSubmitListener(listener1);
+ }
+
+ /**
+ * Sleeps for 0.2 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(200) ;
+ } catch (InterruptedException e) {
+ log.println("While waiting :" + e) ;
+ }
+ }
+
+ /**
+ * Forces environment recreation.
+ */
+ protected void after() {
+ disposeEnvironment();
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/form/_XUpdateBroadcaster.java b/qadevOOo/tests/java/ifc/form/_XUpdateBroadcaster.java
new file mode 100644
index 000000000000..4a527a5d98f1
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/_XUpdateBroadcaster.java
@@ -0,0 +1,248 @@
+/*************************************************************************
+ *
+ * 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.form;
+
+import lib.MultiMethodTest;
+import lib.StatusException;
+
+import com.sun.star.form.XUpdateBroadcaster;
+import com.sun.star.form.XUpdateListener;
+import com.sun.star.lang.EventObject;
+
+/**
+* Testing <code>com.sun.star.form.XUpdateBroadcaster</code>
+* interface methods :
+* <ul>
+* <li><code> addUpdateListener()</code></li>
+* <li><code> removeUpdateListener()</code></li>
+* </ul>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'XUpdateBroadcaster.Checker'</code> : <code>
+* _XUpdateBroadcaster.UpdateChecker</code> interface implementation
+* which can update, commit data and check if the data was successfully
+* commited.</li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.form.XUpdateBroadcaster
+*/
+public class _XUpdateBroadcaster extends MultiMethodTest {
+
+ public XUpdateBroadcaster oObj = null;
+ UpdateChecker checker = null ;
+
+ /**
+ * Interface for relation. Updating, commiting and checking
+ * if data was commited is object dependent behaviour.
+ */
+ public static interface UpdateChecker {
+ /**
+ * Method must make some data update in the object tested.
+ */
+ public void update() throws com.sun.star.uno.Exception ;
+ /**
+ * Method must commit data change made by method <code>update</code>.
+ */
+ public void commit() throws com.sun.star.uno.Exception ;
+ /**
+ * Checks if the data commited by <code>commit</code> method
+ * became permanent in data source.
+ * @return <code>true</code> if data was commited.
+ */
+ public boolean wasCommited() throws com.sun.star.uno.Exception ;
+ }
+
+ /**
+ * Retrieves object relations.
+ * @throws StatusException If one of relations not found.
+ */
+ public void before() {
+ checker = (UpdateChecker)
+ tEnv.getObjRelation("XUpdateBroadcaster.Checker") ;
+ if (checker == null) {
+ log.println("Relation not found") ;
+ throw new StatusException("Relation not found",
+ new NullPointerException("Relation not found")) ;
+ }
+ }
+
+ /**
+ * Listener implementation, which can accept or reject update
+ * requests and store event calls.
+ */
+ protected class TestListener implements XUpdateListener {
+ /**
+ * Indicates must listener approve update requests or not.
+ */
+ public boolean approve = false ;
+ /**
+ * Indicates that <code>approveUpdate</code> method was called.
+ */
+ public boolean approveCalled = false ;
+ /**
+ * Indicates that <code>updated</code> method was called.
+ */
+ public boolean updateCalled = false ;
+
+ /**
+ * Clears all flags.
+ */
+ public void init() {
+ approveCalled = false ;
+ updateCalled = false ;
+ }
+ public void disposing(EventObject ev) {}
+ public boolean approveUpdate(EventObject ev) {
+ approveCalled = true ;
+ return approve ;
+ }
+ public void updated(EventObject ev) {
+ updateCalled = true ;
+ }
+ }
+
+ private TestListener listener = new TestListener();
+
+ /**
+ * The listener methods calls are checked twice with approving
+ * and rejecting updates. <p>
+ * Has <b>OK</b> status if on update rejected only <code>
+ * approveUpdate</code> listener method was called, and if
+ * on update approved <code>approveUpdate</code> and
+ * <code>updated</code> methods called, and data was commited
+ * to the source.
+ */
+ public void _addUpdateListener() {
+ boolean bResult = true;
+
+ oObj.addUpdateListener(listener) ;
+
+ try {
+ checker.update() ;
+ shortWait() ;
+ checker.commit() ;
+ shortWait() ;
+ boolean commited = checker.wasCommited() ;
+
+ shortWait() ;
+
+ bResult = listener.approveCalled &&
+ ! listener.updateCalled &&
+ ! commited ;
+
+ log.println("Calling with no approving : approveUpdate() was " +
+ (listener.approveCalled ? "":"NOT")+" called, updated() was "+
+ (listener.updateCalled ? "":"NOT")+" called, the value was " +
+ (commited ? "" : "NOT") + " commited.") ;
+
+ shortWait() ;
+
+ listener.init() ;
+ listener.approve = true ;
+ shortWait() ;
+ checker.update() ;
+ shortWait() ;
+ checker.commit() ;
+ shortWait() ;
+ commited = checker.wasCommited() ;
+
+ shortWait() ;
+
+ log.println("Calling with approving : approveUpdate() was " +
+ (listener.approveCalled ? "":"NOT")+" called, updated() was "+
+ (listener.updateCalled ? "":"NOT")+" called, the value was "+
+ (commited ? "" : "NOT") + " commited.") ;
+
+ bResult = listener.approveCalled &&
+ listener.updateCalled &&
+ commited ;
+ } catch (com.sun.star.uno.Exception e) {
+ bResult = false ;
+ e.printStackTrace(log) ;
+ }
+
+ tRes.tested("addUpdateListener()", bResult);
+ }
+
+ /**
+ * Removes listener, updates data, and checks if no listener
+ * methods were called. <p>
+ * Has <b> OK </b> status if after listener removing no of its methods
+ * were called. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addUpdateListener </code> : to have a listener added.</li>
+ * </ul>
+ */
+ public void _removeUpdateListener() {
+ requiredMethod("addUpdateListener()");
+ boolean bResult = true;
+
+ listener.init() ;
+ listener.approve = true ;
+
+ oObj.removeUpdateListener(listener);
+
+ try {
+ checker.update() ;
+ shortWait() ;
+ checker.commit() ;
+
+ shortWait() ;
+
+ bResult = ! listener.approveCalled &&
+ ! listener.updateCalled ;
+ }
+ catch (com.sun.star.uno.Exception e) {
+ log.println("Exception occured during removeUpdateListener()");
+ e.printStackTrace(log);
+ bResult = false;
+ }
+
+ tRes.tested("removeUpdateListener()", bResult);
+ }
+
+ private void shortWait() {
+ try {
+ Thread.sleep(200);
+ }
+ catch (InterruptedException ex) {
+ }
+
+ }
+
+ /**
+ * Forces environment recreation.
+ */
+ protected void after() {
+ disposeEnvironment();
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/form/binding/_BindableDatabaseCheckBox.java b/qadevOOo/tests/java/ifc/form/binding/_BindableDatabaseCheckBox.java
new file mode 100644
index 000000000000..ba88f052b6d2
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/binding/_BindableDatabaseCheckBox.java
@@ -0,0 +1,36 @@
+/*************************************************************************
+ *
+ * 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.form.binding;
+
+import lib.MultiPropertyTest;
+
+public class _BindableDatabaseCheckBox extends MultiPropertyTest
+{
+
+}
diff --git a/qadevOOo/tests/java/ifc/form/binding/_BindableDatabaseRadioButton.java b/qadevOOo/tests/java/ifc/form/binding/_BindableDatabaseRadioButton.java
new file mode 100644
index 000000000000..e5c490201c55
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/binding/_BindableDatabaseRadioButton.java
@@ -0,0 +1,36 @@
+/*************************************************************************
+ *
+ * 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.form.binding;
+
+import lib.MultiPropertyTest;
+
+public class _BindableDatabaseRadioButton extends MultiPropertyTest
+{
+
+}
diff --git a/qadevOOo/tests/java/ifc/form/binding/_XBindableValue.java b/qadevOOo/tests/java/ifc/form/binding/_XBindableValue.java
new file mode 100644
index 000000000000..d8ecf916965b
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/binding/_XBindableValue.java
@@ -0,0 +1,122 @@
+/*************************************************************************
+ *
+ * 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.form.binding;
+
+import com.sun.star.form.binding.XBindableValue;
+import com.sun.star.form.binding.XValueBinding;
+import com.sun.star.uno.Type;
+
+import java.util.ArrayList;
+
+import lib.MultiMethodTest;
+
+
+public class _XBindableValue extends MultiMethodTest {
+ public XBindableValue oObj;
+ protected XValueBinding xValueBinding = null;
+
+ public void _getValueBinding() {
+ requiredMethod("setValueBinding");
+
+ boolean res = true;
+ xValueBinding = oObj.getValueBinding();
+ res &= checkValueBinding(xValueBinding);
+ tRes.tested("getValueBinding()", res);
+ }
+
+ public void _setValueBinding() {
+ String rightOne = "";
+
+ try {
+ oObj.setValueBinding(new MyValueBinding());
+ rightOne = (String) oObj.getValueBinding().getValue(null);
+ } catch (com.sun.star.form.binding.IncompatibleTypesException e) {
+ e.printStackTrace();
+ }
+
+ boolean res = rightOne.equals("MyValueBinding");
+
+ if (!res) {
+ log.println("Excepted: MyValueBinding");
+ log.println("getting: " + rightOne);
+ }
+
+ tRes.tested("setValueBinding()", res);
+ }
+
+ protected boolean checkValueBinding(XValueBinding xValueBinding) {
+ boolean res = true;
+ Type[] types = xValueBinding.getSupportedValueTypes();
+ log.println("Checking: ");
+
+ for (int i = 0; i < types.length; i++) {
+ log.println("\t" + types[i].getTypeName());
+
+ boolean localRes = xValueBinding.supportsType(types[i]);
+
+ if (!localRes) {
+ log.println("\t\tsupportsType returns false -- FAILED");
+ } else {
+ log.println("\t\tis supported -- OK");
+ }
+
+ res &= localRes;
+ }
+
+ return res;
+ }
+
+ class MyValueBinding implements XValueBinding {
+ private Type[] TypeArray;
+ private ArrayList types = new ArrayList();
+
+ public com.sun.star.uno.Type[] getSupportedValueTypes() {
+ return TypeArray;
+ }
+
+ public Object getValue(com.sun.star.uno.Type type)
+ throws com.sun.star.form.binding.IncompatibleTypesException {
+ return "MyValueBinding";
+ }
+
+ public void setValue(Object obj)
+ throws com.sun.star.form.binding.IncompatibleTypesException,
+ com.sun.star.lang.NoSupportException {
+ }
+
+ public boolean supportsType(com.sun.star.uno.Type type) {
+ types.add(type);
+ TypeArray = new Type[types.size()];
+
+ for (int i = 0; i < types.size(); i++) {
+ TypeArray[i] = (Type) types.toArray()[i];
+ }
+
+ return true;
+ }
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/ifc/form/component/_CheckBox.java b/qadevOOo/tests/java/ifc/form/component/_CheckBox.java
new file mode 100644
index 000000000000..a35a5318203b
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/component/_CheckBox.java
@@ -0,0 +1,44 @@
+/*************************************************************************
+ *
+ * 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.form.component;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.form.component.CheckBox</code>
+* service properties :
+* <ul>
+* <li><code> DefaultState</code></li>
+* <li><code> RefValue</code></li>
+* </ul> <p>
+* @see com.sun.star.form.component.CheckBox
+*/
+public class _CheckBox extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/form/component/_ComboBox.java b/qadevOOo/tests/java/ifc/form/component/_ComboBox.java
new file mode 100644
index 000000000000..6e81cf0718c2
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/component/_ComboBox.java
@@ -0,0 +1,43 @@
+/*************************************************************************
+ *
+ * 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.form.component;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.form.component.ComboBox</code>
+* service properties :
+* <ul>
+* <li><code> DefaultText</code></li>
+* </ul> <p>
+* @see com.sun.star.form.component.ComboBox
+*/
+public class _ComboBox extends MultiPropertyTest {
+ // these properties don't needed in special code.
+}
+
diff --git a/qadevOOo/tests/java/ifc/form/component/_CommandButton.java b/qadevOOo/tests/java/ifc/form/component/_CommandButton.java
new file mode 100644
index 000000000000..88e2161bf5de
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/component/_CommandButton.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.form.component;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.form.component.CommandButton</code>
+* service properties :
+* <ul>
+* <li><code> ButtonType</code></li>
+* <li><code> TargetFrame</code></li>
+* <li><code> TargetURL</code></li>
+* </ul>
+* @see com.sun.star.form.component.CommandButton
+*/
+public class _CommandButton extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/form/component/_CurrencyField.java b/qadevOOo/tests/java/ifc/form/component/_CurrencyField.java
new file mode 100644
index 000000000000..d5395baebc30
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/component/_CurrencyField.java
@@ -0,0 +1,58 @@
+/*************************************************************************
+ *
+ * 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.form.component;
+
+import lib.MultiPropertyTest;
+
+
+/**
+* Testing <code>com.sun.star.form.component.CurrencyField</code>
+* service properties :
+* <ul>
+* <li><code> DefaultValue</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.form.component.CurrencyField
+*/
+public class _CurrencyField extends MultiPropertyTest {
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _DefaultValue() {
+ testProperty("DefaultValue", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return util.utils.isVoid(old) ? new Double(17.5) :
+ super.getNewValue(p, old) ;
+ }
+ }) ;
+ }
+} // finish class _CurrencyField
+
+
diff --git a/qadevOOo/tests/java/ifc/form/component/_DataForm.java b/qadevOOo/tests/java/ifc/form/component/_DataForm.java
new file mode 100644
index 000000000000..2562994ec32a
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/component/_DataForm.java
@@ -0,0 +1,89 @@
+/*************************************************************************
+ *
+ * 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.form.component;
+
+import lib.MultiPropertyTest;
+
+import com.sun.star.form.TabulatorCycle;
+import com.sun.star.uno.Enum;
+
+/**
+* Testing <code>com.sun.star.form.component.DataForm</code>
+* service properties :
+* <ul>
+* <li><code> MasterFields</code></li>
+* <li><code> DetailFields</code></li>
+* <li><code> Cycle</code></li>
+* <li><code> NavigationBarMode</code></li>
+* <li><code> AllowInserts</code></li>
+* <li><code> AllowUpdates</code></li>
+* <li><code> AllowDeletes</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.form.component.DataForm
+*/
+public class _DataForm extends MultiPropertyTest {
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must be defined.
+ */
+ public void _NavigationBarMode() {
+ testProperty("NavigationBarMode", new PropertyTester() {
+ public String toString(Object obj) {
+ if (util.utils.isVoid(obj)) {
+ return "null";
+ } else {
+ return "(" + obj.getClass().toString() + ")"
+ + ((Enum)obj).getValue();
+ }
+ }
+ });
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must be defined.
+ */
+ public void _Cycle() {
+ testProperty("Cycle", new PropertyTester() {
+ public Object getNewValue(String propName, Object oldValue) {
+ return TabulatorCycle.CURRENT;
+ }
+ public String toString(Object obj) {
+ if (util.utils.isVoid(obj))
+ return "null";
+ else
+ return "(" + obj.getClass().toString() + ")"
+ + ((Enum)obj).getValue();
+ }
+ });
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/form/component/_DatabaseComboBox.java b/qadevOOo/tests/java/ifc/form/component/_DatabaseComboBox.java
new file mode 100644
index 000000000000..255153b2e0f0
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/component/_DatabaseComboBox.java
@@ -0,0 +1,46 @@
+/*************************************************************************
+ *
+ * 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.form.component ;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.form.component.DatabaseComboBox</code>
+* service properties :
+* <ul>
+* <li><code> ConvertEmptyToNull</code></li>
+* <li><code> ListSource</code></li>
+* <li><code> ListSourceType</code></li>
+* </ul> <p>
+* All properties are tested by class <code>MultiPropertyTest</code>
+* @see com.sun.star.form.component.DatabaseComboBox
+*/
+public class _DatabaseComboBox extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/form/component/_DatabaseForm.java b/qadevOOo/tests/java/ifc/form/component/_DatabaseForm.java
new file mode 100644
index 000000000000..6201f3cbe407
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/component/_DatabaseForm.java
@@ -0,0 +1,93 @@
+/*************************************************************************
+ *
+ * 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.form.component;
+
+import lib.MultiPropertyTest;
+import util.dbg;
+
+import com.sun.star.form.TabulatorCycle;
+import com.sun.star.uno.Enum;
+
+/**
+* Testing <code>com.sun.star.form.component.DatabaseForm</code>
+* service properties:
+* <ul>
+* <li><code> MasterFields</code></li>
+* <li><code> DetailFields</code></li>
+* <li><code> Cycle</code></li>
+* <li><code> NavigationBarMode</code></li>
+* <li><code> AllowInserts</code></li>
+* <li><code> AllowUpdates</code></li>
+* <li><code> AllowDeletes</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.form.component.DatabaseForm
+*/
+public class _DatabaseForm extends MultiPropertyTest {
+
+ /**
+ * In this property test only debugging information output
+ * is customized.
+ */
+ public void _NavigationBarMode() {
+ dbg.printPropertyInfo(oObj, "NavigationBarMode");
+ testProperty("NavigationBarMode", new PropertyTester() {
+ public String toString(Object obj) {
+ if (obj == null) {
+ return "null";
+ } else {
+ return "(" + obj.getClass().toString() + ")"
+ + ((Enum)obj).getValue();
+ }
+ }
+ });
+ }
+
+ /**
+ * This property new value is always fixed and debugging
+ * information output is customized.
+ */
+ public void _Cycle() {
+ dbg.printPropertyInfo(oObj, "Cycle");
+ testProperty("Cycle", new PropertyTester() {
+ public Object getNewValue(String propName, Object oldValue) {
+ return TabulatorCycle.CURRENT;
+ }
+
+ public String toString(Object obj) {
+ if (obj == null) {
+ return "null";
+ } else {
+ return "(" + obj.getClass().toString() + ")"
+ + ((Enum)obj).getValue();
+ }
+ }
+ });
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/form/component/_DatabaseFormattedField.java b/qadevOOo/tests/java/ifc/form/component/_DatabaseFormattedField.java
new file mode 100644
index 000000000000..0e7cf7e499ac
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/component/_DatabaseFormattedField.java
@@ -0,0 +1,44 @@
+/*************************************************************************
+ *
+ * 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.form.component ;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.form.component.DatabaseFormattedField</code>
+* service properties :
+* <ul>
+* <li><code> ConvertEmptyToNull</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.form.component.DatabaseFormattedField
+*/
+public class _DatabaseFormattedField extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/form/component/_DatabaseImageControl.java b/qadevOOo/tests/java/ifc/form/component/_DatabaseImageControl.java
new file mode 100644
index 000000000000..8953e68263b5
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/component/_DatabaseImageControl.java
@@ -0,0 +1,44 @@
+/*************************************************************************
+ *
+ * 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.form.component;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.form.component.DatabaseImageControl</code>
+* service properties :
+* <ul>
+* <li><code> ReadOnly</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.form.component.DatabaseImageControl
+*/
+public class _DatabaseImageControl extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/form/component/_DatabaseListBox.java b/qadevOOo/tests/java/ifc/form/component/_DatabaseListBox.java
new file mode 100644
index 000000000000..2b2bcd9f28ff
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/component/_DatabaseListBox.java
@@ -0,0 +1,46 @@
+/*************************************************************************
+ *
+ * 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.form.component;
+
+import lib.MultiPropertyTest;
+
+/*
+* Testing <code>com.sun.star.form.component.DatabaseListBox</code>
+* service properties :
+* <ul>
+* <li><code> BoundColumn</code></li>
+* <li><code> ListSourceType</code></li>
+* </ul> <p>
+* All properties testing is automated by
+* <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.form.component.DatabaseListBox
+*/
+public class _DatabaseListBox extends MultiPropertyTest {
+ // these properties don't needed in special code.
+}
+
diff --git a/qadevOOo/tests/java/ifc/form/component/_DatabasePatternField.java b/qadevOOo/tests/java/ifc/form/component/_DatabasePatternField.java
new file mode 100644
index 000000000000..cedad761180d
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/component/_DatabasePatternField.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.form.component;
+
+import lib.MultiPropertyTest;
+
+
+/**
+* Testing <code>com.sun.star.form.component.DatabasePatternField</code>
+* service properties :
+* <ul>
+* <li><code> ConvertEmptyToNull</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.form.component.DatabasePatternField
+*/
+public class _DatabasePatternField extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/form/component/_DatabaseTextField.java b/qadevOOo/tests/java/ifc/form/component/_DatabaseTextField.java
new file mode 100644
index 000000000000..2ff48480d0e7
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/component/_DatabaseTextField.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.form.component;
+
+import lib.MultiPropertyTest;
+
+
+/**
+* Testing <code>com.sun.star.form.component.DatabaseTextField</code>
+* service properties :
+* <ul>
+* <li><code> ConvertEmptyToNull</code></li>
+* </ul> <p>
+* All properties are tested by class <code>MultiPropertyTest</code>
+* @see com.sun.star.form.component.DatabaseTextField
+*/
+public class _DatabaseTextField extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/form/component/_DateField.java b/qadevOOo/tests/java/ifc/form/component/_DateField.java
new file mode 100644
index 000000000000..4241b543d1d3
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/component/_DateField.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.form.component;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.form.component.DateField</code>
+* service properties :
+* <ul>
+* <li><code> DefaultDate</code></li>
+* </ul>
+* @see com.sun.star.form.component.DateField
+*/
+public class _DateField extends MultiPropertyTest {
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _DefaultDate() {
+ testProperty("DefaultDate", new PropertyTester() {
+ protected Object getNewValue(String prop, Object old) {
+ return util.utils.isVoid(old) ? new Integer(20010507) :
+ super.getNewValue(prop, old) ;
+ }
+ }) ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/form/component/_FileControl.java b/qadevOOo/tests/java/ifc/form/component/_FileControl.java
new file mode 100644
index 000000000000..9b73a1d995d5
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/component/_FileControl.java
@@ -0,0 +1,44 @@
+/*************************************************************************
+ *
+ * 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.form.component;
+
+import lib.MultiPropertyTest;
+
+/*
+* Testing <code>com.sun.star.form.component.FileControl</code>
+* service properties :
+* <ul>
+* <li><code> DefaultText</code></li>
+* </ul>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.form.component.FileControl
+*/
+public class _FileControl extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/form/component/_FormattedField.java b/qadevOOo/tests/java/ifc/form/component/_FormattedField.java
new file mode 100644
index 000000000000..e75f212edbef
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/component/_FormattedField.java
@@ -0,0 +1,35 @@
+/*************************************************************************
+ *
+ * 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.form.component ;
+
+import lib.MultiPropertyTest;
+
+public class _FormattedField extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/form/component/_GridControl.java b/qadevOOo/tests/java/ifc/form/component/_GridControl.java
new file mode 100644
index 000000000000..58412dc4667d
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/component/_GridControl.java
@@ -0,0 +1,101 @@
+/*************************************************************************
+ *
+ * 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.form.component;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.form.component.GridControl</code>
+* service properties :
+* <ul>
+* <li><code> Border</code></li>
+* <li><code> Enabled</code></li>
+* <li><code> FontDescriptor</code></li>
+* <li><code> RowHeight</code></li>
+* <li><code> Tabstop</code></li>
+* <li><code> TextColor</code></li>
+* </ul>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.form.component.GridControl
+*/
+public class _GridControl extends MultiPropertyTest {
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _RowHeight() {
+ testProperty("RowHeight", new PropertyTester() {
+ protected Object getNewValue(String prop, Object old) {
+ return util.utils.isVoid(old) ? new Integer(11) :
+ super.getNewValue(prop, old) ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _Tabstop() {
+ testProperty("Tabstop", new PropertyTester() {
+ protected Object getNewValue(String prop, Object old) {
+ return util.utils.isVoid(old) ? new Boolean(true) :
+ super.getNewValue(prop, old) ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _TextColor() {
+ testProperty("TextColor", new PropertyTester() {
+ protected Object getNewValue(String prop, Object old) {
+ return util.utils.isVoid(old) ? new Integer(342) :
+ super.getNewValue(prop, old) ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _BorderColor() {
+ testProperty("BorderColor", new PropertyTester() {
+ protected Object getNewValue(String prop, Object old) {
+ return util.utils.isVoid(old) ? new Integer(342) :
+ super.getNewValue(prop, old) ;
+ }
+ }) ;
+ }
+} // finish class _GridControl
+
+
diff --git a/qadevOOo/tests/java/ifc/form/component/_HTMLForm.java b/qadevOOo/tests/java/ifc/form/component/_HTMLForm.java
new file mode 100644
index 000000000000..d592a979706c
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/component/_HTMLForm.java
@@ -0,0 +1,47 @@
+/*************************************************************************
+ *
+ * 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.form.component;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.form.component.HTMLForm</code>
+* service properties :
+* <ul>
+* <li><code> TargetFrame</code></li>
+* <li><code> TargetURL</code></li>
+* <li><code> SubmitMethod</code></li>
+* <li><code> SubmitEncoding</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.form.component.HTMLForm
+*/
+public class _HTMLForm extends MultiPropertyTest {
+
+} // finish class _HTMLForm
+
diff --git a/qadevOOo/tests/java/ifc/form/component/_HiddenControl.java b/qadevOOo/tests/java/ifc/form/component/_HiddenControl.java
new file mode 100644
index 000000000000..3e895e9aa2c2
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/component/_HiddenControl.java
@@ -0,0 +1,44 @@
+/*************************************************************************
+ *
+ * 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.form.component;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.form.component.HiddenControl</code>
+* service properties :
+* <ul>
+* <li><code> HiddenValue</code></li>
+* </ul>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.form.component.HiddenControl
+*/
+public class _HiddenControl extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/form/component/_ImageButton.java b/qadevOOo/tests/java/ifc/form/component/_ImageButton.java
new file mode 100644
index 000000000000..772d41c23ab0
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/component/_ImageButton.java
@@ -0,0 +1,46 @@
+/*************************************************************************
+ *
+ * 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.form.component;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.form.component.ImageButton</code>
+* service properties :
+* <ul>
+* <li><code> ButtonType</code></li>
+* <li><code> TargetFrame</code></li>
+* <li><code> TargetURL</code></li>
+* </ul>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.form.component.ImageButton
+*/
+public class _ImageButton extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/form/component/_ListBox.java b/qadevOOo/tests/java/ifc/form/component/_ListBox.java
new file mode 100644
index 000000000000..12cb1c9a5808
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/component/_ListBox.java
@@ -0,0 +1,46 @@
+/*************************************************************************
+ *
+ * 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.form.component;
+
+import lib.MultiPropertyTest;
+
+
+/**
+* Testing <code>com.sun.star.form.component.ListBox</code>
+* service properties :
+* <ul>
+* <li><code> DefaultSelection</code></li>
+* <li><code> ListSource</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.form.component.ListBox
+*/
+public class _ListBox extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/form/component/_NavigationToolBar.java b/qadevOOo/tests/java/ifc/form/component/_NavigationToolBar.java
new file mode 100644
index 000000000000..0b4714d74cbb
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/component/_NavigationToolBar.java
@@ -0,0 +1,52 @@
+/*************************************************************************
+ *
+ * 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.form.component;
+
+import lib.MultiPropertyTest;
+
+public class _NavigationToolBar extends MultiPropertyTest {
+
+ public void _TextColor() {
+ testProperty("TextColor", new PropertyTester() {
+ protected Object getNewValue(String prop, Object old) {
+ return util.utils.isVoid(old) ? new Integer(20010507) :
+ super.getNewValue(prop, old) ;
+ }
+ }) ;
+ }
+
+ public void _TextLineColor() {
+ testProperty("TextLineColor", new PropertyTester() {
+ protected Object getNewValue(String prop, Object old) {
+ return util.utils.isVoid(old) ? new Integer(20050507) :
+ super.getNewValue(prop, old) ;
+ }
+ }) ;
+ }
+
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/ifc/form/component/_NumericField.java b/qadevOOo/tests/java/ifc/form/component/_NumericField.java
new file mode 100644
index 000000000000..12eb31bab662
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/component/_NumericField.java
@@ -0,0 +1,57 @@
+/*************************************************************************
+ *
+ * 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.form.component;
+
+import lib.MultiPropertyTest;
+
+
+/**
+* Testing <code>com.sun.star.form.component.NumericField</code>
+* service properties :
+* <ul>
+* <li><code> DefaultValue</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.form.component.NumericField
+*/
+public class _NumericField extends MultiPropertyTest {
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _DefaultValue() {
+ testProperty("DefaultValue", new PropertyTester() {
+ protected Object getNewValue(String prop, Object old) {
+ return util.utils.isVoid(old) ? new Double(111.11) :
+ super.getNewValue(prop, old) ;
+ }
+ }) ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/form/component/_PatternField.java b/qadevOOo/tests/java/ifc/form/component/_PatternField.java
new file mode 100644
index 000000000000..67a109e28b4d
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/component/_PatternField.java
@@ -0,0 +1,44 @@
+/*************************************************************************
+ *
+ * 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.form.component;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.form.component.PatternField</code>
+* service properties :
+* <ul>
+* <li><code> DefaultText</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.form.component.PatternField
+*/
+public class _PatternField extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/form/component/_RadioButton.java b/qadevOOo/tests/java/ifc/form/component/_RadioButton.java
new file mode 100644
index 000000000000..44e0ef9f7ed0
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/component/_RadioButton.java
@@ -0,0 +1,46 @@
+/*************************************************************************
+ *
+ * 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.form.component;
+
+import lib.MultiPropertyTest;
+
+
+/**
+* Testing <code>com.sun.star.form.component.RadioButton</code>
+* service properties :
+* <ul>
+* <li><code> DefaultState</code></li>
+* <li><code> RefValue</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.form.component.RadioButton
+*/
+public class _RadioButton extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/form/component/_RichTextControl.java b/qadevOOo/tests/java/ifc/form/component/_RichTextControl.java
new file mode 100644
index 000000000000..e154930b4336
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/component/_RichTextControl.java
@@ -0,0 +1,34 @@
+/*************************************************************************
+ *
+ * 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.form.component;
+
+import lib.MultiPropertyTest;
+
+public class _RichTextControl extends MultiPropertyTest {
+
+}
diff --git a/qadevOOo/tests/java/ifc/form/component/_ScrollBar.java b/qadevOOo/tests/java/ifc/form/component/_ScrollBar.java
new file mode 100644
index 000000000000..d2038667dd95
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/component/_ScrollBar.java
@@ -0,0 +1,34 @@
+/*************************************************************************
+ *
+ * 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.form.component;
+
+import lib.MultiPropertyTest;
+
+public class _ScrollBar extends MultiPropertyTest{
+
+}
diff --git a/qadevOOo/tests/java/ifc/form/component/_SpinButton.java b/qadevOOo/tests/java/ifc/form/component/_SpinButton.java
new file mode 100644
index 000000000000..1564705b004b
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/component/_SpinButton.java
@@ -0,0 +1,34 @@
+/*************************************************************************
+ *
+ * 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.form.component;
+
+import lib.MultiPropertyTest;
+
+public class _SpinButton extends MultiPropertyTest {
+
+}
diff --git a/qadevOOo/tests/java/ifc/form/component/_TextField.java b/qadevOOo/tests/java/ifc/form/component/_TextField.java
new file mode 100644
index 000000000000..1b552e184b19
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/component/_TextField.java
@@ -0,0 +1,44 @@
+/*************************************************************************
+ *
+ * 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.form.component;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.form.component.TextField</code>
+* service properties :
+* <ul>
+* <li><code> DefaultText</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.form.component.TextField
+*/
+public class _TextField extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/form/component/_TimeField.java b/qadevOOo/tests/java/ifc/form/component/_TimeField.java
new file mode 100644
index 000000000000..70dc2a75720b
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/component/_TimeField.java
@@ -0,0 +1,57 @@
+/*************************************************************************
+ *
+ * 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.form.component;
+
+import lib.MultiPropertyTest;
+import util.utils;
+
+/**
+* Testing <code>com.sun.star.form.component.TimeField</code>
+* service properties :
+* <ul>
+* <li><code> DefaultTime</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.form.component.TimeField
+*/
+public class _TimeField extends MultiPropertyTest {
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _DefaultTime() {
+ testProperty("DefaultTime", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(4321) :
+ super.getNewValue(p, old) ;
+ }
+ }) ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/form/submission/_XSubmission.java b/qadevOOo/tests/java/ifc/form/submission/_XSubmission.java
new file mode 100644
index 000000000000..14c8b37be71d
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/submission/_XSubmission.java
@@ -0,0 +1,192 @@
+/*************************************************************************
+ *
+ * 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.form.submission;
+
+import com.sun.star.form.submission.XSubmission;
+import com.sun.star.form.submission.XSubmissionVetoListener;
+
+import lib.MultiMethodTest;
+
+
+public class _XSubmission extends MultiMethodTest {
+ public XSubmission oObj = null;
+ public boolean HandlerWasCalled = false;
+
+ public void _addSubmissionVetoListener() {
+ log.println(
+ "submitting with VetoListener ... exception should appear");
+
+ boolean res = true;
+ XSubmissionVetoListener aListener = new MyListener();
+
+ try {
+ oObj.addSubmissionVetoListener(aListener);
+ oObj.submit();
+ res = false;
+ log.println(
+ "the expected exception wasn't thrown ... FAILED");
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println(
+ "Expected exception was thrown while calling submit() "
+ + e.getMessage() + "FAILED");
+ res = false;
+ } catch (com.sun.star.lang.NoSupportException e) {
+ log.println(
+ "NoSupportExpected exception was thrown while calling submit() "
+ + e.getMessage() + "FAILED");
+ res = false;
+ } catch (com.sun.star.util.VetoException e) {
+ log.println(
+ "VetoException was thrown while calling submit() "
+ + e.getMessage() + "OK");
+ }
+
+ try {
+ oObj.removeSubmissionVetoListener(aListener);
+ } catch (com.sun.star.lang.NoSupportException e) {
+ log.println(
+ "NoSupportExpected exception was thrown while removing the listener) "
+ + e.getMessage() + "FAILED");
+ res = false;
+ }
+
+ tRes.tested("addSubmissionVetoListener()", res);
+ }
+
+ public void _removeSubmissionVetoListener() {
+ log.println(
+ "submitting with VetoListener ... exception should appear");
+
+ boolean res = true;
+ XSubmissionVetoListener aListener = new MyListener();
+
+ try {
+ oObj.addSubmissionVetoListener(aListener);
+ oObj.submit();
+ res = false;
+ log.println(
+ "the expected exception wasn't thrown ... FAILED");
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println(
+ "WrappedTargetException exception was thrown while calling submit() "
+ + e.getMessage() + "FAILED");
+ res = false;
+ } catch (com.sun.star.lang.NoSupportException e) {
+ log.println(
+ "NoSupportExpected exception was thrown while calling submit() "
+ + e.getMessage() + "FAILED");
+ res = false;
+ } catch (com.sun.star.util.VetoException e) {
+ log.println(
+ "VetoException was thrown while calling submit() "
+ + e.getMessage() + "OK");
+ }
+
+ log.println("removing the listener");
+
+ try {
+ oObj.removeSubmissionVetoListener(aListener);
+ } catch (com.sun.star.lang.NoSupportException e) {
+ log.println(
+ "NoSupportExpected exception was thrown while removing the listener) "
+ + e.getMessage() + "FAILED");
+ res = false;
+ }
+
+ log.println("Sleeping 2s");
+
+ try {
+ Thread.sleep(2000);
+ } catch (InterruptedException e) {
+ // sleeping didn't work
+ }
+
+ log.println("... done");
+
+ log.println(
+ "submitting after VetoListener has been removed... no exception should appear");
+
+ try {
+ oObj.submit();
+ log.println("No Exception ... OK");
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println(
+ "WrappedTargetException was thrown while calling submit() "
+ + e.getMessage() + "FAILED");
+ res = false;
+ } catch (com.sun.star.util.VetoException e) {
+ log.println(
+ "VetoException was thrown while calling submit() "
+ + e.getMessage() + "FAILED");
+ res = false;
+ }
+
+ tRes.tested("removeSubmissionVetoListener()", res);
+ }
+
+ /** Calls submit and returns true if no exception was thrown
+ * then adds a SubmissionVetoListener and checks if the
+ * exception is thrown in case of a veto of this listener.
+ */
+ public void _submit() {
+ boolean res = true;
+ log.println(
+ "submitting without VetoListener ... no exception should appear");
+
+ try {
+ oObj.submit();
+ log.println("No Exception ... OK");
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println(
+ "Exception was thrown while calling submit() "
+ + e.getMessage() + "FAILED");
+ res = false;
+ } catch (com.sun.star.util.VetoException e) {
+ log.println(
+ "VetoException was thrown while calling submit() "
+ + e.getMessage() + "FAILED");
+ res = false;
+ }
+
+ tRes.tested("submit()", res);
+ }
+
+ public class MyListener implements XSubmissionVetoListener {
+ public void disposing(
+ com.sun.star.lang.EventObject eventObject) {
+ }
+
+ public void submitting(
+ com.sun.star.lang.EventObject eventObject)
+ throws com.sun.star.util.VetoException {
+ log.println("MyVetoListener was called");
+ throw new com.sun.star.util.VetoException(
+ "submission isn't allowed ...");
+ }
+ }
+
+}
diff --git a/qadevOOo/tests/java/ifc/form/submission/_XSubmissionSupplier.java b/qadevOOo/tests/java/ifc/form/submission/_XSubmissionSupplier.java
new file mode 100644
index 000000000000..dc003235e8b9
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/submission/_XSubmissionSupplier.java
@@ -0,0 +1,81 @@
+/*************************************************************************
+ *
+ * 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.form.submission;
+
+import com.sun.star.form.submission.XSubmission;
+import com.sun.star.form.submission.XSubmissionSupplier;
+import com.sun.star.form.submission.XSubmissionVetoListener;
+import com.sun.star.task.XInteractionHandler;
+import lib.MultiMethodTest;
+
+public class _XSubmissionSupplier extends MultiMethodTest
+{
+ public XSubmissionSupplier oObj = null;
+ public boolean submitWasCalled = false;
+
+ public void _Submission() {
+ XSubmission stub = new MyXSubmission();
+ oObj.setSubmission (stub);
+ XSubmission xSubmission = oObj.getSubmission ();
+ try {
+ xSubmission.submit ();
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Exception during submit "+e.getMessage ());
+ }
+ catch (com.sun.star.util.VetoException e) {
+ log.println("VetoException during submit "+e.getMessage ());
+ }
+ tRes.tested ("Submission()",submitWasCalled);
+ }
+
+ private class MyXSubmission implements XSubmission {
+
+ public void submit () throws com.sun.star.util.VetoException, com.sun.star.lang.WrappedTargetException
+ {
+ submitWasCalled=true;
+ log.println("MyXSubmission: someone called submit :-)");
+ }
+
+ public void submitWithInteraction( XInteractionHandler handler ) throws com.sun.star.util.VetoException, com.sun.star.lang.WrappedTargetException
+ {
+ log.println("MyXSubmission: someone called submitWithInteraction :-)");
+ }
+
+ public void addSubmissionVetoListener( XSubmissionVetoListener listener ) throws com.sun.star.lang.NoSupportException
+ {
+ throw new com.sun.star.lang.NoSupportException();
+ }
+
+ public void removeSubmissionVetoListener( XSubmissionVetoListener listener ) throws com.sun.star.lang.NoSupportException
+ {
+ throw new com.sun.star.lang.NoSupportException();
+ }
+
+ }
+
+}
diff --git a/qadevOOo/tests/java/ifc/form/validation/_XValidatable.java b/qadevOOo/tests/java/ifc/form/validation/_XValidatable.java
new file mode 100644
index 000000000000..bc0b30a4f1d1
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/validation/_XValidatable.java
@@ -0,0 +1,85 @@
+/*************************************************************************
+ *
+ * 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.form.validation;
+
+import com.sun.star.form.validation.XValidatable;
+import com.sun.star.form.validation.XValidator;
+
+import lib.MultiMethodTest;
+
+
+public class _XValidatable extends MultiMethodTest {
+ public XValidatable oObj;
+
+ public void _getValidator() {
+ requiredMethod("setValidator()");
+
+ XValidator xValidator = oObj.getValidator();
+ boolean res = xValidator.isValid(Boolean.FALSE);
+ tRes.tested("getValidator()", res);
+ }
+
+ public void _setValidator() {
+ boolean res = false;
+
+ try {
+ oObj.setValidator(new MyValidator());
+
+ XValidator xValidator = oObj.getValidator();
+ String getting = xValidator.explainInvalid(null);
+ res = getting.equals("explainInvalid");
+
+ if (!res) {
+ log.println("\tExpected: explainInvalid");
+ log.println("\tGetting: " + getting);
+ log.println("FAILED");
+ }
+ } catch (com.sun.star.util.VetoException e) {
+ e.printStackTrace();
+ }
+
+ tRes.tested("setValidator()", res);
+ }
+
+ public class MyValidator implements XValidator {
+ public void addValidityConstraintListener(com.sun.star.form.validation.XValidityConstraintListener xValidityConstraintListener)
+ throws com.sun.star.lang.NullPointerException {
+ }
+
+ public String explainInvalid(Object obj) {
+ return "explainInvalid";
+ }
+
+ public boolean isValid(Object obj) {
+ return true;
+ }
+
+ public void removeValidityConstraintListener(com.sun.star.form.validation.XValidityConstraintListener xValidityConstraintListener)
+ throws com.sun.star.lang.NullPointerException {
+ }
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/ifc/form/validation/_XValidatableFormComponent.java b/qadevOOo/tests/java/ifc/form/validation/_XValidatableFormComponent.java
new file mode 100644
index 000000000000..2a7e989418b2
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/validation/_XValidatableFormComponent.java
@@ -0,0 +1,247 @@
+/*************************************************************************
+ *
+ * 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.form.validation;
+
+import com.sun.star.beans.Property;
+import com.sun.star.beans.PropertyAttribute;
+import com.sun.star.beans.XMultiPropertySet;
+import com.sun.star.beans.XPropertySetInfo;
+import com.sun.star.form.validation.XFormComponentValidityListener;
+import com.sun.star.form.validation.XValidatableFormComponent;
+import com.sun.star.uno.UnoRuntime;
+
+import lib.MultiMethodTest;
+
+import util.ValueChanger;
+
+import java.util.StringTokenizer;
+
+
+public class _XValidatableFormComponent extends MultiMethodTest
+{
+ public XValidatableFormComponent oObj;
+ protected XFormComponentValidityListener listener = null;
+ public boolean listenerCalled = false;
+ private String[] testPropsNames = null;
+ private int testPropsAmount = 0;
+
+ public void _addFormComponentValidityListener()
+ {
+ listener = new MyListener();
+
+ boolean res = true;
+
+ try
+ {
+ oObj.addFormComponentValidityListener(listener);
+ }
+ catch (com.sun.star.lang.NullPointerException e)
+ {
+ res = false;
+ e.printStackTrace();
+ }
+
+ changeAllProperties();
+ res &= listenerCalled;
+ tRes.tested("addFormComponentValidityListener()", res);
+ }
+
+ public void _getCurrentValue()
+ {
+ Object cValue = oObj.getCurrentValue();
+ tRes.tested("getCurrentValue()", true);
+ }
+
+ public void _isValid()
+ {
+ boolean res = oObj.isValid();
+ tRes.tested("isValid()", res);
+ }
+
+ public void _removeFormComponentValidityListener()
+ {
+ requiredMethod("isValid()");
+
+ boolean res = true;
+
+ try
+ {
+ oObj.removeFormComponentValidityListener(listener);
+ }
+ catch (com.sun.star.lang.NullPointerException e)
+ {
+ res = false;
+ e.printStackTrace();
+ }
+
+ listenerCalled = false;
+ changeAllProperties();
+ res &= !listenerCalled;
+ tRes.tested("removeFormComponentValidityListener()", true);
+ }
+
+ protected void changeAllProperties()
+ {
+ XMultiPropertySet mProps =
+ (XMultiPropertySet) UnoRuntime.queryInterface(
+ XMultiPropertySet.class, tEnv.getTestObject()
+ );
+ XPropertySetInfo propertySetInfo = mProps.getPropertySetInfo();
+ Property[] properties = propertySetInfo.getProperties();
+ getPropsToTest(properties);
+ log.println("Changing all properties");
+
+ Object[] gValues = mProps.getPropertyValues(testPropsNames);
+
+ for (int i = 0; i < testPropsAmount; i++)
+ {
+ Object oldValue = gValues[i];
+
+ if (
+ testPropsNames[i].equals("Value")
+ || testPropsNames[i].equals("Time")
+ || testPropsNames[i].equals("EffectiveValue")
+ )
+ {
+ oldValue = new Integer(10);
+ }
+
+ Object newValue = ValueChanger.changePValue(oldValue);
+ gValues[i] = newValue;
+
+ // System.out.println("#############################################");
+ // System.out.println("Name: "+testPropsNames[i]);
+ // System.out.println("OldValue: "+oldValue);
+ // System.out.println("NewValue: "+newValue);
+ // System.out.println("#############################################");
+ }
+
+ try
+ {
+ mProps.setPropertyValues(testPropsNames, gValues);
+ }
+ catch (com.sun.star.beans.PropertyVetoException e)
+ {
+ log.println("Exception occured while setting properties");
+ e.printStackTrace(log);
+ }
+ catch (com.sun.star.lang.IllegalArgumentException e)
+ {
+ log.println("Exception occured while setting properties");
+ e.printStackTrace(log);
+ }
+ catch (com.sun.star.lang.WrappedTargetException e)
+ {
+ log.println("Exception occured while setting properties");
+ e.printStackTrace(log);
+ }
+ // end of try-catch
+ }
+
+ //Get the properties being tested
+ private void getPropsToTest(Property[] properties)
+ {
+ String bound = "";
+
+ for (int i = 0; i < properties.length; i++)
+ {
+ Property property = properties[i];
+ String name = property.Name;
+ boolean isWritable =
+ ((property.Attributes & PropertyAttribute.READONLY) == 0);
+ boolean isNotNull =
+ ((property.Attributes & PropertyAttribute.MAYBEVOID) == 0);
+ boolean isBound =
+ ((property.Attributes & PropertyAttribute.BOUND) != 0);
+
+ //these have values that are interfaces we can't change
+ if (
+ name.equals("TextUserDefinedAttributes")
+ || name.equals("ReferenceDevice")
+ || name.equals("ParaUserDefinedAttributes")
+ )
+ {
+ isWritable = false;
+ }
+
+ if (
+ name.equals("Value") || name.equals("Time")
+ || name.equals("Date")
+ )
+ {
+ bound = (name + ";");
+ }
+
+ if (
+ isWritable && isNotNull && (name.indexOf("Format") < 0)
+ && !name.equals("Enabled")
+ )
+ {
+ bound += (name + ";");
+ }
+ }
+ // endfor
+
+ //get a array of bound properties
+ if (bound.equals(""))
+ {
+ bound = "none";
+ }
+
+ if (tEnv.getTestCase().getObjectName().indexOf("Formatted") > 0)
+ {
+ bound = "EffectiveValue;";
+ }
+
+ StringTokenizer ST = new StringTokenizer(bound, ";");
+ int nr = ST.countTokens();
+ testPropsNames = new String[nr];
+
+ for (int i = 0; i < nr; i++)
+ testPropsNames[i] = ST.nextToken();
+
+ testPropsAmount = nr;
+
+ return;
+ }
+
+ protected class MyListener implements XFormComponentValidityListener
+ {
+ public void componentValidityChanged(
+ com.sun.star.lang.EventObject eventObject
+ )
+ {
+ System.out.println("componentValidityChanged called");
+ listenerCalled = true;
+ }
+
+ public void disposing(com.sun.star.lang.EventObject eventObject)
+ {
+ System.out.println("Listener Disposed");
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/ifc/form/validation/_XValidityConstraintListener.java b/qadevOOo/tests/java/ifc/form/validation/_XValidityConstraintListener.java
new file mode 100644
index 000000000000..055a3da4478b
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/validation/_XValidityConstraintListener.java
@@ -0,0 +1,90 @@
+/*************************************************************************
+ *
+ * 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.form.validation;
+
+import com.sun.star.form.validation.XValidatable;
+import com.sun.star.form.validation.XValidator;
+import com.sun.star.form.validation.XValidityConstraintListener;
+import com.sun.star.uno.UnoRuntime;
+
+import lib.MultiMethodTest;
+
+
+public class _XValidityConstraintListener extends MultiMethodTest {
+ public XValidityConstraintListener oObj;
+ protected boolean ValidatorCalled = false;
+
+ public void _validityConstraintChanged() {
+ boolean res = false;
+ try {
+ XValidatable xValidatable = (XValidatable) UnoRuntime.queryInterface(
+ XValidatable.class,
+ tEnv.getTestObject());
+
+ log.println("adding Validator");
+ XValidator xValidator = new MyValidator();
+ xValidatable.setValidator(xValidator);
+ ValidatorCalled = false;
+
+ log.println("calling validityConstraintChanged()");
+ oObj.validityConstraintChanged(
+ new com.sun.star.lang.EventObject());
+ res = ValidatorCalled;
+ } catch (com.sun.star.util.VetoException e) {
+ e.printStackTrace();
+ }
+ tRes.tested("validityConstraintChanged()",res);
+ }
+
+ /*
+ * The validator to add this Listener implementation
+ *
+ */
+ public class MyValidator implements XValidator {
+ public void addValidityConstraintListener(com.sun.star.form.validation.XValidityConstraintListener xValidityConstraintListener)
+ throws com.sun.star.lang.NullPointerException {
+ log.println("\t Validator::addValidityConstraintListener called");
+ }
+
+ public String explainInvalid(Object obj) {
+ log.println("\t Validator::explainInvalid() called");
+
+ return "explainInvalid";
+ }
+
+ public boolean isValid(Object obj) {
+ log.println("\t Validator::isValid() called");
+ ValidatorCalled = true;
+ return false;
+ }
+
+ public void removeValidityConstraintListener(com.sun.star.form.validation.XValidityConstraintListener xValidityConstraintListener)
+ throws com.sun.star.lang.NullPointerException {
+ log.println("\t Validator::removeValidityConstraintListener called");
+ }
+ }
+} \ No newline at end of file