summaryrefslogtreecommitdiff
path: root/qadevOOo/tests/java/ifc/awt
diff options
context:
space:
mode:
Diffstat (limited to 'qadevOOo/tests/java/ifc/awt')
-rw-r--r--qadevOOo/tests/java/ifc/awt/_UnoControlButtonModel.java122
-rw-r--r--qadevOOo/tests/java/ifc/awt/_UnoControlCheckBoxModel.java109
-rw-r--r--qadevOOo/tests/java/ifc/awt/_UnoControlComboBoxModel.java138
-rw-r--r--qadevOOo/tests/java/ifc/awt/_UnoControlContainerModel.java72
-rw-r--r--qadevOOo/tests/java/ifc/awt/_UnoControlCurrencyFieldModel.java133
-rw-r--r--qadevOOo/tests/java/ifc/awt/_UnoControlDateFieldModel.java173
-rw-r--r--qadevOOo/tests/java/ifc/awt/_UnoControlDialogElement.java35
-rw-r--r--qadevOOo/tests/java/ifc/awt/_UnoControlDialogModel.java87
-rw-r--r--qadevOOo/tests/java/ifc/awt/_UnoControlEditModel.java130
-rw-r--r--qadevOOo/tests/java/ifc/awt/_UnoControlFileControlModel.java117
-rw-r--r--qadevOOo/tests/java/ifc/awt/_UnoControlFixedLineModel.java76
-rw-r--r--qadevOOo/tests/java/ifc/awt/_UnoControlFixedTextModel.java111
-rw-r--r--qadevOOo/tests/java/ifc/awt/_UnoControlFormattedFieldModel.java251
-rw-r--r--qadevOOo/tests/java/ifc/awt/_UnoControlGroupBoxModel.java85
-rw-r--r--qadevOOo/tests/java/ifc/awt/_UnoControlImageControlModel.java109
-rw-r--r--qadevOOo/tests/java/ifc/awt/_UnoControlListBoxModel.java126
-rw-r--r--qadevOOo/tests/java/ifc/awt/_UnoControlModel.java35
-rw-r--r--qadevOOo/tests/java/ifc/awt/_UnoControlNumericFieldModel.java133
-rw-r--r--qadevOOo/tests/java/ifc/awt/_UnoControlPatternFieldModel.java116
-rw-r--r--qadevOOo/tests/java/ifc/awt/_UnoControlProgressBarModel.java90
-rw-r--r--qadevOOo/tests/java/ifc/awt/_UnoControlRadioButtonModel.java108
-rw-r--r--qadevOOo/tests/java/ifc/awt/_UnoControlScrollBarModel.java115
-rw-r--r--qadevOOo/tests/java/ifc/awt/_UnoControlSpinButtonModel.java71
-rw-r--r--qadevOOo/tests/java/ifc/awt/_UnoControlTimeFieldModel.java137
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XButton.java118
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XCheckBox.java150
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XComboBox.java285
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XControl.java222
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XControlContainer.java142
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XCurrencyField.java308
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XDataTransferProviderAccess.java135
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XDateField.java340
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XDialog.java158
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XFixedText.java120
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XImageConsumer.java144
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XImageProducer.java165
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XItemListener.java119
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XLayoutConstrains.java77
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XListBox.java513
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XMessageBoxFactory.java110
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XNumericField.java311
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XPatternField.java176
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XRadioButton.java151
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XScrollBar.java228
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XSpinField.java216
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XSpinValue.java220
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XSystemChildFactory.java40
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XTabController.java168
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XTabControllerModel.java166
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XTextComponent.java270
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XTextLayoutConstrains.java80
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XTextListener.java128
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XTimeField.java295
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XToolkit.java156
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XTopWindow.java206
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XUnoControlContainer.java181
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XUserInputInterception.java539
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XView.java143
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XWindow.java624
-rw-r--r--qadevOOo/tests/java/ifc/awt/tree/_TreeControlModel.java37
-rw-r--r--qadevOOo/tests/java/ifc/awt/tree/_XMutableTreeDataModel.java99
-rw-r--r--qadevOOo/tests/java/ifc/awt/tree/_XMutableTreeNode.java295
-rw-r--r--qadevOOo/tests/java/ifc/awt/tree/_XTreeControl.java671
-rw-r--r--qadevOOo/tests/java/ifc/awt/tree/_XTreeDataModel.java183
-rw-r--r--qadevOOo/tests/java/ifc/awt/tree/_XTreeNode.java261
65 files changed, 11629 insertions, 0 deletions
diff --git a/qadevOOo/tests/java/ifc/awt/_UnoControlButtonModel.java b/qadevOOo/tests/java/ifc/awt/_UnoControlButtonModel.java
new file mode 100644
index 000000000000..545995a641fe
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_UnoControlButtonModel.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.awt;
+
+import lib.MultiPropertyTest;
+
+/*
+* Testing <code>com.sun.star.awt.UnoControlButtonModel</code>
+* service properties :
+* <ul>
+* <li><code> BackgroundColor</code></li>
+* <li><code> DefaultButton</code></li>
+* <li><code> DefaultControl</code></li>
+* <li><code> Enabled</code></li>
+* <li><code> FontDescriptor</code></li>
+* <li><code> Label</code></li>
+* <li><code> Printable</code></li>
+* <li><code> Tabstop</code></li>
+* <li><code> TextColor</code></li>
+* </ul>
+* @see com.sun.star.awt.UnoControlButtonModel
+*/
+public class _UnoControlButtonModel extends MultiPropertyTest {
+
+ /**
+ * Redefined method returns value, that differs from property value.
+ */
+ protected PropertyTester ColorTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ if (util.ValueComparer.equalValue(oldValue, new Integer(17)))
+ return new Integer(25);
+ else
+ return new Integer(17);
+ }
+ };
+
+ /**
+ * Redefined method returns value, that differs from property value.
+ */
+ protected PropertyTester BoolTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ if (util.ValueComparer.equalValue(oldValue, new Boolean(true)))
+ return new Boolean(false);
+ else
+ return new Boolean(true);
+ }
+ };
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _BackgroundColor() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("BackgroundColor", ColorTester) ;
+ }
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _TextLineColor() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("TextLineColor", ColorTester) ;
+ }
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _TextColor() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("TextColor", ColorTester) ;
+ }
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _Tabstop() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("Tabstop", BoolTester) ;
+ }
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _PushButtonType() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("PushButtonType",
+ new Short((short)0), new Short((short)1));
+ }
+
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_UnoControlCheckBoxModel.java b/qadevOOo/tests/java/ifc/awt/_UnoControlCheckBoxModel.java
new file mode 100644
index 000000000000..115a416ba640
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_UnoControlCheckBoxModel.java
@@ -0,0 +1,109 @@
+/*************************************************************************
+ *
+ * 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.awt;
+
+import lib.MultiPropertyTest;
+import util.utils;
+
+/**
+* Testing <code>com.sun.star.awt.UnoControlCheckBoxModel</code>
+* service properties :
+* <ul>
+* <li><code> DefaultControl</code></li>
+* <li><code> Enabled</code></li>
+* <li><code> FontDescriptor</code></li>
+* <li><code> Label</code></li>
+* <li><code> Printable</code></li>
+* <li><code> State</code></li>
+* <li><code> Tabstop</code></li>
+* <li><code> TextColor</code></li>
+* <li><code> TriState</code></li>
+* </ul>
+* @see com.sun.star.awt.UnoControlCheckBoxModel
+*/
+public class _UnoControlCheckBoxModel extends MultiPropertyTest {
+
+ /**
+ * Redefined method returns value, that differs from property value.
+ */
+ protected PropertyTester ColorTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ if (util.ValueComparer.equalValue(oldValue, new Integer(17)))
+ return new Integer(25);
+ else
+ return new Integer(17);
+ }
+ };
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _BackgroundColor() {
+ testProperty("BackgroundColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(1234) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * 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 p, Object old) {
+ if (utils.isVoid(old)) return new Boolean(true) ;
+ else return null ;
+ }
+ }) ;
+ }
+
+ /**
+ * 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 p, Object old) {
+ if (utils.isVoid(old)) return new Integer(12345) ;
+ else return null ;
+ }
+ }) ;
+ }
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _TextLineColor() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("TextLineColor", ColorTester) ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_UnoControlComboBoxModel.java b/qadevOOo/tests/java/ifc/awt/_UnoControlComboBoxModel.java
new file mode 100644
index 000000000000..544c8c2ee6e1
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_UnoControlComboBoxModel.java
@@ -0,0 +1,138 @@
+/*************************************************************************
+ *
+ * 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.awt;
+
+import lib.MultiPropertyTest;
+import util.utils;
+
+/*
+* Testing <code>com.sun.star.awt.UnoControlComboBoxModel</code>
+* service properties :
+* <ul>
+* <li><code> Autocomplete</code></li>
+* <li><code> BackgroundColor</code></li>
+* <li><code> Border</code></li>
+* <li><code> DefaultControl</code></li>
+* <li><code> Dropdown</code></li>
+* <li><code> Enabled</code></li>
+* <li><code> FontDescriptor</code></li>
+* <li><code> LineCount</code></li>
+* <li><code> MaxTextLen</code></li>
+* <li><code> Printable</code></li>
+* <li><code> ReadOnly</code></li>
+* <li><code> StringItemList</code></li>
+* <li><code> Tabstop</code></li>
+* <li><code> Text</code></li>
+* <li><code> TextColor</code></li>
+* </ul>
+* @see com.sun.star.awt.UnoControlComboBoxModel
+*/
+public class _UnoControlComboBoxModel extends MultiPropertyTest {
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _BackgroundColor() {
+ testProperty("BackgroundColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(1234) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _BorderColor() {
+ testProperty("BorderColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(1234) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _TextColor() {
+ testProperty("TextColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(4321) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _Tabstop() {
+ testProperty("Tabstop", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Boolean(true) : null ;
+ }
+ }) ;
+ }
+
+ public void _Text() {
+ try {
+ oObj.setPropertyValue("MaxTextLen",new Short((short)0));
+ } catch (com.sun.star.beans.UnknownPropertyException ue) {
+ } catch (com.sun.star.beans.PropertyVetoException pe) {
+ } catch (com.sun.star.lang.IllegalArgumentException ie) {
+ } catch (com.sun.star.lang.WrappedTargetException we) {
+ }
+ testProperty("Text");
+ }
+
+ /**
+ * Redefined method returns value, that differs from property value.
+ */
+ protected PropertyTester ColorTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ if (util.ValueComparer.equalValue(oldValue, new Integer(17)))
+ return new Integer(25);
+ else
+ return new Integer(17);
+ }
+ };
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _TextLineColor() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("TextLineColor", ColorTester) ;
+ }
+
+} //EOF UnoControlComboBoxModel
+
diff --git a/qadevOOo/tests/java/ifc/awt/_UnoControlContainerModel.java b/qadevOOo/tests/java/ifc/awt/_UnoControlContainerModel.java
new file mode 100644
index 000000000000..8ae486c2d8e7
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_UnoControlContainerModel.java
@@ -0,0 +1,72 @@
+/*************************************************************************
+ *
+ * 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.awt;
+
+import lib.MultiPropertyTest;
+
+/*
+* Testing <code>com.sun.star.awt.UnoControlButtonModel</code>
+* service properties :
+* <ul>
+* <li><code> BackgroundColor</code></li>
+* <li><code> Enabled</code></li>
+* <li><code> Border</code></li>
+* <li><code> DefaultControl</code></li>
+* <li><code> Printable</code></li>
+* <li><code> Text</code></li>
+* <li><code> HelpText</code></li>
+* <li><code> HelpURL</code></li>
+* </ul>
+* After test completion object environment has to be recreated.
+* @see com.sun.star.awt.UnoControlContainerModel
+*/
+public class _UnoControlContainerModel extends MultiPropertyTest {
+
+ /**
+ * Redefined method returns value, that differs from property value.
+ */
+ protected PropertyTester ColorTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ if (util.ValueComparer.equalValue(oldValue, new Integer(17)))
+ return new Integer(25);
+ else
+ return new Integer(17);
+ }
+ };
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _BackgroundColor() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("BackgroundColor", ColorTester) ;
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_UnoControlCurrencyFieldModel.java b/qadevOOo/tests/java/ifc/awt/_UnoControlCurrencyFieldModel.java
new file mode 100644
index 000000000000..3638498a0152
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_UnoControlCurrencyFieldModel.java
@@ -0,0 +1,133 @@
+/*************************************************************************
+ *
+ * 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.awt;
+
+import lib.MultiPropertyTest;
+import util.utils;
+
+/**
+* Testing <code>com.sun.star.awt.UnoControlCurrencyFieldModel</code>
+* service properties :
+* <ul>
+* <li><code> BackgroundColor</code></li>
+* <li><code> Border</code></li>
+* <li><code> CurrencySymbol</code></li>
+* <li><code> DecimalAccuracy</code></li>
+* <li><code> DefaultControl</code></li>
+* <li><code> Enabled</code></li>
+* <li><code> FontDescriptor</code></li>
+* <li><code> ShowThousandsSeparator</code></li>
+* <li><code> Printable</code></li>
+* <li><code> ReadOnly</code></li>
+* <li><code> Spin</code></li>
+* <li><code> StrictFormat</code></li>
+* <li><code> Tabstop</code></li>
+* <li><code> TextColor</code></li>
+* <li><code> Value</code></li>
+* <li><code> ValueMax</code></li>
+* <li><code> ValueMin</code></li>
+* <li><code> ValueStep</code></li>
+* </ul>
+* @see com.sun.star.awt.UnoControlCurrencyFieldModel
+*/
+public class _UnoControlCurrencyFieldModel extends MultiPropertyTest {
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _BackgroundColor() {
+ testProperty("BackgroundColor", new PropertyTester() {
+ protected Object getNewValue(String prop, Object old) {
+ return utils.isVoid(old) ? new Integer(6543) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * 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 utils.isVoid(old) ? new Boolean(true) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _BorderColor() {
+ testProperty("BorderColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(1234) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * 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 utils.isVoid(old) ? new Integer(123) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _TextLineColor() {
+ testProperty("TextLineColor", new PropertyTester() {
+ protected Object getNewValue(String prop, Object old) {
+ return utils.isVoid(old) ? new Integer(123) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _Value() {
+ testProperty("Value", new PropertyTester() {
+ protected Object getNewValue(String prop, Object old) {
+ return utils.isVoid(old) ? new Double(777) :
+ super.getNewValue(prop, old) ;
+ }
+ }) ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_UnoControlDateFieldModel.java b/qadevOOo/tests/java/ifc/awt/_UnoControlDateFieldModel.java
new file mode 100644
index 000000000000..c0d17a541c46
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_UnoControlDateFieldModel.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.awt;
+
+import lib.MultiPropertyTest;
+import util.utils;
+
+/*
+* Testing <code>com.sun.star.awt.UnoControlDateFieldModel</code>
+* service properties :
+* <ul>
+* <li><code> BackgroundColor</code></li>
+* <li><code> Border</code></li>
+* <li><code> Date</code></li>
+* <li><code> DateMax</code></li>
+* <li><code> DateMin</code></li>
+* <li><code> DefaultControl</code></li>
+* <li><code> Enabled</code></li>
+* <li><code> DateFormat</code></li>
+* <li><code> FontDescriptor</code></li>
+* <li><code> Printable</code></li>
+* <li><code> ReadOnly</code></li>
+* <li><code> Spin</code></li>
+* <li><code> StrictFormat</code></li>
+* <li><code> Tabstop</code></li>
+* <li><code> TextColor</code></li>
+* </ul>
+* Almost all properties testing is automated by
+* <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.awt.UnoControlDateFieldModel
+*/
+public class _UnoControlDateFieldModel extends MultiPropertyTest {
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _BackgroundColor() {
+ testProperty("BackgroundColor", new PropertyTester() {
+ protected Object getNewValue(String prop, Object old) {
+ return utils.isVoid(old) ? new Integer(6543) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _BorderColor() {
+ testProperty("BorderColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(1234) : null ;
+ }
+ }) ;
+ }
+
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _Date() {
+ testProperty("Date", new PropertyTester() {
+ protected Object getNewValue(String prop, Object old) {
+ return utils.isVoid(old) ? new Integer(6543) :
+ 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 utils.isVoid(old) ? new Boolean(true) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * 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 utils.isVoid(old) ? new Integer(123) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * Redefined method returns value, that differs from property value.
+ */
+ protected PropertyTester ColorTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ if (util.ValueComparer.equalValue(oldValue, new Integer(17)))
+ return new Integer(25);
+ else
+ return new Integer(17);
+ }
+ };
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _TextLineColor() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("TextLineColor", ColorTester) ;
+ }
+
+ public void _DateShowCentury() {
+ boolean res = false;
+ try {
+ util.dbg.printPropertyInfo(oObj,"DateShowCentury",log);
+ Object oDsc = oObj.getPropertyValue("DateShowCentury");
+ Boolean dsc = null;
+ if (util.utils.isVoid(oDsc)) {
+ log.println("Property is void, set it to true");
+ dsc = new Boolean(true);
+ } else {
+ dsc = (Boolean) oDsc;
+ dsc = new Boolean(!dsc.booleanValue());
+ log.println("Setting property to "+dsc);
+ }
+ oObj.setPropertyValue("DateShowCentury",dsc);
+ Boolean getdsc = (Boolean) oObj.getPropertyValue("DateShowCentury");
+ log.println("Getting value "+getdsc);
+ res = dsc.equals(getdsc);
+ } catch (com.sun.star.beans.UnknownPropertyException upe) {
+ log.println("Don't know the Property 'DateShowCentury'");
+ } catch (com.sun.star.lang.WrappedTargetException wte) {
+ log.println("WrappedTargetException while getting Property 'DateShowCentury'");
+ } catch (com.sun.star.lang.IllegalArgumentException iae) {
+ log.println("IllegalArgumentException while getting Property 'DateShowCentury'");
+ } catch (com.sun.star.beans.PropertyVetoException pve) {
+ log.println("PropertyVetoException while getting Property 'DateShowCentury'");
+ }
+ tRes.tested("DateShowCentury",res);
+
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_UnoControlDialogElement.java b/qadevOOo/tests/java/ifc/awt/_UnoControlDialogElement.java
new file mode 100644
index 000000000000..f9746fb6210f
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_UnoControlDialogElement.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.awt;
+
+import lib.MultiPropertyTest;
+
+public class _UnoControlDialogElement extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_UnoControlDialogModel.java b/qadevOOo/tests/java/ifc/awt/_UnoControlDialogModel.java
new file mode 100644
index 000000000000..88b2ecafcb30
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_UnoControlDialogModel.java
@@ -0,0 +1,87 @@
+/*************************************************************************
+ *
+ * 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.awt;
+
+import lib.MultiPropertyTest;
+import util.utils;
+
+/**
+* Testing <code>com.sun.star.awt.UnoControlDialogModel</code>
+* service properties :
+* <ul>
+* <li><code> BackgroundColor</code></li>
+* <li><code> Border</code></li>
+* <li><code> DefaultControl</code></li>
+* <li><code> Enabled</code></li>
+* <li><code> FontDescriptor</code></li>
+* <li><code> Title</code></li>
+* <li><code> TextColor</code></li>
+* <li><code> Sizeable</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.awt.UnoControlDialogModel
+*/
+public class _UnoControlDialogModel extends MultiPropertyTest {
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _BackgroundColor() {
+ testProperty("BackgroundColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(4321) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _TextColor() {
+ testProperty("TextColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(4321) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _TextLineColor() {
+ testProperty("TextLineColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(4321) : null ;
+ }
+ }) ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_UnoControlEditModel.java b/qadevOOo/tests/java/ifc/awt/_UnoControlEditModel.java
new file mode 100644
index 000000000000..fee61c671be1
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_UnoControlEditModel.java
@@ -0,0 +1,130 @@
+/*************************************************************************
+ *
+ * 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.awt;
+
+import lib.MultiPropertyTest;
+import util.utils;
+
+/**
+* Testing <code>com.sun.star.awt.UnoControlEditModel</code>
+* service properties :
+* <ul>
+* <li><code> Align</code></li>
+* <li><code> BackgroundColor</code></li>
+* <li><code> Border</code></li>
+* <li><code> DefaultControl</code></li>
+* <li><code> EchoChar</code></li>
+* <li><code> Enabled</code></li>
+* <li><code> FontDescriptor</code></li>
+* <li><code> HardLineBreaks</code></li>
+* <li><code> HScroll</code></li>
+* <li><code> MaxTextLen</code></li>
+* <li><code> MultiLine</code></li>
+* <li><code> Printable</code></li>
+* <li><code> ReadOnly</code></li>
+* <li><code> Tabstop</code></li>
+* <li><code> Text</code></li>
+* <li><code> TextColor</code></li>
+* <li><code> VScroll</code></li>
+* </ul>
+* Almost all properties testing is automated by
+* <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.awt.UnoControlEditModel
+*/
+public class _UnoControlEditModel extends MultiPropertyTest {
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _BackgroundColor() {
+ testProperty("BackgroundColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(1234) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _BorderColor() {
+ testProperty("BorderColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(1234) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _TextColor() {
+ testProperty("TextColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(4321) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _Tabstop() {
+ testProperty("Tabstop", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Boolean(true) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * Redefined method returns value, that differs from property value.
+ */
+ protected PropertyTester ColorTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ if (util.ValueComparer.equalValue(oldValue, new Integer(17)))
+ return new Integer(25);
+ else
+ return new Integer(17);
+ }
+ };
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _TextLineColor() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("TextLineColor", ColorTester) ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_UnoControlFileControlModel.java b/qadevOOo/tests/java/ifc/awt/_UnoControlFileControlModel.java
new file mode 100644
index 000000000000..144ccd46a205
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_UnoControlFileControlModel.java
@@ -0,0 +1,117 @@
+/*************************************************************************
+ *
+ * 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.awt;
+
+import lib.MultiPropertyTest;
+import util.utils;
+
+/**
+* Testing <code>com.sun.star.awt.UnoControlFileControlModel</code>
+* service properties :
+* <ul>
+* <li><code> BackgroundColor</code></li>
+* <li><code> Border</code></li>
+* <li><code> HelpText</code></li>
+* <li><code> HelpURL</code></li>
+* <li><code> FontEmphsisMark</code></li>
+* <li><code> FontRelief</code></li>
+* <li><code> Enabled</code></li>
+* <li><code> FontDescriptor</code></li>
+* <li><code> Printable</code></li>
+* <li><code> Tabstop</code></li>
+* <li><code> Text</code></li>
+* <li><code> TextColor</code></li>
+* <li><code> TextLineColor</code></li>
+* </ul>
+* Almost all properties testing is automated by
+* <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.awt.UnoControlFileControlModel
+*/
+public class _UnoControlFileControlModel extends MultiPropertyTest {
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _BackgroundColor() {
+ testProperty("BackgroundColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(1234) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _BorderColor() {
+ testProperty("BorderColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(1234) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _TextColor() {
+ testProperty("TextColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(4321) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _TextLineColor() {
+ testProperty("TextLineColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(4321) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _Tabstop() {
+ testProperty("Tabstop", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Boolean(true) : null ;
+ }
+ }) ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_UnoControlFixedLineModel.java b/qadevOOo/tests/java/ifc/awt/_UnoControlFixedLineModel.java
new file mode 100644
index 000000000000..f9087e46cd41
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_UnoControlFixedLineModel.java
@@ -0,0 +1,76 @@
+/*************************************************************************
+ *
+ * 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.awt;
+
+import lib.MultiPropertyTest;
+import util.utils;
+
+/**
+* Testing <code>com.sun.star.awt.UnoControlFixedLineModel</code>
+* service properties :
+* <ul>
+* <li><code> DefaultControl</code></li>
+* <li><code> Enabled</code></li>
+* <li><code> FontDescriptor</code></li>
+* <li><code> HelpText</code></li>
+* <li><code> HelpURL</code></li>
+* <li><code> Label</code></li>
+* <li><code> Orientation</code></li>
+* <li><code> Printable</code></li>
+* <li><code> TextColor</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.awt.UnoControlFixedLineModel
+*/
+public class _UnoControlFixedLineModel extends MultiPropertyTest {
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _TextColor() {
+ testProperty("TextColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(4321) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _TextLineColor() {
+ testProperty("TextLineColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(4321) : null ;
+ }
+ }) ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_UnoControlFixedTextModel.java b/qadevOOo/tests/java/ifc/awt/_UnoControlFixedTextModel.java
new file mode 100644
index 000000000000..d66cfde5995a
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_UnoControlFixedTextModel.java
@@ -0,0 +1,111 @@
+/*************************************************************************
+ *
+ * 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.awt;
+
+import lib.MultiPropertyTest;
+import util.utils;
+
+/**
+* Testing <code>com.sun.star.awt.UnoControlFixedTextModel</code>
+* service properties :
+* <ul>
+* <li><code> Align</code></li>
+* <li><code> BackgroundColor</code></li>
+* <li><code> Border</code></li>
+* <li><code> DefaultControl</code></li>
+* <li><code> Enabled</code></li>
+* <li><code> FontDescriptor</code></li>
+* <li><code> Label</code></li>
+* <li><code> MultiLine</code></li>
+* <li><code> Printable</code></li>
+* <li><code> TextColor</code></li>
+* </ul>
+* Almost all properties testing is automated by
+* <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.awt.UnoControlFixedTextModel
+*/
+public class _UnoControlFixedTextModel extends MultiPropertyTest {
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _BackgroundColor() {
+ testProperty("BackgroundColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(1234) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _BorderColor() {
+ testProperty("BorderColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(1234) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _TextColor() {
+ testProperty("TextColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(4321) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * Redefined method returns value, that differs from property value.
+ */
+ protected PropertyTester ColorTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ if (util.ValueComparer.equalValue(oldValue, new Integer(17)))
+ return new Integer(25);
+ else
+ return new Integer(17);
+ }
+ };
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _TextLineColor() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("TextLineColor", ColorTester) ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_UnoControlFormattedFieldModel.java b/qadevOOo/tests/java/ifc/awt/_UnoControlFormattedFieldModel.java
new file mode 100644
index 000000000000..31bc7959a287
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_UnoControlFormattedFieldModel.java
@@ -0,0 +1,251 @@
+/*************************************************************************
+ *
+ * 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.awt;
+
+import lib.MultiPropertyTest;
+import util.utils;
+
+import com.sun.star.lang.XMultiServiceFactory;
+
+/**
+* Testing <code>com.sun.star.awt.UnoControlFormattedFieldModel</code>
+* service properties :
+* <ul>
+* <li><code> Align</code></li>
+* <li><code> BackgroundColor</code></li>
+* <li><code> Border</code></li>
+* <li><code> DefaultControl</code></li>
+* <li><code> EffectiveDefault</code></li>
+* <li><code> EffectiveMax</code></li>
+* <li><code> EffectiveMin</code></li>
+* <li><code> EffectiveValue</code></li>
+* <li><code> Enabled</code></li>
+* <li><code> FontDescriptor</code></li>
+* <li><code> FormatKey</code></li>
+* <li><code> FormatsSupplier</code></li>
+* <li><code> MaxTextLen</code></li>
+* <li><code> Printable</code></li>
+* <li><code> ReadOnly</code></li>
+* <li><code> Spin</code></li>
+* <li><code> StrictFormat</code></li>
+* <li><code> Tabstop</code></li>
+* <li><code> Text</code></li>
+* <li><code> TextColor</code></li>
+* <li><code> HelpText</code></li>
+* <li><code> HelpURL</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.awt.UnoControlFormattedFieldModel
+*/
+public class _UnoControlFormattedFieldModel extends MultiPropertyTest {
+
+ /**
+ * Redefined method must return a valid service name, that differs from
+ * name exists.
+ *
+ */
+ protected PropertyTester ControlTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ if (util.ValueComparer.equalValue(oldValue,
+ "com.sun.star.form.control.FormattedField"))
+ return "com.sun.star.awt.UnoControlFormattedField";
+ else
+ return "com.sun.star.form.control.FormattedField";
+ }
+ };
+
+ /**
+ * This property must contain a valid service name.
+ */
+ public void _DefaultControl() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("DefaultControl", ControlTester) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _BorderColor() {
+ testProperty("BorderColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(1234) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * 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 p, Object v) {
+ return utils.isVoid(v) ? new Integer(123) :
+ super.getNewValue(p,v) ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _TextLineColor() {
+ testProperty("TextLineColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object v) {
+ return utils.isVoid(v) ? new Integer(123) :
+ super.getNewValue(p,v) ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _BackgroundColor() {
+ testProperty("BackgroundColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object v) {
+ return utils.isVoid(v) ? new Integer(123) :
+ super.getNewValue(p,v) ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _EffectiveDefault() {
+ testProperty("EffectiveDefault", new Double(5.8),new Double(2.3)) ;
+ }
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _EffectiveValue() {
+ testProperty("EffectiveValue", new Double(5.8),new Double(2.3)) ;
+ }
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _EffectiveMax() {
+ testProperty("EffectiveMax", new PropertyTester() {
+ protected Object getNewValue(String p, Object v) {
+ return utils.isVoid(v) ? new Double(123.8) :
+ super.getNewValue(p,v) ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _FormatsSupplier() {
+ testProperty("FormatsSupplier", new PropertyTester() {
+ protected Object getNewValue(String p, Object v) {
+ Object newValue = null;
+ try {
+ newValue = ((XMultiServiceFactory)tParam.getMSF()).createInstance(
+ "com.sun.star.util.NumberFormatsSupplier");
+ } catch (com.sun.star.uno.Exception e) {}
+ return newValue;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _EffectiveMin() {
+ testProperty("EffectiveMin", new PropertyTester() {
+ protected Object getNewValue(String p, Object v) {
+ return utils.isVoid(v) ? new Double(0.1) :
+ super.getNewValue(p,v) ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _FormatKey() {
+ testProperty("FormatKey", new PropertyTester() {
+ protected Object getNewValue(String p, Object v) {
+ return utils.isVoid(v) ? new Integer(0) :
+ super.getNewValue(p,v) ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _StrictFromat() {
+ testProperty("StrictFromat", new PropertyTester() {
+ protected Object getNewValue(String p, Object v) {
+ return utils.isVoid(v) ? new Boolean(true) :
+ super.getNewValue(p,v) ;
+ }
+ }) ;
+ }
+
+ /**
+ * 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 p, Object v) {
+ return utils.isVoid(v) ? new Boolean(true) :
+ null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _Text() {
+ testProperty("Text", new PropertyTester() {
+ protected Object getNewValue(String p, Object v) {
+ return utils.isVoid(v) ? "UnoControlFormattedFieldModel" :
+ super.getNewValue(p,v) ;
+ }
+ }) ;
+ }
+}
diff --git a/qadevOOo/tests/java/ifc/awt/_UnoControlGroupBoxModel.java b/qadevOOo/tests/java/ifc/awt/_UnoControlGroupBoxModel.java
new file mode 100644
index 000000000000..8b4183aa88fe
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_UnoControlGroupBoxModel.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.awt;
+
+import lib.MultiPropertyTest;
+import util.utils;
+
+/**
+* Testing <code>com.sun.star.awt.UnoControlGroupBoxModel</code>
+* service properties :
+* <ul>
+* <li><code> DefaultControl</code></li>
+* <li><code> Enabled</code></li>
+* <li><code> FontDescriptor</code></li>
+* <li><code> Label</code></li>
+* <li><code> Printable</code></li>
+* <li><code> TextColor</code></li>
+* </ul>
+* Almost all properties testing is automated by
+* <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.awt.UnoControlGroupBoxModel
+*/
+public class _UnoControlGroupBoxModel extends MultiPropertyTest {
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _TextColor() {
+ testProperty("TextColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(4321) :
+ super.getNewValue(p, old) ;
+ }
+ }) ;
+ }
+
+ /**
+ * Redefined method returns value, that differs from property value.
+ */
+ protected PropertyTester ColorTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ if (util.ValueComparer.equalValue(oldValue, new Integer(17)))
+ return new Integer(25);
+ else
+ return new Integer(17);
+ }
+ };
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _TextLineColor() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("TextLineColor", ColorTester) ;
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_UnoControlImageControlModel.java b/qadevOOo/tests/java/ifc/awt/_UnoControlImageControlModel.java
new file mode 100644
index 000000000000..4955cce1dc1a
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_UnoControlImageControlModel.java
@@ -0,0 +1,109 @@
+/*************************************************************************
+ *
+ * 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.awt;
+
+import lib.MultiPropertyTest;
+import util.utils;
+
+/**
+* Testing <code>com.sun.star.awt.UnoControlImageControlModel</code>
+* service properties :
+* <ul>
+* <li><code> BackgroundColor </code></li>
+* <li><code> Border </code></li>
+* <li><code> DefaultControl </code></li>
+* <li><code> Enabled </code></li>
+* <li><code> ImageURL </code></li>
+* <li><code> Printable </code></li>
+* </ul>
+* Almost all properties testing is automated by
+* <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.awt.UnoControlImageControlModel
+*/
+public class _UnoControlImageControlModel extends MultiPropertyTest {
+
+ /**
+ * Custom <code>PropertyTester</code> used in <code>ImageURL</code> test.
+ */
+ protected PropertyTester URLTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue)
+ throws java.lang.IllegalArgumentException {
+ if (oldValue.equals(util.utils.getFullTestURL("space-metal.jpg")))
+ return util.utils.getFullTestURL("crazy-blue.jpg");
+ else
+ return util.utils.getFullTestURL("space-metal.jpg");
+ }
+ } ;
+
+ /**
+ * Test changes one image URL onto another.
+ */
+ public void _ImageURL() {
+ testProperty("ImageURL", URLTester) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _BackgroundColor() {
+ testProperty("BackgroundColor", new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ return utils.isVoid(oldValue) ? new Integer(8945) :
+ super.getNewValue(propName, oldValue) ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _BorderColor() {
+ testProperty("BorderColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(1234) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * 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 p, Object v) {
+ return utils.isVoid(v) ? new Boolean(true) :
+ null ;
+ }
+ }) ;
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_UnoControlListBoxModel.java b/qadevOOo/tests/java/ifc/awt/_UnoControlListBoxModel.java
new file mode 100644
index 000000000000..97c4bebde37e
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_UnoControlListBoxModel.java
@@ -0,0 +1,126 @@
+/*************************************************************************
+ *
+ * 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.awt;
+
+import lib.MultiPropertyTest;
+import util.utils;
+
+/**
+* Testing <code>com.sun.star.awt.UnoControlListBoxModel</code>
+* service properties :
+* <ul>
+* <li><code> BackgroundColor</code></li>
+* <li><code> Border</code></li>
+* <li><code> DefaultControl</code></li>
+* <li><code> Dropdown</code></li>
+* <li><code> Enabled</code></li>
+* <li><code> FontDescriptor</code></li>
+* <li><code> LineCount</code></li>
+* <li><code> MultiSelection</code></li>
+* <li><code> Printable</code></li>
+* <li><code> SelectedItems</code></li>
+* <li><code> StringItemList</code></li>
+* <li><code> Tabstop</code></li>
+* <li><code> TextColor</code></li>
+* </ul>
+* Almost all properties testing is automated by
+* <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.awt.UnoControlListBoxModel
+*/
+public class _UnoControlListBoxModel extends MultiPropertyTest {
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _BackgroundColor() {
+ testProperty("BackgroundColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(1234) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _BorderColor() {
+ testProperty("BorderColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(1234) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _TextColor() {
+ testProperty("TextColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(4321) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _Tabstop() {
+ testProperty("Tabstop", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Boolean(true) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * Redefined method returns value, that differs from property value.
+ */
+ protected PropertyTester ColorTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ if (util.ValueComparer.equalValue(oldValue, new Integer(17)))
+ return new Integer(25);
+ else
+ return new Integer(17);
+ }
+ };
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _TextLineColor() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("TextLineColor", ColorTester) ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_UnoControlModel.java b/qadevOOo/tests/java/ifc/awt/_UnoControlModel.java
new file mode 100644
index 000000000000..63dc6009d75d
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_UnoControlModel.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.awt;
+
+import lib.MultiPropertyTest;
+
+public class _UnoControlModel extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_UnoControlNumericFieldModel.java b/qadevOOo/tests/java/ifc/awt/_UnoControlNumericFieldModel.java
new file mode 100644
index 000000000000..4ea032cce8a5
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_UnoControlNumericFieldModel.java
@@ -0,0 +1,133 @@
+/*************************************************************************
+ *
+ * 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.awt;
+
+import lib.MultiPropertyTest;
+import util.utils;
+
+/**
+* Testing <code>com.sun.star.awt.UnoControlNumericFieldModel</code>
+* service properties :
+* <ul>
+* <li><code> BackgroundColor</code></li>
+* <li><code> Border</code></li>
+* <li><code> DecimalAccuracy</code></li>
+* <li><code> DefaultControl</code></li>
+* <li><code> Enabled</code></li>
+* <li><code> FontDescriptor</code></li>
+* <li><code> ShowThousandsSeparator</code></li>
+* <li><code> Printable</code></li>
+* <li><code> ReadOnly</code></li>
+* <li><code> Spin</code></li>
+* <li><code> StrictFormat</code></li>
+* <li><code> Tabstop</code></li>
+* <li><code> TextColor</code></li>
+* <li><code> Value</code></li>
+* <li><code> ValueMax</code></li>
+* <li><code> ValueMin</code></li>
+* <li><code> ValueStep</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.awt.UnoControlNumericFieldModel
+*/
+public class _UnoControlNumericFieldModel extends MultiPropertyTest {
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _BackgroundColor() {
+ testProperty("BackgroundColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(1234) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _BorderColor() {
+ testProperty("BorderColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(1234) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _TextColor() {
+ testProperty("TextColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(4321) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _TextLineColor() {
+ testProperty("TextLineColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(4321) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _Tabstop() {
+ testProperty("Tabstop", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Boolean(true) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _Value() {
+ testProperty("Value", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Double(234.89) :
+ super.getNewValue(p, old) ;
+ }
+ }) ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_UnoControlPatternFieldModel.java b/qadevOOo/tests/java/ifc/awt/_UnoControlPatternFieldModel.java
new file mode 100644
index 000000000000..2fa75c03ba53
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_UnoControlPatternFieldModel.java
@@ -0,0 +1,116 @@
+/*************************************************************************
+ *
+ * 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.awt;
+
+import lib.MultiPropertyTest;
+import util.utils;
+
+/**
+* Testing <code>com.sun.star.awt.UnoControlPatternFieldModel</code>
+* service properties :
+* <ul>
+* <li><code> BackgroundColor</code></li>
+* <li><code> Border</code></li>
+* <li><code> DefaultControl</code></li>
+* <li><code> EditMask</code></li>
+* <li><code> Enabled</code></li>
+* <li><code> FontDescriptor</code></li>
+* <li><code> LiteralMask</code></li>
+* <li><code> Printable</code></li>
+* <li><code> ReadOnly</code></li>
+* <li><code> StrictFormat</code></li>
+* <li><code> Tabstop</code></li>
+* <li><code> Text</code></li>
+* <li><code> TextColor</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.awt.UnoControlPatternFieldModel
+*/
+public class _UnoControlPatternFieldModel extends MultiPropertyTest {
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _BackgroundColor() {
+ testProperty("BackgroundColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(1234) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _BorderColor() {
+ testProperty("BorderColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(1234) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _TextColor() {
+ testProperty("TextColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(4321) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _TextLineColor() {
+ testProperty("TextLineColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(4321) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _Tabstop() {
+ testProperty("Tabstop", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Boolean(true) : null ;
+ }
+ }) ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_UnoControlProgressBarModel.java b/qadevOOo/tests/java/ifc/awt/_UnoControlProgressBarModel.java
new file mode 100644
index 000000000000..54bdb7195f16
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_UnoControlProgressBarModel.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.awt;
+
+import lib.MultiPropertyTest;
+import util.utils;
+
+/**
+* Testing <code>com.sun.star.awt.UnoControlProgressBarModel</code>
+* service properties :
+* <ul>
+* <li><code> BackgroundColor</code></li>
+* <li><code> Border</code></li>
+* <li><code> DefaultControl</code></li>
+* <li><code> Enabled</code></li>
+* <li><code> FillColor</code></li>
+* <li><code> HelpText</code></li>
+* <li><code> HelpURL</code></li>
+* <li><code> Printable</code></li>
+* <li><code> ProgressValue</code></li>
+* <li><code> ProgressValueMax</code></li>
+* <li><code> ProgressValueMin</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.awt.UnoControlProgressBarModel
+*/
+public class _UnoControlProgressBarModel extends MultiPropertyTest {
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _BackgroundColor() {
+ testProperty("BackgroundColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(1234) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _FillColor() {
+ testProperty("FillColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(4321) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _ProgressValue() {
+ testProperty("ProgressValue", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(10) : null ;
+ }
+ }) ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_UnoControlRadioButtonModel.java b/qadevOOo/tests/java/ifc/awt/_UnoControlRadioButtonModel.java
new file mode 100644
index 000000000000..b7b54c05addf
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_UnoControlRadioButtonModel.java
@@ -0,0 +1,108 @@
+/*************************************************************************
+ *
+ * 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.awt;
+
+import lib.MultiPropertyTest;
+import util.utils;
+
+/**
+* Testing <code>com.sun.star.awt.UnoControlRadioButtonModel</code>
+* service properties :
+* <ul>
+* <li><code> DefaultControl</code></li>
+* <li><code> Enabled</code></li>
+* <li><code> FontDescriptor</code></li>
+* <li><code> Label</code></li>
+* <li><code> Printable</code></li>
+* <li><code> State</code></li>
+* <li><code> Tabstop</code></li>
+* <li><code> TextColor</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.awt.UnoControlRadioButtonModel
+*/
+public class _UnoControlRadioButtonModel extends MultiPropertyTest {
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _TextColor() {
+ testProperty("TextColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(4321) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _Tabstop() {
+ testProperty("Tabstop", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Boolean(true) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * Redefined method returns value, that differs from property value.
+ */
+ protected PropertyTester ColorTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ if (util.ValueComparer.equalValue(oldValue, new Integer(17)))
+ return new Integer(25);
+ else
+ return new Integer(17);
+ }
+ };
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _TextLineColor() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("TextLineColor", ColorTester) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _BackgroundColor() {
+ testProperty("BackgroundColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(1234) : null ;
+ }
+ }) ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_UnoControlScrollBarModel.java b/qadevOOo/tests/java/ifc/awt/_UnoControlScrollBarModel.java
new file mode 100644
index 000000000000..824c6f0185d8
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_UnoControlScrollBarModel.java
@@ -0,0 +1,115 @@
+/*************************************************************************
+ *
+ * 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.awt;
+
+import lib.MultiPropertyTest;
+import util.utils;
+
+/**
+* Testing <code>com.sun.star.awt.UnoControlScrollBarModel</code>
+* service properties :
+* <ul>
+* <li><code> BlockIncrement</code></li>
+* <li><code> Border</code></li>
+* <li><code> DefaultControl</code></li>
+* <li><code> Enabled</code></li>
+* <li><code> HelpText</code></li>
+* <li><code> HelpURL</code></li>
+* <li><code> LineIncrement</code></li>
+* <li><code> Orientation</code></li>
+* <li><code> Printable</code></li>
+* <li><code> ScrollValue</code></li>
+* <li><code> ScrollValueMax</code></li>
+* <li><code> VisibleSize</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.awt.UnoControlScrollBarModel
+*/
+public class _UnoControlScrollBarModel extends MultiPropertyTest {
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _BackgroundColor() {
+ testProperty("BackgroundColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(32768) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _BorderColor() {
+ testProperty("BorderColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(1234) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _SymbolColor() {
+ testProperty("SymbolColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(65324) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _ScrollValue() {
+ testProperty("ScrollValue", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(10) : new Integer(15) ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _VisibleSize() {
+ testProperty("VisibleSize", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(10) : null ;
+ }
+ }) ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_UnoControlSpinButtonModel.java b/qadevOOo/tests/java/ifc/awt/_UnoControlSpinButtonModel.java
new file mode 100644
index 000000000000..a0489db5cdf6
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_UnoControlSpinButtonModel.java
@@ -0,0 +1,71 @@
+/*************************************************************************
+ *
+ * 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.awt;
+
+import lib.MultiPropertyTest;
+import util.utils;
+
+public class _UnoControlSpinButtonModel extends MultiPropertyTest {
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _BackgroundColor() {
+ testProperty("BackgroundColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(32768) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _BorderColor() {
+ testProperty("BorderColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(1234) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _SymbolColor() {
+ testProperty("SymbolColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(65324) : null ;
+ }
+ }) ;
+ }
+
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/ifc/awt/_UnoControlTimeFieldModel.java b/qadevOOo/tests/java/ifc/awt/_UnoControlTimeFieldModel.java
new file mode 100644
index 000000000000..1e1a0b78d058
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_UnoControlTimeFieldModel.java
@@ -0,0 +1,137 @@
+/*************************************************************************
+ *
+ * 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.awt;
+
+import lib.MultiPropertyTest;
+import util.utils;
+
+
+/**
+* Testing <code>com.sun.star.awt.UnoControlTimeFieldModel</code>
+* service properties :
+* <ul>
+* <li><code> BackgroundColor</code></li>
+* <li><code> Border</code></li>
+* <li><code> HelpText</code></li>
+* <li><code> HelpURL</code></li>
+* <li><code> FontEmphasisMark</code></li>
+* <li><code> FontRelief</code></li>
+* <li><code> Enabled</code></li>
+* <li><code> TimeFormat</code></li>
+* <li><code> FontDescriptor</code></li>
+* <li><code> Printable</code></li>
+* <li><code> ReadOnly</code></li>
+* <li><code> Spin</code></li>
+* <li><code> StrictFormat</code></li>
+* <li><code> Tabstop</code></li>
+* <li><code> TextColor</code></li>
+* <li><code> TextLineColor</code></li>
+* <li><code> Time</code></li>
+* <li><code> TimeFormat</code></li>
+* <li><code> TimeMax</code></li>
+* <li><code> TimeMin</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.awt.UnoControlTimeFieldModel
+*/
+public class _UnoControlTimeFieldModel extends MultiPropertyTest {
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _BackgroundColor() {
+ testProperty("BackgroundColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(1234) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _BorderColor() {
+ testProperty("BorderColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(1234) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _TextColor() {
+ testProperty("TextColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(4321) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _TextLineColor() {
+ testProperty("TextLineColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(4321) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _Time() {
+ testProperty("Time", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(4321) :
+ super.getNewValue(p, old) ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _Tabstop() {
+ testProperty("Tabstop", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Boolean(true) : null ;
+ }
+ }) ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_XButton.java b/qadevOOo/tests/java/ifc/awt/_XButton.java
new file mode 100644
index 000000000000..fa2168f64fdb
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XButton.java
@@ -0,0 +1,118 @@
+/*************************************************************************
+ *
+ * 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.awt;
+
+
+import lib.MultiMethodTest;
+
+import com.sun.star.awt.XButton;
+
+/**
+* Testing <code>com.sun.star.awt.XButton</code>
+* interface methods :
+* <ul>
+* <li><code> addActionListener()</code></li>
+* <li><code> removeActionListener()</code></li>
+* <li><code> setLabel()</code></li>
+* <li><code> setActionCommand()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.awt.XButton
+*/
+public class _XButton extends MultiMethodTest {
+
+ public XButton oObj = null;
+
+ /**
+ * Listener implementation which sets flags on appropriate method calls
+ */
+ protected class TestActionListener implements com.sun.star.awt.XActionListener {
+ public boolean disposingCalled = false ;
+ public boolean actionPerformedCalled = false ;
+
+ public void disposing(com.sun.star.lang.EventObject e) {
+ disposingCalled = true ;
+ }
+
+ public void actionPerformed(com.sun.star.awt.ActionEvent e) {
+ actionPerformedCalled = true ;
+ }
+
+ }
+
+ TestActionListener listener = new TestActionListener() ;
+
+ /**
+ * !!! Can be checked only interactively !!!
+ */
+ public void _addActionListener() {
+
+ boolean result = true ;
+ oObj.addActionListener(listener) ;
+
+ tRes.tested("addActionListener()", result) ;
+ }
+
+ /**
+ * !!! Can be checked only interactively !!!
+ */
+ public void _removeActionListener() {
+
+ boolean result = true ;
+ oObj.removeActionListener(listener) ;
+
+ tRes.tested("removeActionListener()", result) ;
+ }
+
+ /**
+ * Just sets some text for label. <p>
+ * Has <b> OK </b> status if no runtime exceptions occurred
+ */
+ public void _setLabel() {
+
+ boolean result = true ;
+ oObj.setLabel("XButton Label") ;
+
+ tRes.tested("setLabel()", result) ;
+ }
+
+ /**
+ * Just sets some command for button. <p>
+ * Has <b> OK </b> status if no runtime exceptions occurred
+ */
+ public void _setActionCommand() {
+
+ boolean result = true ;
+ oObj.setActionCommand("XButtonComand") ;
+
+ tRes.tested("setActionCommand()", result) ;
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/awt/_XCheckBox.java b/qadevOOo/tests/java/ifc/awt/_XCheckBox.java
new file mode 100644
index 000000000000..e8307ed8f8bb
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XCheckBox.java
@@ -0,0 +1,150 @@
+/*************************************************************************
+ *
+ * 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.awt;
+
+
+import lib.MultiMethodTest;
+
+import com.sun.star.awt.XCheckBox;
+
+/**
+* Testing <code>com.sun.star.awt.XCheckBox</code>
+* interface methods :
+* <ul>
+* <li><code> addItemListener()</code></li>
+* <li><code> removeItemListener()</code></li>
+* <li><code> getState()</code></li>
+* <li><code> setState()</code></li>
+* <li><code> setLabel()</code></li>
+* <li><code> enableTriState()</code></li>
+* </ul> <p>
+*
+* @see com.sun.star.awt.XCheckBox
+*/
+public class _XCheckBox extends MultiMethodTest {
+
+ public XCheckBox oObj = null;
+
+ /**
+ * Listener implementation which sets flags on appropriate method calls
+ */
+ protected class TestItemListener implements com.sun.star.awt.XItemListener {
+ public boolean disposingCalled = false ;
+ public boolean itemStateChangedCalled = false ;
+
+ public void disposing(com.sun.star.lang.EventObject e) {
+ disposingCalled = true ;
+ }
+
+ public void itemStateChanged(com.sun.star.awt.ItemEvent e) {
+ itemStateChangedCalled = true ;
+ }
+
+ }
+ TestItemListener listener = new TestItemListener() ;
+ short state = -1 ;
+
+ /**
+ * !!! Can be checked only interactively !!!
+ */
+ public void _addItemListener() {
+
+ boolean result = true ;
+ oObj.addItemListener(listener) ;
+ tRes.tested("addItemListener()", result) ;
+ }
+
+ /**
+ * !!! Can be checked only interactively !!!
+ */
+ public void _removeItemListener() {
+
+ boolean result = true ;
+ oObj.removeItemListener(listener) ;
+
+ tRes.tested("removeItemListener()", result) ;
+ }
+
+ /**
+ * Just retrieves current state and stores it. <p>
+ * Has <b>OK</b> status if no runtime exceptions occurs.
+ */
+ public void _getState() {
+
+ boolean result = true ;
+ state = oObj.getState() ;
+
+ tRes.tested("getState()", result) ;
+ }
+
+ /**
+ * Sets a new value and then checks get value. <p>
+ * Has <b>OK</b> status if set and get values are equal. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getState </code> </li>
+ * </ul>
+ */
+ public void _setState() {
+ requiredMethod("getState()") ;
+
+ boolean result = true ;
+ short newState = state == 0 ? (short)1 : (short)0 ;
+ oObj.setState(newState) ;
+ result = newState == oObj.getState() ;
+
+ tRes.tested("setState()", result) ;
+ }
+
+ /**
+ * Just sets some text for label. <p>
+ * Has <b>OK</b> status if no runtime exceptions occurs.
+ */
+ public void _setLabel() {
+
+ boolean result = true ;
+ oObj.setLabel("XCheckBox test") ;
+
+ tRes.tested("setLabel()", result) ;
+ }
+
+ /**
+ * Just enables tristate. <p>
+ * Has <b>OK</b> status if no runtime exceptions occurs.
+ */
+ public void _enableTriState() {
+
+ boolean result = true ;
+ oObj.enableTriState(true) ;
+
+ tRes.tested("enableTriState()", result) ;
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/awt/_XComboBox.java b/qadevOOo/tests/java/ifc/awt/_XComboBox.java
new file mode 100644
index 000000000000..c76ed69eb581
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XComboBox.java
@@ -0,0 +1,285 @@
+/*************************************************************************
+ *
+ * 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.awt;
+
+import lib.MultiMethodTest;
+import lib.Status;
+
+import com.sun.star.awt.XComboBox;
+
+/**
+* Testing <code>com.sun.star.awt.XComboBox</code>
+* interface methods :
+* <ul>
+* <li><code> addItemListener()</code></li>
+* <li><code> removeItemListener()</code></li>
+* <li><code> addActionListener()</code></li>
+* <li><code> removeActionListener()</code></li>
+* <li><code> addItem()</code></li>
+* <li><code> addItems()</code></li>
+* <li><code> removeItems()</code></li>
+* <li><code> getItemCount()</code></li>
+* <li><code> getItem()</code></li>
+* <li><code> getItems()</code></li>
+* <li><code> getDropDownLineCount()</code></li>
+* <li><code> setDropDownLineCount()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.awt.XComboBox
+*/
+public class _XComboBox extends MultiMethodTest {
+
+ public XComboBox oObj = null;
+
+ /**
+ * Listener implementation which sets flags on appropriate method calls
+ */
+ protected class TestActionListener
+ implements com.sun.star.awt.XActionListener {
+ public boolean disposingCalled = false;
+ public boolean actionPerformedCalled = false;
+
+ public void disposing(com.sun.star.lang.EventObject e) {
+ disposingCalled = true;
+ }
+
+ public void actionPerformed(com.sun.star.awt.ActionEvent e) {
+ actionPerformedCalled = true;
+ }
+
+ }
+
+ /**
+ * Listener implementation which sets flags on appropriate method calls
+ */
+ protected class TestItemListener
+ implements com.sun.star.awt.XItemListener {
+ public boolean disposingCalled = false;
+ public boolean itemStateChangedCalled = false;
+
+ public void disposing(com.sun.star.lang.EventObject e) {
+ disposingCalled = true;
+ }
+
+ public void itemStateChanged(com.sun.star.awt.ItemEvent e) {
+ itemStateChangedCalled = true;
+ }
+
+ }
+ private TestActionListener actionListener = new TestActionListener();
+ private TestItemListener itemListener = new TestItemListener();
+ short lineCount = 0;
+ short itemCount = 0;
+
+ /**
+ * !!! Can be checked only interactively !!!
+ */
+ public void _addItemListener() {
+
+ oObj.addItemListener(itemListener);
+
+ tRes.tested("addItemListener()", Status.skipped(true));
+ }
+
+ /**
+ * !!! Can be checked only interactively !!!
+ */
+ public void _removeItemListener() {
+ requiredMethod("addItemListener()");
+
+ oObj.removeItemListener(itemListener);
+
+ tRes.tested("removeItemListener()", Status.skipped(true));
+ }
+
+ /**
+ * !!! Can be checked only interactively !!!
+ */
+ public void _addActionListener() {
+
+ oObj.addActionListener(actionListener);
+
+ tRes.tested("addActionListener()", Status.skipped(true));
+ }
+
+ /**
+ * !!! Can be checked only interactively !!!
+ */
+ public void _removeActionListener() {
+ requiredMethod("addActionListener()");
+
+ oObj.removeActionListener(actionListener);
+
+ tRes.tested("removeActionListener()", Status.skipped(true));
+ }
+
+ /**
+ * Adds one item to the last position and check the number of
+ * items after addition. <p>
+ * Has <b>OK</b> status if the number of items increased by 1.<p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getItemCount </code> </li>
+ * </ul>
+ */
+ public void _addItem() {
+ requiredMethod("getItemCount()");
+
+ boolean result = true;
+ oObj.addItem("Item1", itemCount);
+ result = oObj.getItemCount() == itemCount + 1;
+
+ tRes.tested("addItem()", result);
+ }
+
+ /**
+ * Adds one two items to the last position and check the number of
+ * items after addition. <p>
+ * Has <b>OK</b> status if the number of items increased by 2.<p>
+ * The following method tests are to be executed before :
+ * <ul>
+ * <li> <code> addItem </code> </li>
+ * </ul>
+ */
+ public void _addItems() {
+ executeMethod("addItem()");
+
+ boolean result = true;
+ short oldCnt = oObj.getItemCount();
+ oObj.addItems(new String[] { "Item2", "Item3" }, oldCnt);
+ result = oObj.getItemCount() == oldCnt + 2;
+
+ tRes.tested("addItems()", result);
+ }
+
+ /**
+ * Gets the current number of items and tries to remove them all
+ * then checks number of items. <p>
+ * Has <b>OK</b> status if no items remains. <p>
+ * The following method tests are to be executed before :
+ * <ul>
+ * <li> <code> getItems </code> </li>
+ * <li> <code> getItem </code> </li>
+ * </ul>
+ */
+ public void _removeItems() {
+ executeMethod("getItems()");
+ executeMethod("getItem()");
+
+ boolean result = true;
+ short oldCnt = oObj.getItemCount();
+ oObj.removeItems((short) 0, oldCnt);
+ result = oObj.getItemCount() == 0;
+
+ tRes.tested("removeItems()", result);
+ }
+
+ /**
+ * Just retrieves current number of items and stores it. <p>
+ * Has <b>OK</b> status if the count is not less than 0.
+ */
+ public void _getItemCount() {
+
+ itemCount = oObj.getItemCount();
+
+ tRes.tested("getItemCount()", itemCount >= 0);
+ }
+
+ /**
+ * After <code>addItem</code> and <code>addItems</code> methods
+ * test the following items must exist {..., "Item1", "Item2", "Item3"}
+ * Retrieves the item from the position which was ititially the last.<p>
+ * Has <b>OK</b> status if the "Item1" was retrieved. <p>
+ * The following method tests are to be executed before :
+ * <ul>
+ * <li> <code> addItems </code> </li>
+ * </ul>
+ */
+ public void _getItem() {
+ requiredMethod("addItems()");
+
+ boolean result = true;
+ String item = oObj.getItem(itemCount);
+ result = "Item1".equals(item);
+
+ tRes.tested("getItem()", result);
+ }
+
+ /**
+ * After <code>addItem</code> and <code>addItems</code> methods
+ * test the following items must exist {..., "Item1", "Item2", "Item3"}
+ * Retrieves all items. <p>
+ * Has <b>OK</b> status if the last three items retrieved are
+ * "Item1", "Item2" and "Item3". <p>
+ * The following method tests are to be executed before :
+ * <ul>
+ * <li> <code> addItems </code> </li>
+ * </ul>
+ */
+ public void _getItems() {
+ requiredMethod("addItems()");
+
+ boolean result = true;
+ String[] items = oObj.getItems();
+ for (int i = itemCount; i < (itemCount + 3); i++) {
+ result &= ("Item" + (i + 1)).equals(items[i]);
+ }
+
+ tRes.tested("getItems()", result);
+ }
+
+ /**
+ * Gets line count and stores it. <p>
+ * Has <b>OK</b> status if no runtime exceptions occurred.
+ */
+ public void _getDropDownLineCount() {
+
+ boolean result = true;
+ lineCount = oObj.getDropDownLineCount();
+
+ tRes.tested("getDropDownLineCount()", result);
+ }
+
+ /**
+ * Sets a new value and then checks get value. <p>
+ * Has <b>OK</b> status if set and get values are equal. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getDropDownLineCount </code> </li>
+ * </ul>
+ */
+ public void _setDropDownLineCount() {
+ requiredMethod("getDropDownLineCount()");
+
+ boolean result = true;
+ oObj.setDropDownLineCount((short) (lineCount + 1));
+ result = oObj.getDropDownLineCount() == lineCount + 1;
+
+ tRes.tested("setDropDownLineCount()", result);
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/ifc/awt/_XControl.java b/qadevOOo/tests/java/ifc/awt/_XControl.java
new file mode 100644
index 000000000000..fbf10ca97271
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XControl.java
@@ -0,0 +1,222 @@
+/*************************************************************************
+ *
+ * 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.awt;
+
+import lib.MultiMethodTest;
+
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XView;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.uno.XInterface;
+
+/**
+* Testing <code>com.sun.star.awt.XControl</code>
+* interface methods:
+* <ul>
+* <li><code> setContext() </code></li>
+* <li><code> getContext() </code></li>
+* <li><code> createPeer() </code></li>
+* <li><code> getPeer() </code></li>
+* <li><code> setModel() </code></li>
+* <li><code> getModel() </code></li>
+* <li><code> setDesignMode() </code></li>
+* <li><code> isDesignMode() </code></li>
+* <li><code> isTransparent() </code></li>
+* <li><code> getView() </code></li>
+* </ul><p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'CONTEXT'</code> (of type <code>XInterface</code>):
+* used as a parameter to setContext() and for testing getContext().</li>
+* <li> <code>'WINPEER'</code> (of type <code>XWindowPeer</code>):
+* used as a parameter to createPeer() and for testing getPeer()</li>
+* <li> <code>'TOOLKIT'</code> (of type <code>XToolkit</code>):
+* used as a parameter to createPeer()</li>
+* <li> <code>'MODEL'</code> (of type <code>XControlModel</code>):
+* used as a parameter to setModel() and for testing getModel()</li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.awt.XControl
+*/
+public class _XControl extends MultiMethodTest {
+ public XControl oObj = null;
+ public XControlModel aModel = null;
+ public boolean desMode;
+
+ /**
+ * After test calls the method, the Context is set to a corresponding
+ * object relation.<p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ */
+ public void _setContext() {
+ XInterface cont = (XInterface) tEnv.getObjRelation("CONTEXT");
+ oObj.setContext(cont);
+ tRes.tested("setContext()",true);
+ }
+
+ /**
+ * After test calls the method, the Context is gotten and compared
+ * with object relation 'CONTEXT'.<p>
+ * Has <b> OK </b> status if get value is equals to value set before.<p>
+ * The following method tests are to be completed successfully before:
+ * <ul>
+ * <li> <code> setContext() </code> : set Context to a corresponding
+ * object relation</li>
+ * </ul>
+ */
+ public void _getContext() {
+ requiredMethod("setContext()");
+ XInterface cont = (XInterface) tEnv.getObjRelation("CONTEXT");
+ Object get = oObj.getContext();
+ boolean res = get.equals(cont);
+ if (!res) {
+ log.println("!!! Error: getting: "+get.toString());
+ log.println("!!! expected: "+cont.toString());
+ }
+ tRes.tested("getContext()",res);
+ }
+
+
+ /**
+ * The objects needed to create peer are obtained
+ * from corresponding object relations, then the peer is created.
+ * <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown.
+ */
+ public void _createPeer() {
+ XWindowPeer the_win = (XWindowPeer) tEnv.getObjRelation("WINPEER");
+ XToolkit the_kit = (XToolkit) tEnv.getObjRelation("TOOLKIT");
+ oObj.createPeer(the_kit,the_win);
+ tRes.tested("createPeer()",true);
+ }
+
+ /**
+ * Test calls the method. Then the the object ralation 'WINPEER' is
+ * obtained, and compared with the peer, gotten from (XControl) oObj
+ * variable.<p>
+ * Has <b> OK </b> status if peer gotten isn't null
+ * The following method tests are to be completed successfully before :
+ */
+ public void _getPeer() {
+ requiredMethod("createPeer()");
+ boolean res = false;
+ XWindowPeer get = oObj.getPeer();
+ if (get == null) {
+ log.println("The method 'getPeer' returns NULL");
+ } else {
+ res = true;
+ }
+ tRes.tested("getPeer()",res);
+ }
+
+
+ /**
+ * At first current model is obtained and saved to variable aModel.
+ * Then object relation 'MODEL' is gotten and test calls the method. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown.
+ */
+ public void _setModel() {
+ aModel = oObj.getModel();
+ XControlModel the_model = (XControlModel) tEnv.getObjRelation("MODEL");
+ oObj.setModel(the_model);
+ tRes.tested("setModel()",true);
+ }
+
+ /**
+ * Test calls the method, then object relation 'MODEL' is gotten and
+ * compared with object returned by the method. Then previously saved
+ * value of model (aModel) restored to (XControl) oObj<p>
+ * Has <b> OK </b> status if models set and get are equal. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setModel() </code> : setting model from corresponding
+ * object relation </li>
+ * </ul>
+ */
+ public void _getModel() {
+ requiredMethod("setModel()");
+ XControlModel the_model = (XControlModel) tEnv.getObjRelation("MODEL");
+ XControlModel get = oObj.getModel();
+ boolean res = (get.equals(the_model));
+ if (!res) {
+ log.println("getting: "+get.toString());
+ log.println("expected: "+the_model.toString());
+ }
+ if (aModel != null) {
+ oObj.setModel(aModel);
+ }
+ tRes.tested("getModel()",res);
+ }
+
+ /**
+ * Test calls the method. Then mode is checked using isDesignMode().<p>
+ * Has <b> OK </b> status if mode is swithed.
+ */
+ public void _setDesignMode() {
+ desMode = oObj.isDesignMode();
+ oObj.setDesignMode(!desMode);
+ tRes.tested("setDesignMode()",oObj.isDesignMode() == !desMode);
+ }
+
+ /**
+ * The mode is changed and result is checked.<p>
+ * Has <b> OK </b> status if the mode changed successfully.
+ */
+ public void _isDesignMode() {
+ requiredMethod("setDesignMode()");
+ oObj.setDesignMode(desMode);
+ tRes.tested("isDesignMode()", oObj.isDesignMode() == desMode);
+ }
+
+ /**
+ * Test calls the method.<p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ */
+ public void _isTransparent() {
+ boolean isT = oObj.isTransparent();
+ tRes.tested("isTransparent()",true );
+ }
+
+ /**
+ * Test calls the method.<p>
+ * Has <b> OK </b> status if the method returns not null. <p>
+ */
+ public void _getView() {
+ XView the_view = oObj.getView();
+ tRes.tested("getView()", the_view != null);
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/awt/_XControlContainer.java b/qadevOOo/tests/java/ifc/awt/_XControlContainer.java
new file mode 100644
index 000000000000..831df3461041
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XControlContainer.java
@@ -0,0 +1,142 @@
+/*************************************************************************
+ *
+ * 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.awt;
+
+import lib.MultiMethodTest;
+
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlContainer;
+
+/**
+* Testing <code>com.sun.star.awt.XControlContainer</code>
+* interface methods:
+* <ul>
+* <li><code> setStatusText() </code></li>
+* <li><code> addControl() </code></li>
+* <li><code> removeControl() </code></li>
+* <li><code> getControl() </code></li>
+* <li><code> getControls() </code></li>
+* </ul><p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'CONTROL1'</code> (of type <code>XControl</code>):
+* used as a parameter to addControl(), getControl() and removeControl()</li>
+* <li> <code>'CONTROL2'</code> (of type <code>XControl</code>):
+* used as a parameter to addControl(), getControl() and removeControl()</li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.awt.XControlContainer
+*/
+public class _XControlContainer extends MultiMethodTest {
+ public XControlContainer oObj = null;
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown.
+ */
+ public void _setStatusText() {
+ oObj.setStatusText("testing XControlContainer::setStatusText(String)");
+ tRes.tested("setStatusText()",true);
+ }
+
+ /**
+ * Test calls the method twice - two controls gotten from object relations
+ * 'CONTROL1' and 'CONTROL2' added to container.<p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown.
+ */
+ public void _addControl() {
+ oObj.addControl("CONTROL1", (XControl)tEnv.getObjRelation("CONTROL1"));
+ oObj.addControl("CONTROL2", (XControl)tEnv.getObjRelation("CONTROL2"));
+ tRes.tested("addControl()",true);
+ }
+
+ /**
+ * Test calls the method with object relation 'CONTROL1' as a
+ * parameter. Then control gotten from container is checked, and if returned
+ * value is null then another control 'CONTROL2' is removed from container,
+ * otherwise returned value of method test is 'false'.<p>
+ * Has <b> OK </b> status if control is removed successfully.<p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addControl() </code> : adds control to a container </li>
+ * <li> <code> getControl() </code> : gets control from container </li>
+ * <li> <code> getControls() </code> : gets controls from container</li>
+ * </ul>
+ */
+ public void _removeControl() {
+ boolean result = true;
+
+ requiredMethod("addControl()");
+ requiredMethod("getControl()");
+ requiredMethod("getControls()");
+ oObj.removeControl( (XControl) tEnv.getObjRelation("CONTROL1") );
+ XControl ctrl = oObj.getControl("CONTROL1");
+ if (ctrl != null) {
+ result = false;
+ log.println("'removeControl()' fails; Control still exists");
+ } else {
+ oObj.removeControl( (XControl) tEnv.getObjRelation("CONTROL2") );
+ }
+ tRes.tested("removeControl()", result);
+ }
+
+ /**
+ * Test calls the method with 'CONTROL1' as a parameter, then we just
+ * compare returned object and object relation 'CONTROL1'.<p>
+ * Has <b> OK </b> status if value returned by the method is equal to
+ * a corresponding object relation.<p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addControl() </code> : adds control to a container </li>
+ * </ul>
+ */
+ public void _getControl() {
+ requiredMethod("addControl()");
+ XControl xCtrlComp = oObj.getControl("CONTROL1");
+ XControl xCl = (XControl) tEnv.getObjRelation("CONTROL1");
+ tRes.tested("getControl()", xCtrlComp.equals(xCl));
+ }
+
+ /**
+ * Test calls the method, then returned value is checked.<p>
+ * Has <b> OK </b> status if returned array consists of at least two
+ * elements.<p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addControl() </code> : adds control to a container </li>
+ * </ul>
+ */
+ public void _getControls() {
+ requiredMethod("addControl()");
+ XControl[] xCtrls = oObj.getControls();
+ tRes.tested("getControls()",xCtrls.length >= 2);
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_XCurrencyField.java b/qadevOOo/tests/java/ifc/awt/_XCurrencyField.java
new file mode 100644
index 000000000000..3c7504043d4b
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XCurrencyField.java
@@ -0,0 +1,308 @@
+/*************************************************************************
+ *
+ * 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.awt;
+
+import lib.MultiMethodTest;
+
+import com.sun.star.awt.XCurrencyField;
+
+/**
+* Testing <code>com.sun.star.awt.XCurrencyField</code>
+* interface methods :
+* <ul>
+* <li><code> setValue()</code></li>
+* <li><code> getValue()</code></li>
+* <li><code> setMin()</code></li>
+* <li><code> getMin()</code></li>
+* <li><code> setMax()</code></li>
+* <li><code> getMax()</code></li>
+* <li><code> setFirst()</code></li>
+* <li><code> getFirst()</code></li>
+* <li><code> setLast()</code></li>
+* <li><code> getLast()</code></li>
+* <li><code> setSpinSize()</code></li>
+* <li><code> getSpinSize()</code></li>
+* <li><code> setDecimalDigits()</code></li>
+* <li><code> getDecimalDigits()</code></li>
+* <li><code> setStrictFormat()</code></li>
+* <li><code> isStrictFormat()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.awt.XCurrencyField
+*/
+public class _XCurrencyField extends MultiMethodTest {
+
+ public XCurrencyField oObj = null;
+ private double val = 0;
+ private double min = 0;
+ private double max = 0;
+ private double first = 0;
+ private double last = 0;
+ private double spin = 0;
+ private short digits = 0;
+ private boolean strict = true;
+
+ /**
+ * Sets value changed and then compares it to get value. <p>
+ * Has <b>OK</b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getValue </code> </li>
+ * </ul>
+ */
+ public void _setValue() {
+ requiredMethod("getValue()");
+
+ oObj.setValue(val + 1.1);
+
+ tRes.tested("setValue()", oObj.getValue() == val + 1.1);
+ }
+
+ /**
+ * Just calls the method and stores value returned. <p>
+ * Has <b>OK</b> status if no runtime exceptions occurred.
+ */
+ public void _getValue() {
+ val = oObj.getValue();
+
+ tRes.tested("getValue()", true);
+ }
+
+ /**
+ * Sets minimal value changed and then compares it to get value. <p>
+ * Has <b>OK</b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getMin </code> </li>
+ * </ul>
+ */
+ public void _setMin() {
+ requiredMethod("getMin()");
+
+ oObj.setMin(min + 1.1);
+
+ tRes.tested("setMin()", oObj.getMin() == min + 1.1);
+ }
+
+ /**
+ * Just calls the method and stores value returned. <p>
+ * Has <b>OK</b> status if no runtime exceptions occurred.
+ */
+ public void _getMin() {
+
+ boolean result = true;
+ min = oObj.getMin();
+
+ tRes.tested("getMin()", result);
+ }
+
+ /**
+ * Sets maximal value changed and then compares it to get value. <p>
+ * Has <b>OK</b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getMax </code> </li>
+ * </ul>
+ */
+ public void _setMax() {
+ requiredMethod("getMax()");
+
+ boolean result = true;
+ oObj.setMax(max + 1.1);
+ result = oObj.getMax() == max + 1.1;
+
+ tRes.tested("setMax()", result);
+ }
+
+ /**
+ * Just calls the method and stores value returned. <p>
+ * Has <b>OK</b> status if no runtime exceptions occurred.
+ */
+ public void _getMax() {
+
+ boolean result = true;
+ max = oObj.getMax();
+
+ tRes.tested("getMax()", result);
+ }
+
+ /**
+ * Sets value changed and then compares it to get value. <p>
+ * Has <b>OK</b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getFirst </code> </li>
+ * </ul>
+ */
+ public void _setFirst() {
+ requiredMethod("getFirst()");
+
+ boolean result = true;
+ oObj.setFirst(first + 1.1);
+ double ret = oObj.getFirst();
+ result = ret == first + 1.1;
+
+ tRes.tested("setFirst()", result);
+ }
+
+ /**
+ * Just calls the method and stores value returned. <p>
+ * Has <b>OK</b> status if no runtime exceptions occurred.
+ */
+ public void _getFirst() {
+
+ boolean result = true;
+ first = oObj.getFirst();
+
+ tRes.tested("getFirst()", result);
+ }
+
+ /**
+ * Sets value changed and then compares it to get value. <p>
+ * Has <b>OK</b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getLast </code> </li>
+ * </ul>
+ */
+ public void _setLast() {
+ requiredMethod("getLast()");
+
+ boolean result = true;
+ oObj.setLast(last + 1.1);
+ double ret = oObj.getLast();
+
+ result = ret == last + 1.1;
+
+ tRes.tested("setLast()", result);
+ }
+
+ /**
+ * Just calls the method and stores value returned. <p>
+ * Has <b>OK</b> status if no runtime exceptions occurred.
+ */
+ public void _getLast() {
+
+ boolean result = true;
+ last = oObj.getLast();
+
+ tRes.tested("getLast()", result);
+ }
+
+ /**
+ * Sets value changed and then compares it to get value. <p>
+ * Has <b>OK</b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getSpinSize </code> </li>
+ * </ul>
+ */
+ public void _setSpinSize() {
+ requiredMethod("getSpinSize()");
+
+ boolean result = true;
+ oObj.setSpinSize(spin + 1.1);
+ result = oObj.getSpinSize() == spin + 1.1;
+
+ tRes.tested("setSpinSize()", result);
+ }
+
+ /**
+ * Just calls the method and stores value returned. <p>
+ * Has <b>OK</b> status if no runtime exceptions occurred.
+ */
+ public void _getSpinSize() {
+
+ boolean result = true;
+ spin = oObj.getSpinSize();
+
+ tRes.tested("getSpinSize()", result);
+ }
+
+ /**
+ * Sets value changed and then compares it to get value. <p>
+ * Has <b>OK</b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getDecimalDigits </code> </li>
+ * </ul>
+ */
+ public void _setDecimalDigits() {
+ requiredMethod("getDecimalDigits()");
+
+ boolean result = true;
+ oObj.setDecimalDigits((short) (digits + 1));
+
+ short res = oObj.getDecimalDigits();
+ result = res == ((short) digits + 1);
+
+ tRes.tested("setDecimalDigits()", result);
+ }
+
+ /**
+ * Just calls the method and stores value returned. <p>
+ * Has <b>OK</b> status if no runtime exceptions occurred.
+ */
+ public void _getDecimalDigits() {
+
+ boolean result = true;
+ digits = oObj.getDecimalDigits();
+
+ tRes.tested("getDecimalDigits()", result);
+ }
+
+ /**
+ * Sets value changed and then compares it to get value. <p>
+ * Has <b>OK</b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> isStrictFormat </code> </li>
+ * </ul>
+ */
+ public void _setStrictFormat() {
+ requiredMethod("isStrictFormat()");
+
+ boolean result = true;
+ oObj.setStrictFormat(!strict);
+ result = oObj.isStrictFormat() == !strict;
+
+ tRes.tested("setStrictFormat()", result);
+ }
+
+ /**
+ * Just calls the method and stores value returned. <p>
+ * Has <b>OK</b> status if no runtime exceptions occurred.
+ */
+ public void _isStrictFormat() {
+
+ boolean result = true;
+ strict = oObj.isStrictFormat();
+
+ tRes.tested("isStrictFormat()", result);
+ }
+}
diff --git a/qadevOOo/tests/java/ifc/awt/_XDataTransferProviderAccess.java b/qadevOOo/tests/java/ifc/awt/_XDataTransferProviderAccess.java
new file mode 100644
index 000000000000..909723b8a429
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XDataTransferProviderAccess.java
@@ -0,0 +1,135 @@
+/*************************************************************************
+ *
+ * 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.awt;
+
+
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+import com.sun.star.awt.XDataTransferProviderAccess;
+import com.sun.star.awt.XWindow;
+import com.sun.star.datatransfer.clipboard.XClipboard;
+import com.sun.star.datatransfer.dnd.XDragGestureRecognizer;
+import com.sun.star.datatransfer.dnd.XDragSource;
+import com.sun.star.datatransfer.dnd.XDropTarget;
+
+/**
+* Testing <code>com.sun.star.awt.XDataTransferProviderAccess</code>
+* interface methods :
+* <ul>
+* <li><code> getDragGestureRecognizer()</code></li>
+* <li><code> getDragSource()</code></li>
+* <li><code> getDropTarget()</code></li>
+* <li><code> getClipboard()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'XDataTransferProviderAccess.XWindow'</code>
+* (of type <code>com.sun.star.awt.XWindow</code>):
+* this window must created by the Toolkit tested. </li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.awt.XDataTransferProviderAccess
+*/
+public class _XDataTransferProviderAccess extends MultiMethodTest {
+
+ public XDataTransferProviderAccess oObj = null;
+ protected XWindow win = null ;
+
+ /**
+ * Retrieves object relations.
+ * @throws StatusException If one of relations not found.
+ */
+ public void before() {
+ win = (XWindow) tEnv.getObjRelation
+ ("XDataTransferProviderAccess.XWindow") ;
+ if (win == null) throw new StatusException(Status.failed
+ ("Relation not found")) ;
+ }
+
+ /**
+ * Tries to get gesture recognizer for the window passed as
+ * relation. <p>
+ * Has <b> OK </b> status if not <code>null</code> value returned
+ */
+ public void _getDragGestureRecognizer() {
+
+ boolean result = true ;
+ XDragGestureRecognizer rec = oObj.getDragGestureRecognizer(win) ;
+
+ result = rec != null ;
+
+ tRes.tested("getDragGestureRecognizer()", result) ;
+ }
+
+ /**
+ * Tries to get drag source for the window passed as
+ * relation. <p>
+ * Has <b> OK </b> status if not <code>null</code> value returned
+ */
+ public void _getDragSource() {
+
+ boolean result = true ;
+ XDragSource src = oObj.getDragSource(win) ;
+
+ result = src != null ;
+
+ tRes.tested("getDragSource()", result) ;
+ }
+
+ /**
+ * Tries to get drop target for the window passed as
+ * relation. <p>
+ * Has <b> OK </b> status if not <code>null</code> value returned
+ */
+ public void _getDropTarget() {
+
+ boolean result = true ;
+ XDropTarget targ = oObj.getDropTarget(win) ;
+
+ result = targ != null ;
+
+ tRes.tested("getDropTarget()", result) ;
+ }
+
+ /**
+ * Tries to obtain default clipboard.<p>
+ * Has <b> OK </b> status if not <code>null</code> value returned.
+ */
+ public void _getClipboard() {
+
+ boolean result = true ;
+ XClipboard cb = oObj.getClipboard("") ;
+
+ result = cb != null ;
+
+ tRes.tested("getClipboard()", result) ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_XDateField.java b/qadevOOo/tests/java/ifc/awt/_XDateField.java
new file mode 100644
index 000000000000..1aacf65de587
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XDateField.java
@@ -0,0 +1,340 @@
+/*************************************************************************
+ *
+ * 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.awt;
+
+
+import lib.MultiMethodTest;
+
+import com.sun.star.awt.XDateField;
+
+/**
+* Testing <code>com.sun.star.awt.XDateField</code>
+* interface methods :
+* <ul>
+* <li><code> setDate()</code></li>
+* <li><code> getDate()</code></li>
+* <li><code> setMin()</code></li>
+* <li><code> getMin()</code></li>
+* <li><code> setMax()</code></li>
+* <li><code> getMax()</code></li>
+* <li><code> setFirst()</code></li>
+* <li><code> getFirst()</code></li>
+* <li><code> setLast()</code></li>
+* <li><code> getLast()</code></li>
+* <li><code> setLongFormat()</code></li>
+* <li><code> isLongFormat()</code></li>
+* <li><code> setEmpty()</code></li>
+* <li><code> isEmpty()</code></li>
+* <li><code> setStrictFormat()</code></li>
+* <li><code> isStrictFormat()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.awt.XDateField
+*/
+public class _XDateField extends MultiMethodTest {
+
+ public XDateField oObj = null;
+
+ private boolean strict = false ;
+ private boolean longFormat = false ;
+
+ /**
+ * Sets a new value and checks if it was correctly set. <p>
+ * Has <b> OK </b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getTime </code> </li>
+ * </ul>
+ */
+ public void _setDate() {
+ requiredMethod("getDate()") ;
+
+ boolean result = true ;
+ oObj.setDate(19000101) ;
+
+ result = oObj.getDate() == 19000101 ;
+
+ if (! result ) {
+ System.out.println("getDate: "+oObj.getDate()+" , expected 19000101");
+ }
+
+ tRes.tested("setDate()", result) ;
+ }
+
+ /**
+ * Gets the current value. <p>
+ * Has <b> OK </b> status if no runtime exceptions occurred
+ */
+ public void _getDate() {
+
+ boolean result = true ;
+ oObj.getDate() ;
+
+ tRes.tested("getDate()", result) ;
+ }
+
+ /**
+ * Sets a new value and checks if it was correctly set. <p>
+ * Has <b> OK </b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getMin </code> </li>
+ * </ul>
+ */
+ public void _setMin() {
+
+ boolean result = true ;
+ oObj.setMin(4978) ;
+
+ result = oObj.getMin() == 4978 ;
+
+ tRes.tested("setMin()", result) ;
+ }
+
+ /**
+ * Gets the current value. <p>
+ * Has <b> OK </b> status if no runtime exceptions occurred
+ */
+ public void _getMin() {
+
+ boolean result = true ;
+ oObj.getMin() ;
+
+ tRes.tested("getMin()", result) ;
+ }
+
+ /**
+ * Sets a new value and checks if it was correctly set. <p>
+ * Has <b> OK </b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getMax </code> </li>
+ * </ul>
+ */
+ public void _setMax() {
+
+ boolean result = true ;
+ oObj.setMax(27856) ;
+
+ result = oObj.getMax() == 27856 ;
+
+ tRes.tested("setMax()", result) ;
+ }
+
+ /**
+ * Gets the current value. <p>
+ * Has <b> OK </b> status if no runtime exceptions occurred
+ */
+ public void _getMax() {
+
+ boolean result = true ;
+ oObj.getMax() ;
+
+ tRes.tested("getMax()", result) ;
+ }
+
+ /**
+ * Sets a new value and checks if it was correctly set. <p>
+ * Has <b> OK </b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getFirst </code> </li>
+ * </ul>
+ */
+ public void _setFirst() {
+
+ boolean result = true ;
+ oObj.setFirst(5118) ;
+
+ result = oObj.getFirst() == 5118 ;
+
+ if (!result) {
+ log.println("Set to " + 5118 + " but returned " + oObj.getFirst()) ;
+ }
+
+ tRes.tested("setFirst()", result) ;
+ }
+
+ /**
+ * Gets the current value. <p>
+ * Has <b> OK </b> status if no runtime exceptions occurred
+ */
+ public void _getFirst() {
+
+ boolean result = true ;
+ int val = oObj.getFirst() ;
+
+ log.println("getFirst() = " + val) ;
+
+ tRes.tested("getFirst()", result) ;
+ }
+
+ /**
+ * Sets a new value and checks if it was correctly set. <p>
+ * Has <b> OK </b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getLast </code> </li>
+ * </ul>
+ */
+ public void _setLast() {
+
+ boolean result = true ;
+ oObj.setLast(23450) ;
+
+ result = oObj.getLast() == 23450 ;
+
+ if (!result) {
+ log.println("Set to " + 23450 + " but returned " + oObj.getLast()) ;
+ }
+
+ tRes.tested("setLast()", result) ;
+ }
+
+ /**
+ * Gets the current value. <p>
+ * Has <b> OK </b> status if no runtime exceptions occurred
+ */
+ public void _getLast() {
+
+ boolean result = true ;
+ int val = oObj.getLast() ;
+
+ log.println("getLast() = " + val) ;
+
+ tRes.tested("getLast()", result) ;
+ }
+
+ /**
+ * Sets the value to empty. <p>
+ * Has <b> OK </b> status if no runtime exceptions occurred
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setTime </code> : value must be not empty </li>
+ * </ul>
+ */
+ public void _setEmpty() {
+ requiredMethod("setDate()") ;
+
+ boolean result = true ;
+ oObj.setEmpty() ;
+
+ tRes.tested("setEmpty()", result) ;
+ }
+
+ /**
+ * Checks if the field is empty. <p>
+ * Has <b> OK </b> status if the value is empty.<p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setEmpty() </code> </li>
+ * </ul>
+ */
+ public void _isEmpty() {
+ requiredMethod("setEmpty()") ;
+
+ boolean result = true ;
+ result = oObj.isEmpty() ;
+
+ tRes.tested("isEmpty()", result) ;
+ }
+
+ /**
+ * Checks strict state. <p>
+ * Has <b> OK </b> status if strict format is properly set.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> isStrictFormat </code> </li>
+ * </ul>
+ */
+ public void _setStrictFormat() {
+ requiredMethod("isStrictFormat()") ;
+
+ boolean result = true ;
+ oObj.setStrictFormat(!strict) ;
+
+ result = oObj.isStrictFormat() == !strict ;
+
+ if (!result) {
+ log.println("Was '" + strict + "', set to '" + !strict +
+ "' but returned '" + oObj.isStrictFormat() + "'") ;
+ }
+
+ tRes.tested("setStrictFormat()", result) ;
+ }
+
+ /**
+ * Gets strict state and stores it. <p>
+ * Has <b> OK </b> status if no runtime exceptions occurred.
+ */
+ public void _isStrictFormat() {
+
+ boolean result = true ;
+ strict = oObj.isStrictFormat() ;
+
+ tRes.tested("isStrictFormat()", result) ;
+ }
+
+
+ /**
+ * Checks long format state. <p>
+ * Has <b> OK </b> status if long format is properly set.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> isLongFormat </code> </li>
+ * </ul>
+ */
+ public void _setLongFormat() {
+
+ boolean result = true ;
+ oObj.setLongFormat(!longFormat) ;
+
+ result = oObj.isLongFormat() == !longFormat ;
+
+ if (!result) {
+ log.println("Was '" + longFormat + "', set to '" + !longFormat +
+ "' but returned '" + oObj.isLongFormat() + "'") ;
+ }
+
+ tRes.tested("setLongFormat()", result) ;
+ }
+
+ /**
+ * Gets long format state and stores it. <p>
+ * Has <b> OK </b> status if no runtime exceptions occurred.
+ */
+ public void _isLongFormat() {
+
+ boolean result = true ;
+ longFormat = oObj.isLongFormat() ;
+
+ tRes.tested("isLongFormat()", result) ;
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/awt/_XDialog.java b/qadevOOo/tests/java/ifc/awt/_XDialog.java
new file mode 100644
index 000000000000..33893c01e66c
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XDialog.java
@@ -0,0 +1,158 @@
+/*************************************************************************
+ *
+ * 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.awt;
+
+import lib.MultiMethodTest;
+
+import com.sun.star.awt.XDialog;
+
+/**
+* Testing <code>com.sun.star.awt.XDialog</code>
+* interface methods :
+* <ul>
+* <li><code> setTitle()</code></li>
+* <li><code> getTitle()</code></li>
+* <li><code> execute()</code></li>
+* <li><code> endExecute()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* After test completion object environment has to be recreated.
+* @see com.sun.star.awt.XDialog
+*/
+public class _XDialog extends MultiMethodTest {
+
+ public XDialog oObj = null;
+
+ /**
+ * As <code>execute()</code> method is a blocking call,
+ * then it must be executed in a separate thread. This
+ * thread class just call <code>execute</code> method
+ * of tested object.
+ */
+ protected Thread execThread = new Thread(
+ new Runnable() {
+ public void run() {
+ oObj.execute() ;
+ }
+ }) ;
+
+ /**
+ * Sets the title to some string. <p>
+ * Has <b>OK</b> status if no runtime exceptions occurs.
+ */
+ public void _setTitle() {
+
+ oObj.setTitle("XDialog test") ;
+
+ tRes.tested("setTitle()", true) ;
+ }
+
+ /**
+ * Gets the title and compares it to the value set in
+ * <code>setTitle</code> method test. <p>
+ * Has <b>OK</b> status is set/get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setTitle </code> </li>
+ * </ul>
+ */
+ public void _getTitle() {
+ requiredMethod("setTitle()") ;
+
+ tRes.tested("getTitle()",
+ "XDialog test".equals(oObj.getTitle())) ;
+ }
+
+ /**
+ * Starts the execution of dialog in a separate thread.
+ * As this call is blocking then the thread execution
+ * must not be finished. <p>
+ * Has <b>OK</b> status if thread wasn't finished and
+ * no exceptions occurred.
+ */
+ public void _execute() {
+ boolean result = true ;
+
+ log.println("Starting execute() thread ...") ;
+ execThread.start() ;
+
+ try {
+ execThread.join(200) ;
+ } catch (InterruptedException e) {
+ log.println("execute() thread was interrupted") ;
+ result = false ;
+ }
+ result &= execThread.isAlive() ;
+
+ tRes.tested("execute()", result) ;
+ }
+
+ /**
+ * Calls the method and checks if the execution thread
+ * where <code>execute()</code> method is running was
+ * finished. If <code>execute</code> method didn't return
+ * and still running then thread interrupted. <p>
+ * Has <b>OK</b> status if <code>execute</code> method
+ * call successfully retured.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> execute </code> </li>
+ * </ul>
+ */
+ public void _endExecute() {
+ requiredMethod("execute()") ;
+
+ boolean result = true ;
+
+ oObj.endExecute() ;
+
+ try {
+ execThread.join(200) ;
+ } catch (InterruptedException e) {
+ log.println("execute() thread was interrupted") ;
+ result = false ;
+ }
+
+ if (execThread.isAlive()) {
+ execThread.interrupt() ;
+ }
+
+ result &= !execThread.isAlive() ;
+
+ tRes.tested("endExecute()", result) ;
+ }
+
+ /**
+ * Disposes object environment.
+ */
+ public void after() {
+ disposeEnvironment() ;
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/awt/_XFixedText.java b/qadevOOo/tests/java/ifc/awt/_XFixedText.java
new file mode 100644
index 000000000000..7b9bcf790ecf
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XFixedText.java
@@ -0,0 +1,120 @@
+/*************************************************************************
+ *
+ * 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.awt;
+
+
+import lib.MultiMethodTest;
+
+import com.sun.star.awt.TextAlign;
+import com.sun.star.awt.XFixedText;
+
+/**
+* Testing <code>com.sun.star.awt.XFixedText</code>
+* interface methods :
+* <ul>
+* <li><code> setText()</code></li>
+* <li><code> getText()</code></li>
+* <li><code> setAlignment()</code></li>
+* <li><code> getAlignment()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.awt.XFixedText
+*/
+public class _XFixedText extends MultiMethodTest {
+
+ public XFixedText oObj = null;
+ private String text = null ;
+ private int align = -1 ;
+
+ /**
+ * Sets value changed and then compares it to get value. <p>
+ * Has <b>OK</b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getText </code> </li>
+ * </ul>
+ */
+ public void _setText() {
+ requiredMethod("getText()") ;
+
+ boolean result = true ;
+ oObj.setText(text + "_") ;
+ result = (text+"_").equals(oObj.getText()) ;
+
+ tRes.tested("setText()", result) ;
+ }
+
+ /**
+ * Just calls the method and stores value returned. <p>
+ * Has <b>OK</b> status if no runtime exceptions occurred.
+ */
+ public void _getText() {
+
+ boolean result = true ;
+ text = oObj.getText() ;
+ if (util.utils.isVoid(text)) text = "XFixedText";
+
+ tRes.tested("getText()", result) ;
+ }
+
+ /**
+ * Sets value changed and then compares it to get value. <p>
+ * Has <b>OK</b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getAlignment </code> </li>
+ * </ul>
+ */
+ public void _setAlignment() {
+ requiredMethod("getAlignment()") ;
+
+ boolean result = true ;
+ int newAlign = align ==
+ TextAlign.CENTER ? TextAlign.LEFT : TextAlign.CENTER ;
+ oObj.setAlignment((short)newAlign) ;
+ short getAlign = oObj.getAlignment() ;
+ result = newAlign == getAlign ;
+
+ tRes.tested("setAlignment()", result) ;
+ }
+
+ /**
+ * Just calls the method and stores value returned. <p>
+ * Has <b>OK</b> status if no runtime exceptions occurred.
+ */
+ public void _getAlignment() {
+
+ boolean result = true ;
+ align = oObj.getAlignment() ;
+
+ tRes.tested("getAlignment()", result) ;
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/awt/_XImageConsumer.java b/qadevOOo/tests/java/ifc/awt/_XImageConsumer.java
new file mode 100644
index 000000000000..531da240a4df
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XImageConsumer.java
@@ -0,0 +1,144 @@
+/*************************************************************************
+ *
+ * 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.awt;
+
+
+import lib.MultiMethodTest;
+
+import com.sun.star.awt.XImageConsumer;
+
+/**
+* Testing <code>com.sun.star.awt.XImageConsumer</code>
+* interface methods :
+* <ul>
+* <li><code> init()</code></li>
+* <li><code> setColorModel()</code></li>
+* <li><code> setPixelsByBytes()</code></li>
+* <li><code> setPixelsByLongs()</code></li>
+* <li><code> complete()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.awt.XImageConsumer
+*/
+
+public class _XImageConsumer extends MultiMethodTest {
+
+ public XImageConsumer oObj = null;
+
+ /**
+ * Initialize the consumer with size 2x2. <p>
+ * Has <b> OK </b> status if no runtime exceptions occurred
+ */
+ public void _init() {
+
+ boolean result = true ;
+ oObj.init(2, 2) ;
+
+ tRes.tested("init()", result) ;
+ }
+
+ /**
+ * Sets color model. <p>
+ * Has <b> OK </b> status if no runtime exceptions occurred
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> init </code> </li>
+ * </ul>
+ */
+ public void _setColorModel() {
+ requiredMethod("init()") ;
+
+ boolean result = true ;
+ int[] pal = new int[256] ;
+ for (int i = 0; i < 256; i++) pal[i] = i ;
+ oObj.setColorModel((short)8, pal, 100, 100, 100, 100) ;
+
+ tRes.tested("setColorModel()", result) ;
+ }
+
+ /**
+ * Fill the picture with for pixels. <p>
+ * Has <b> OK </b> status if no runtime exceptions occurred
+ * The following method tests are to be executed before :
+ * <ul>
+ * <li> <code> setColorModel </code> </li>
+ * </ul>
+ */
+ public void _setPixelsByBytes() {
+ executeMethod("setColorModel()") ;
+
+ boolean result = true ;
+ oObj.setPixelsByBytes(0, 0, 2, 2,
+ new byte[] {(byte)0, (byte)255, (byte)255, (byte)0}, 0, 2) ;
+
+ tRes.tested("setPixelsByBytes()", result) ;
+ }
+
+ /**
+ * Fill the picture with for pixels. <p>
+ * Has <b> OK </b> status if no runtime exceptions occurred
+ * The following method tests are to be executed before :
+ * <ul>
+ * <li> <code> setColorModel </code> </li>
+ * </ul>
+ */
+ public void _setPixelsByLongs() {
+ executeMethod("setColorModel()") ;
+
+ boolean result = true ;
+ oObj.setPixelsByLongs(0, 0, 2, 2, new int[] {0, 255, 255, 0}, 0, 2) ;
+
+ tRes.tested("setPixelsByLongs()", result) ;
+ }
+
+ /**
+ * Just calls the method. <p>
+ * Has <b> OK </b> status if no runtime exceptions occurred
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> init </code> </li>
+ * </ul> <p>
+ * The following method tests are to be executed before :
+ * <ul>
+ * <li> <code> setPixelsByBytes </code> </li>
+ * <li> <code> setPixelsByBytes </code> </li>
+ * </ul>
+ */
+ public void _complete() {
+ requiredMethod("init()") ;
+ executeMethod("setPixelsByBytes()") ;
+ executeMethod("setPixelsByBytes()") ;
+
+ boolean result = true ;
+ oObj.complete(0, null) ;
+
+ tRes.tested("complete()", result) ;
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/awt/_XImageProducer.java b/qadevOOo/tests/java/ifc/awt/_XImageProducer.java
new file mode 100644
index 000000000000..3815c5f53c0e
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XImageProducer.java
@@ -0,0 +1,165 @@
+/*************************************************************************
+ *
+ * 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.awt;
+
+
+import java.io.PrintWriter;
+
+import lib.MultiMethodTest;
+
+import com.sun.star.awt.XImageConsumer;
+import com.sun.star.awt.XImageProducer;
+
+/**
+* Testing <code>com.sun.star.awt.XImageProducer</code>
+* interface methods :
+* <ul>
+* <li><code> addConsumer()</code></li>
+* <li><code> removeConsumer()</code></li>
+* <li><code> startProduction()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.awt.XImageProducer
+*/
+public class _XImageProducer extends MultiMethodTest {
+
+ public XImageProducer oObj = null;
+
+ /**
+ * Consumer implementation which sets flags on appropriate
+ * method calls.
+ */
+ protected class TestImageConsumer implements XImageConsumer {
+ PrintWriter log = null ;
+ public boolean initCalled = false ;
+ public boolean setColorModelCalled = false ;
+ public boolean setPixelsByBytesCalled = false ;
+ public boolean setPixelsByLongsCalled = false ;
+ public boolean completeCalled = false ;
+
+ TestImageConsumer(PrintWriter log) {
+ log.println("### Consumer initialized" ) ;
+ this.log = log ;
+ }
+
+ public void init(int width, int height) {
+ log.println("### init() called") ;
+ initCalled = true ;
+ }
+
+ public void setColorModel(short bitCount, int[] RGBAPal,
+ int redMask, int greenMask, int blueMask, int alphaMask) {
+
+ log.println("### setColorModel() called") ;
+ setColorModelCalled = true ;
+ }
+
+ public void setPixelsByBytes(int x, int y, int width, int height,
+ byte[] data, int offset, int scanSize) {
+
+ log.println("### setPixelByBytes() called") ;
+ setPixelsByBytesCalled = true ;
+ }
+
+ public void setPixelsByLongs(int x, int y, int width, int height,
+ int[] data, int offset, int scanSize) {
+
+ log.println("### setPixelByLongs() called") ;
+ setPixelsByLongsCalled = true ;
+ }
+
+ public void complete(int status, XImageProducer prod) {
+ log.println("### complete() called") ;
+ completeCalled = true ;
+ }
+ }
+
+ TestImageConsumer consumer = null ;
+
+ /**
+ * Creates a new XImageConsumer implementation.
+ */
+ public void before() {
+ consumer = new TestImageConsumer(log) ;
+ }
+
+ /**
+ * Adds a new consumer to producer. <p>
+ * Has <b> OK </b> status if no runtime exceptions occurred
+ */
+ public void _addConsumer() {
+
+ boolean result = true ;
+ oObj.addConsumer(consumer) ;
+
+ tRes.tested("addConsumer()", result) ;
+ }
+
+ /**
+ * Removes the consumer added before. <p>
+ * Has <b> OK </b> status if no runtime exceptions occurred
+ * The following method tests are to be executed before :
+ * <ul>
+ * <li> <code> startProduction </code> </li>
+ * </ul>
+ */
+ public void _removeConsumer() {
+ executeMethod("startProduction()") ;
+
+ boolean result = true ;
+ oObj.removeConsumer(consumer) ;
+
+ tRes.tested("removeConsumer()", result) ;
+ }
+
+ /**
+ * Starts the production and after short waiting checks what
+ * consumer's methods were called. <p>
+ * Has <b> OK </b> status if at least <code>init</code> consumer
+ * methods was called.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addConsumer </code> </li>
+ * </ul>
+ */
+ public void _startProduction() {
+ requiredMethod("addConsumer()") ;
+
+ boolean result = true ;
+ oObj.startProduction() ;
+
+ try {
+ Thread.sleep(500) ;
+ } catch (InterruptedException e) {}
+
+ tRes.tested("startProduction()", consumer.initCalled) ;
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/awt/_XItemListener.java b/qadevOOo/tests/java/ifc/awt/_XItemListener.java
new file mode 100644
index 000000000000..b5f920f4ffa7
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XItemListener.java
@@ -0,0 +1,119 @@
+/*************************************************************************
+ *
+ * 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.awt;
+
+
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+import com.sun.star.awt.ItemEvent;
+import com.sun.star.awt.XItemListener;
+
+/**
+* Testing <code>com.sun.star.awt.XItemListener</code>
+* interface methods :
+* <ul>
+* <li><code> itemStateChanged()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'TestItemListener'</code>
+* (of type <code>ifc.awt._XItemListener.TestItemListener</code>):
+* this <code>XItemListener</code> implementation must be
+* added to the object tested for checking
+* <code> itemStateChanged()</code> method call. </li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.awt.XItemListener
+*/
+public class _XItemListener extends MultiMethodTest {
+
+ public XItemListener oObj = null;
+
+ /**
+ * Listener implementation which sets flags on appropriate method calls
+ * and stores event passed.
+ */
+ public static class TestItemListener implements com.sun.star.awt.XItemListener {
+ public boolean itemStateChangedCalled = false ;
+ public ItemEvent event = null ;
+
+ public void itemStateChanged(com.sun.star.awt.ItemEvent e) {
+ itemStateChangedCalled = true ;
+ event = e ;
+ }
+
+ public void disposing(com.sun.star.lang.EventObject e) {}
+
+ }
+
+ TestItemListener itemListener = null ;
+
+ /**
+ * Retrieves object relation.
+ * @throws StatusException If the relation not found.
+ */
+ public void before() {
+ itemListener = (TestItemListener) tEnv.getObjRelation("TestItemListener") ;
+ if (itemListener == null)
+ throw new StatusException(Status.failed("Relation not found")) ;
+ }
+
+ /**
+ * First a <code>ItemEvent</code> object created and
+ * it is passed to <code>itemStateChanged</code> method
+ * call. Then a short wait follows for listener already
+ * registered at the object to be caled. <p>
+ * Has <b> OK </b> status if the listener was called with
+ * the same <code>ItemEvent</code> object as was created
+ * before.
+ */
+ public void _itemStateChanged() {
+
+ boolean result = true ;
+
+ ItemEvent event = new ItemEvent() ;
+ event.Selected = 1 ;
+ event.Highlighted = 2 ;
+ oObj.itemStateChanged(event) ;
+
+ try {
+ Thread.sleep(200) ;
+ } catch (InterruptedException e) {}
+
+ result = itemListener.itemStateChangedCalled &&
+ itemListener.event.Selected == 1 &&
+ itemListener.event.Highlighted == 2 ;
+
+ tRes.tested("itemStateChanged()", result) ;
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/awt/_XLayoutConstrains.java b/qadevOOo/tests/java/ifc/awt/_XLayoutConstrains.java
new file mode 100644
index 000000000000..81bfc6889175
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XLayoutConstrains.java
@@ -0,0 +1,77 @@
+/*************************************************************************
+ *
+ * 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.awt;
+
+import lib.MultiMethodTest;
+
+import com.sun.star.awt.Size;
+import com.sun.star.awt.XLayoutConstrains;
+
+/**
+* Testing <code>com.sun.star.awt.XLayoutConstrains</code>
+* interface methods:
+* <ul>
+* <li><code> getMinimumSize() </code></li>
+* <li><code> getPreferredSize() </code></li>
+* <li><code> calcAdjustedSize() </code></li>
+* </ul><p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.awt.XLayoutConstrains
+*/
+public class _XLayoutConstrains extends MultiMethodTest {
+ public XLayoutConstrains oObj = null;
+
+ /**
+ * Test calls the method, then check if returned value is not null.<p>
+ * Has <b> OK </b> status if the method returns not null.
+ */
+ public void _getMinimumSize() {
+ Size aSize = oObj.getMinimumSize();
+ tRes.tested("getMinimumSize()", aSize != null);
+ }
+
+ /**
+ * Test calls the method, then check if returned value is not null.<p>
+ * Has <b> OK </b> status if the method returns not null.
+ */
+ public void _getPreferredSize() {
+ Size aSize = oObj.getPreferredSize();
+ tRes.tested("getPreferredSize()", aSize != null);
+ }
+
+ /**
+ * Test calls the method with the new size as a parameter.<p>
+ * Has <b> OK </b> status if the method returns not null.
+ */
+ public void _calcAdjustedSize() {
+ Size aSize = oObj.calcAdjustedSize(new Size(50,50));
+ tRes.tested("calcAdjustedSize()", aSize != null);
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_XListBox.java b/qadevOOo/tests/java/ifc/awt/_XListBox.java
new file mode 100644
index 000000000000..bf9a25f6f13e
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XListBox.java
@@ -0,0 +1,513 @@
+/*************************************************************************
+ *
+ * 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.awt;
+
+
+import lib.MultiMethodTest;
+import lib.Status;
+
+import com.sun.star.awt.XListBox;
+
+/**
+* Testing <code>com.sun.star.awt.XListBox</code>
+* interface methods :
+* <ul>
+* <li><code> addItemListener()</code></li>
+* <li><code> removeItemListener()</code></li>
+* <li><code> addActionListener()</code></li>
+* <li><code> removeActionListener()</code></li>
+* <li><code> addItem()</code></li>
+* <li><code> addItems()</code></li>
+* <li><code> removeItems()</code></li>
+* <li><code> getItemCount()</code></li>
+* <li><code> getItem()</code></li>
+* <li><code> getItems()</code></li>
+* <li><code> getSelectedItemPos()</code></li>
+* <li><code> getSelectedItemsPos()</code></li>
+* <li><code> getSelectedItem()</code></li>
+* <li><code> getSelectedItems()</code></li>
+* <li><code> selectItemPos()</code></li>
+* <li><code> selectItemsPos()</code></li>
+* <li><code> selectItem()</code></li>
+* <li><code> isMutipleMode()</code></li>
+* <li><code> setMultipleMode()</code></li>
+* <li><code> getDropDownLineCount()</code></li>
+* <li><code> setDropDownLineCount()</code></li>
+* <li><code> makeVisible()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.awt.XListBox
+*/
+public class _XListBox extends MultiMethodTest {
+
+ public XListBox oObj = null;
+
+ /**
+ * Listener implementation which sets flags on appropriate method calls
+ */
+ protected class TestActionListener implements com.sun.star.awt.XActionListener {
+ public boolean disposingCalled = false ;
+ public boolean actionPerformedCalled = false ;
+
+ public void disposing(com.sun.star.lang.EventObject e) {
+ disposingCalled = true ;
+ }
+
+ public void actionPerformed(com.sun.star.awt.ActionEvent e) {
+ actionPerformedCalled = true ;
+ }
+
+ }
+
+ TestActionListener actionListener = new TestActionListener() ;
+
+ /**
+ * Listener implementation which sets flags on appropriate method calls
+ */
+ protected class TestItemListener implements com.sun.star.awt.XItemListener {
+ public boolean disposingCalled = false ;
+ public boolean itemStateChangedCalled = false ;
+
+ public void disposing(com.sun.star.lang.EventObject e) {
+ disposingCalled = true ;
+ }
+
+ public void itemStateChanged(com.sun.star.awt.ItemEvent e) {
+ itemStateChangedCalled = true ;
+ }
+
+ }
+
+ TestItemListener itemListener = new TestItemListener() ;
+
+ short lineCount = 0 ;
+ short itemCount = 0 ;
+
+ /**
+ * Retrieves object relations.
+ * @throws StatusException If one of relations not found.
+ */
+ public void before() {
+ itemCount = oObj.getItemCount();
+ }
+
+ /**
+ * !!! Can be checked only interactively !!!
+ */
+ public void _addItemListener() {
+
+ oObj.addItemListener(itemListener) ;
+
+ tRes.tested("addItemListener()", Status.skipped(true)) ;
+ }
+
+ /**
+ * !!! Can be checked only interactively !!!
+ */
+ public void _removeItemListener() {
+ requiredMethod("addItemListener()") ;
+
+ oObj.removeItemListener(itemListener) ;
+
+ tRes.tested("removeItemListener()", Status.skipped(true)) ;
+ }
+
+ /**
+ * !!! Can be checked only interactively !!!
+ */
+ public void _addActionListener() {
+
+ oObj.addActionListener(actionListener) ;
+
+ tRes.tested("addActionListener()", Status.skipped(true)) ;
+ }
+
+ /**
+ * !!! Can be checked only interactively !!!
+ */
+ public void _removeActionListener() {
+ requiredMethod("addActionListener()") ;
+
+ oObj.removeActionListener(actionListener) ;
+
+ tRes.tested("removeActionListener()", Status.skipped(true)) ;
+ }
+
+ /**
+ * Adds one item to the last position and check the number of
+ * items after addition. <p>
+ * Has <b>OK</b> status if the number of items increased by 1.<p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getItemCount </code> </li>
+ * </ul>
+ */
+ public void _addItem() {
+ requiredMethod("getItemCount()") ;
+
+ boolean result = true ;
+ oObj.addItem("Item1", itemCount) ;
+ result = oObj.getItemCount() == itemCount + 1 ;
+
+ tRes.tested("addItem()", result) ;
+ }
+
+ /**
+ * Adds one two items to the last position and check the number of
+ * items after addition. <p>
+ * Has <b>OK</b> status if the number of items increased by 2.<p>
+ * The following method tests are to be executed before :
+ * <ul>
+ * <li> <code> addItem </code> </li>
+ * </ul>
+ */
+ public void _addItems() {
+ executeMethod("addItem()") ;
+
+ boolean result = true ;
+ short oldCnt = oObj.getItemCount() ;
+ oObj.addItems(new String[] {"Item2", "Item3"}, oldCnt) ;
+ result = oObj.getItemCount() == oldCnt + 2 ;
+
+ tRes.tested("addItems()", result) ;
+ }
+
+ /**
+ * Gets the current number of items and tries to remove them all
+ * then checks number of items. <p>
+ * Has <b>OK</b> status if no items remains. <p>
+ * The following method tests are to be executed before :
+ * <ul>
+ * <li> <code> getItems </code> </li>
+ * <li> <code> getItem </code> </li>
+ * </ul>
+ */
+ public void _removeItems() {
+ executeMethod("getItems()") ;
+ executeMethod("getItem()") ;
+ executeMethod("getSelectedItemPos()") ;
+ executeMethod("getSelectedItemsPos()") ;
+ executeMethod("getSelectedItem()") ;
+ executeMethod("getSelectedItems()") ;
+
+ boolean result = true ;
+ short oldCnt = oObj.getItemCount() ;
+ oObj.removeItems((short)0, oldCnt) ;
+ result = oObj.getItemCount() == 0 ;
+
+ tRes.tested("removeItems()", result) ;
+ }
+
+ /**
+ * Just retrieves current number of items and stores it. <p>
+ * Has <b>OK</b> status if the count is not less than 0.
+ */
+ public void _getItemCount() {
+
+ itemCount = oObj.getItemCount() ;
+
+ tRes.tested("getItemCount()", itemCount >= 0) ;
+ }
+
+ /**
+ * After <code>addItem</code> and <code>addItems</code> methods
+ * test the following items must exist {..., "Item1", "Item2", "Item3"}
+ * Retrieves the item from the position which was ititially the last.<p>
+ * Has <b>OK</b> status if the "Item1" was retrieved. <p>
+ * The following method tests are to be executed before :
+ * <ul>
+ * <li> <code> addItems </code> </li>
+ * </ul>
+ */
+ public void _getItem() {
+ requiredMethod("addItems()") ;
+
+ boolean result = true ;
+ String item = oObj.getItem(itemCount) ;
+ result = "Item1".equals(item) ;
+
+ tRes.tested("getItem()", result) ;
+ }
+
+ /**
+ * After <code>addItem</code> and <code>addItems</code> methods
+ * test the following items must exist {..., "Item1", "Item2", "Item3"}
+ * Retrieves all items. <p>
+ * Has <b>OK</b> status if the last three items retrieved are
+ * "Item1", "Item2" and "Item3". <p>
+ * The following method tests are to be executed before :
+ * <ul>
+ * <li> <code> addItems </code> </li>
+ * </ul>
+ */
+ public void _getItems() {
+ requiredMethod("addItems()") ;
+
+ boolean result = true ;
+ String[] items = oObj.getItems() ;
+ for (int i = itemCount; i < (itemCount + 3); i++) {
+ result &= ("Item" + (i+1 - itemCount)).equals(items[i]) ;
+ }
+
+ tRes.tested("getItems()", result) ;
+ }
+
+ /**
+ * Gets line count and stores it. <p>
+ * Has <b>OK</b> status if no runtime exceptions occurred.
+ */
+ public void _getDropDownLineCount() {
+
+ boolean result = true ;
+ lineCount = oObj.getDropDownLineCount() ;
+
+ tRes.tested("getDropDownLineCount()", result) ;
+ }
+
+ /**
+ * Sets a new value and then checks get value. <p>
+ * Has <b>OK</b> status if set and get values are equal. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getDropDownLineCount </code> </li>
+ * </ul>
+ */
+ public void _setDropDownLineCount() {
+ requiredMethod("getDropDownLineCount()") ;
+
+ boolean result = true ;
+ oObj.setDropDownLineCount((short)(lineCount + 1)) ;
+ result = oObj.getDropDownLineCount() == lineCount + 1 ;
+
+ tRes.tested("setDropDownLineCount()", result) ;
+ }
+
+ /**
+ * Selects some item and gets selected item position. <p>
+ * Has <b> OK </b> status if position is equal to position set. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addItems </code> : to have some items </li>
+ * </ul>
+ */
+ public void _getSelectedItemPos() {
+ requiredMethod("addItems()") ;
+
+ boolean result = true ;
+ oObj.selectItemPos((short)1, true) ;
+ short pos = oObj.getSelectedItemPos() ;
+
+ result = pos == 1 ;
+
+ tRes.tested("getSelectedItemPos()", result) ;
+ }
+
+ /**
+ * Clears all selections, then selects some items and gets selected
+ * item positions. <p>
+ * Has <b> OK </b> status if positions get are the same as were set.<p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> selectItemsPos </code> </li>
+ * </ul>
+ */
+ public void _getSelectedItemsPos() {
+ requiredMethod("selectItemsPos()") ;
+
+ boolean result = true ;
+ short cnt = oObj.getItemCount() ;
+ for (short i = 0; i < cnt; i++) {
+ oObj.selectItemPos(i, false) ;
+ }
+ oObj.selectItemsPos(new short[] {0, 2}, true) ;
+
+ short[] items = oObj.getSelectedItemsPos() ;
+
+ result = items != null && items.length == 2 &&
+ items[0] == 0 && items[1] == 2 ;
+
+ tRes.tested("getSelectedItemsPos()", result) ;
+ }
+
+ /**
+ * Unselects all items, selects some item and then gets selected item. <p>
+ * Has <b> OK </b> status if items selected and get are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addItems </code> : to have some items </li>
+ * </ul>
+ */
+ public void _getSelectedItem() {
+ requiredMethod("addItems()") ;
+
+ boolean result = true ;
+ short cnt = oObj.getItemCount() ;
+ for (short i = 0; i < cnt; i++) {
+ oObj.selectItemPos(i, false) ;
+ }
+ oObj.selectItem("Item3", true) ;
+ String item = oObj.getSelectedItem() ;
+
+ result = "Item3".equals(item) ;
+
+ tRes.tested("getSelectedItem()", result) ;
+ }
+
+ /**
+ * Clears all selections, then selects some items positions and gets
+ * selected items. <p>
+ * Has <b> OK </b> status if items get are the same as items on
+ * positions which were set.<p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> selectItemsPos </code> </li>
+ * <li> <code> getItem </code>: this method is used here for checking.
+ * </li>
+ * </ul>
+ */
+ public void _getSelectedItems() {
+ requiredMethod("selectItemsPos()") ;
+ requiredMethod("getItem()") ;
+
+ boolean result = true ;
+ short cnt = oObj.getItemCount() ;
+ for (short i = 0; i < cnt; i++) {
+ oObj.selectItemPos(i, false) ;
+ }
+ oObj.selectItemsPos(new short[] {0, 2}, true) ;
+
+ String[] items = oObj.getSelectedItems() ;
+ result = items != null && items.length == 2 &&
+ oObj.getItem((short)0).equals(items[0]) &&
+ oObj.getItem((short)2).equals(items[1]) ;
+
+ tRes.tested("getSelectedItems()", result) ;
+ }
+
+ /**
+ * Unselects all items, then selects a single item. <p>
+ * Has <b> OK </b> status if no runtime exceptions occurred
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addItems </code> : to have some items </li>
+ * </ul>
+ */
+ public void _selectItemPos() {
+ requiredMethod("addItems()") ;
+
+ boolean result = true ;
+ short cnt = oObj.getItemCount() ;
+ for (short i = 0; i < cnt; i++) {
+ oObj.selectItemPos(i, false) ;
+ }
+ oObj.selectItemPos((short)1, true) ;
+
+ tRes.tested("selectItemPos()", result) ;
+ }
+
+ /**
+ * Just selects some items. <p>
+ * Has <b> OK </b> status if no runtime exceptions occurred
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addItems </code> : to have some items </li>
+ * </ul>
+ */
+ public void _selectItemsPos() {
+ requiredMethod("addItems()") ;
+ requiredMethod("setMultipleMode()") ;
+
+ boolean result = true ;
+ oObj.selectItemsPos(new short[] {0, 2}, true) ;
+
+ tRes.tested("selectItemsPos()", result) ;
+ }
+
+ /**
+ * Just selects an item. <p>
+ * Has <b> OK </b> status if no runtime exceptions occurred
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addItems </code> : to have some items </li>
+ * </ul>
+ */
+ public void _selectItem() {
+ requiredMethod("addItems()") ;
+
+ boolean result = true ;
+ oObj.selectItem("Item3", true) ;
+
+ tRes.tested("selectItem()", result) ;
+ }
+
+ /**
+ * Checks if multiple mode is set. <p>
+ * Has <b> OK </b> status if multiple mode is set. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setMultipleMode </code> </li>
+ * </ul>
+ */
+ public void _isMutipleMode() {
+ requiredMethod("setMultipleMode()") ;
+
+ boolean result = true ;
+ result = oObj.isMutipleMode() ;
+
+ tRes.tested("isMutipleMode()", result) ;
+ }
+
+ /**
+ * Sets multiple mode. <p>
+ * Has <b> OK </b> status if no runtime exceptions occurred
+ */
+ public void _setMultipleMode() {
+
+ boolean result = true ;
+ oObj.setMultipleMode(true) ;
+
+ tRes.tested("setMultipleMode()", result) ;
+ }
+
+ /**
+ * Just calls the method to make visible third item. <p>
+ * Has <b> OK </b> status if no runtime exceptions occurred.<p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addItems </code> </li>
+ * </ul>
+ */
+ public void _makeVisible() {
+ requiredMethod("addItems()") ;
+
+ boolean result = true ;
+ oObj.makeVisible((short)2) ;
+
+ tRes.tested("makeVisible()", result) ;
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/ifc/awt/_XMessageBoxFactory.java b/qadevOOo/tests/java/ifc/awt/_XMessageBoxFactory.java
new file mode 100644
index 000000000000..9c96506938da
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XMessageBoxFactory.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.awt;
+
+import com.sun.star.awt.AsyncCallback;
+import com.sun.star.awt.Rectangle;
+import com.sun.star.awt.XCallback;
+import com.sun.star.awt.XMessageBox;
+import com.sun.star.awt.XMessageBoxFactory;
+import com.sun.star.awt.XRequestCallback;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.Any;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiMethodTest;
+import util.UITools;
+
+/**
+ * Testing <code>com.sun.star.awt.XMessageBoxFactory</code>
+ * interface methods :
+ * <ul>
+ * <li><code> </code>createMessageBox()</li>
+ * </ul> <p>
+ * Test is <b> NOT </b> multithread compilant. <p>
+ * @see com.sun.star.awt.XMessageBoxFactory
+ */
+public class _XMessageBoxFactory extends MultiMethodTest {
+ public XMessageBoxFactory oObj = null;
+
+ public void _createMessageBox() {
+ final XMessageBox mb = oObj.createMessageBox(
+ (XWindowPeer) tEnv.getObjRelation("WINPEER"),
+ new Rectangle(0, 0, 100, 100), "errorbox", 1, "The Title",
+ "The Message");
+ final UITools tools = new UITools(
+ (XMultiServiceFactory) tParam.getMSF(),
+ UnoRuntime.queryInterface(XWindow.class, mb));
+ final boolean[] done = new boolean[] { false };
+ final boolean[] good = new boolean[] { false };
+ XRequestCallback async = AsyncCallback.create(
+ tParam.getComponentContext());
+ async.addCallback(
+ new XCallback() {
+ public void notify(Object aData) {
+ mb.execute();
+ synchronized (done) {
+ done[0] = true;
+ done.notifyAll();
+ }
+ }
+ },
+ Any.VOID);
+ async.addCallback(
+ new XCallback() {
+ public void notify(Object aData) {
+ try {
+ tools.clickButton("OK");
+ } catch (RuntimeException e) {
+ throw e;
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ synchronized (good) {
+ good[0] = true;
+ }
+ }
+ },
+ Any.VOID);
+ synchronized (done) {
+ while (!done[0]) {
+ try {
+ done.wait();
+ } catch (InterruptedException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+ boolean ok;
+ synchronized (good) {
+ ok = good[0];
+ }
+ tRes.tested("createMessageBox()", ok);
+ }
+}
diff --git a/qadevOOo/tests/java/ifc/awt/_XNumericField.java b/qadevOOo/tests/java/ifc/awt/_XNumericField.java
new file mode 100644
index 000000000000..87319b4ce5cd
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XNumericField.java
@@ -0,0 +1,311 @@
+/*************************************************************************
+ *
+ * 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.awt;
+
+
+import lib.MultiMethodTest;
+
+import com.sun.star.awt.XNumericField;
+
+/**
+* Testing <code>com.sun.star.awt.XNumericField</code>
+* interface methods :
+* <ul>
+* <li><code> setValue()</code></li>
+* <li><code> getValue()</code></li>
+* <li><code> setMin()</code></li>
+* <li><code> getMin()</code></li>
+* <li><code> setMax()</code></li>
+* <li><code> getMax()</code></li>
+* <li><code> setFirst()</code></li>
+* <li><code> getFirst()</code></li>
+* <li><code> setLast()</code></li>
+* <li><code> getLast()</code></li>
+* <li><code> setSpinSize()</code></li>
+* <li><code> getSpinSize()</code></li>
+* <li><code> setDecimalDigits()</code></li>
+* <li><code> getDecimalDigits()</code></li>
+* <li><code> setStrictFormat()</code></li>
+* <li><code> isStrictFormat()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.awt.XNumericField
+*/
+public class _XNumericField extends MultiMethodTest {
+
+ public XNumericField oObj = null;
+ private double val = 0 ;
+ private double min = 0 ;
+ private double max = 0 ;
+ private double first = 0 ;
+ private double last = 0 ;
+ private double spin = 0 ;
+ private short digits = 0 ;
+ private boolean strict = true ;
+
+ /**
+ * Sets value changed and then compares it to get value. <p>
+ * Has <b>OK</b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getValue </code> </li>
+ * </ul>
+ */
+ public void _setValue() {
+ requiredMethod("getValue()");
+
+ oObj.setValue(val + 1.1) ;
+
+ tRes.tested("setValue()", oObj.getValue() == val + 1.1) ;
+ }
+
+ /**
+ * Just calls the method and stores value returned. <p>
+ * Has <b>OK</b> status if no runtime exceptions occurred.
+ */
+ public void _getValue() {
+ val = oObj.getValue() ;
+
+ tRes.tested("getValue()", true) ;
+ }
+
+ /**
+ * Sets minimal value changed and then compares it to get value. <p>
+ * Has <b>OK</b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getMin </code> </li>
+ * </ul>
+ */
+ public void _setMin() {
+ requiredMethod("getMin()") ;
+
+ oObj.setMin(min + 1.1) ;
+
+ tRes.tested("setMin()", oObj.getMin() == min + 1.1) ;
+ }
+
+ /**
+ * Just calls the method and stores value returned. <p>
+ * Has <b>OK</b> status if no runtime exceptions occurred.
+ */
+ public void _getMin() {
+
+ boolean result = true ;
+ min = oObj.getMin() ;
+
+ tRes.tested("getMin()", result) ;
+ }
+
+ /**
+ * Sets maximal value changed and then compares it to get value. <p>
+ * Has <b>OK</b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getMax </code> </li>
+ * </ul>
+ */
+ public void _setMax() {
+ requiredMethod("getMax()") ;
+
+ boolean result = true ;
+ oObj.setMax(max + 1.1) ;
+ result = oObj.getMax() == max + 1.1 ;
+
+ tRes.tested("setMax()", result) ;
+ }
+
+ /**
+ * Just calls the method and stores value returned. <p>
+ * Has <b>OK</b> status if no runtime exceptions occurred.
+ */
+ public void _getMax() {
+
+ boolean result = true ;
+ max = oObj.getMax() ;
+
+ tRes.tested("getMax()", result) ;
+ }
+
+ /**
+ * Sets value changed and then compares it to get value. <p>
+ * Has <b>OK</b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getFirst </code> </li>
+ * </ul>
+ */
+ public void _setFirst() {
+ requiredMethod("getFirst()") ;
+
+ boolean result = true ;
+ oObj.setFirst(first + 1.1) ;
+ double ret = oObj.getFirst() ;
+ result = ret == first + 1.1 ;
+
+ tRes.tested("setFirst()", result) ;
+ }
+
+ /**
+ * Just calls the method and stores value returned. <p>
+ * Has <b>OK</b> status if no runtime exceptions occurred.
+ */
+ public void _getFirst() {
+
+ boolean result = true ;
+ first = oObj.getFirst() ;
+
+ tRes.tested("getFirst()", result) ;
+ }
+
+ /**
+ * Sets value changed and then compares it to get value. <p>
+ * Has <b>OK</b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getLast </code> </li>
+ * </ul>
+ */
+ public void _setLast() {
+ requiredMethod("getLast()") ;
+
+ boolean result = true ;
+ oObj.setLast(last + 1.1) ;
+ double ret = oObj.getLast() ;
+
+ result = ret == last + 1.1 ;
+
+ tRes.tested("setLast()", result) ;
+ }
+
+ /**
+ * Just calls the method and stores value returned. <p>
+ * Has <b>OK</b> status if no runtime exceptions occurred.
+ */
+ public void _getLast() {
+
+ boolean result = true ;
+ last = oObj.getLast() ;
+
+ tRes.tested("getLast()", result) ;
+ }
+
+ /**
+ * Sets value changed and then compares it to get value. <p>
+ * Has <b>OK</b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getSpinSize </code> </li>
+ * </ul>
+ */
+ public void _setSpinSize() {
+ requiredMethod("getSpinSize()") ;
+
+ boolean result = true ;
+ oObj.setSpinSize(spin + 1.1) ;
+ result = oObj.getSpinSize() == spin + 1.1 ;
+
+ tRes.tested("setSpinSize()", result) ;
+ }
+
+ /**
+ * Just calls the method and stores value returned. <p>
+ * Has <b>OK</b> status if no runtime exceptions occurred.
+ */
+ public void _getSpinSize() {
+
+ boolean result = true ;
+ spin = oObj.getSpinSize() ;
+
+ tRes.tested("getSpinSize()", result) ;
+ }
+
+ /**
+ * Sets value changed and then compares it to get value. <p>
+ * Has <b>OK</b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getDecimalDigits </code> </li>
+ * </ul>
+ */
+ public void _setDecimalDigits() {
+ requiredMethod("getDecimalDigits()") ;
+
+ boolean result = true ;
+ oObj.setDecimalDigits((short)(digits + 1)) ;
+
+ short res = oObj.getDecimalDigits() ;
+ result = res == ((short)digits + 1) ;
+
+ tRes.tested("setDecimalDigits()", result) ;
+ }
+
+ /**
+ * Just calls the method and stores value returned. <p>
+ * Has <b>OK</b> status if no runtime exceptions occurred.
+ */
+ public void _getDecimalDigits() {
+
+ boolean result = true ;
+ digits = oObj.getDecimalDigits() ;
+
+ tRes.tested("getDecimalDigits()", result) ;
+ }
+
+ /**
+ * Sets value changed and then compares it to get value. <p>
+ * Has <b>OK</b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> isStrictFormat </code> </li>
+ * </ul>
+ */
+ public void _setStrictFormat() {
+ requiredMethod("isStrictFormat()") ;
+
+ boolean result = true ;
+ oObj.setStrictFormat(!strict) ;
+ result = oObj.isStrictFormat() == !strict ;
+
+ tRes.tested("setStrictFormat()", result) ;
+ }
+
+ /**
+ * Just calls the method and stores value returned. <p>
+ * Has <b>OK</b> status if no runtime exceptions occurred.
+ */
+ public void _isStrictFormat() {
+
+ boolean result = true ;
+ strict = oObj.isStrictFormat() ;
+
+ tRes.tested("isStrictFormat()", result) ;
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/awt/_XPatternField.java b/qadevOOo/tests/java/ifc/awt/_XPatternField.java
new file mode 100644
index 000000000000..f82d43c72eb8
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XPatternField.java
@@ -0,0 +1,176 @@
+/*************************************************************************
+ *
+ * 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.awt;
+
+
+import lib.MultiMethodTest;
+
+import com.sun.star.awt.XPatternField;
+
+/**
+* Testing <code>com.sun.star.awt.XPatternField</code>
+* interface methods :
+* <ul>
+* <li><code> setMasks()</code></li>
+* <li><code> getMasks()</code></li>
+* <li><code> setString()</code></li>
+* <li><code> getString()</code></li>
+* <li><code> setStrictFormat()</code></li>
+* <li><code> isStrictFormat()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.awt.XPatternField
+*/
+public class _XPatternField extends MultiMethodTest {
+
+ public XPatternField oObj = null ;
+ private String editMask = null ;
+ private String literalMask = null ;
+ private String string = null ;
+ private boolean strict = false ;
+
+ /**
+ * Sets masks to new values then gets them and compare. <p>
+ * Has <b> OK </b> status if set and get masks are equal. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getMasks </code> </li>
+ * </ul>
+ */
+ public void _setMasks() {
+ requiredMethod("getMasks()") ;
+
+ boolean result = true ;
+ String newEdit = editMask == null ? "ccc" : editMask + "ccc" ;
+ String newLiteral = literalMask == null ? " " : literalMask + " " ;
+ oObj.setMasks(newEdit, newLiteral) ;
+
+ String[] edit = new String[1] ;
+ String[] literal = new String[1] ;
+ oObj.getMasks(edit, literal) ;
+
+ result &= newEdit.equals(edit[0]) ;
+ result &= newLiteral.equals(literal[0]) ;
+
+ tRes.tested("setMasks()", result) ;
+ }
+
+ /**
+ * Gets masks and stores them. <p>
+ * Has <b> OK </b> status if no runtime exceptions occurred.
+ */
+ public void _getMasks() {
+
+ boolean result = true ;
+ String[] edit = new String[1] ;
+ String[] literal = new String[1] ;
+ oObj.getMasks(edit, literal) ;
+
+ log.println("Edit mask = '" + edit[0] + "', literal = '" +
+ literal[0] + "'") ;
+
+ editMask = edit[0] ;
+ literalMask = literal[0] ;
+
+ tRes.tested("getMasks()", result) ;
+ }
+
+ /**
+ * Sets new string and then get it for verification. <p>
+ * Has <b> OK </b> status if get and set strings are equal. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getString </code> </li>
+ * <li> <code> setMasks </code> : mask must be set for new string
+ * would be valid. </li>
+ * </ul>
+ */
+ public void _setString() {
+ requiredMethod("setMasks()") ;
+ requiredMethod("getString()") ;
+
+ boolean result = true ;
+ String newString = string = "abc" ;
+ oObj.setString(newString) ;
+ String getString = oObj.getString() ;
+
+ result = newString.equals(getString) ;
+
+ if (!result) {
+ log.println("Was '" + string + "', Set '" + newString
+ + "', Get '" + getString + "'") ;
+ }
+
+ tRes.tested("setString()", result) ;
+ }
+
+ /**
+ * Gets current string and stores it. <p>
+ * Has <b> OK </b> status if no runtime exceptions occurred
+ */
+ public void _getString() {
+
+ boolean result = true ;
+ string = oObj.getString() ;
+
+ tRes.tested("getString()", result) ;
+ }
+
+ /**
+ * Sets new strict state then checks it. <p>
+ * Has <b> OK </b> status if the state was changed.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> isStrictFormat </code> </li>
+ * </ul>
+ */
+ public void _setStrictFormat() {
+ requiredMethod("isStrictFormat()") ;
+
+ boolean result = true ;
+ oObj.setStrictFormat(!strict) ;
+
+ result = oObj.isStrictFormat() == !strict ;
+
+ tRes.tested("setStrictFormat()", result) ;
+ }
+
+ /**
+ * Gets the current strict state and stores it. <p>
+ * Has <b> OK </b> status if no runtime exceptions occurred.
+ */
+ public void _isStrictFormat() {
+
+ boolean result = true ;
+ strict = oObj.isStrictFormat() ;
+
+ tRes.tested("isStrictFormat()", result) ;
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/awt/_XRadioButton.java b/qadevOOo/tests/java/ifc/awt/_XRadioButton.java
new file mode 100644
index 000000000000..d892f82ceb9e
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XRadioButton.java
@@ -0,0 +1,151 @@
+/*************************************************************************
+ *
+ * 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.awt;
+
+
+import lib.MultiMethodTest;
+import lib.Status;
+
+import com.sun.star.awt.XRadioButton;
+
+/**
+* Testing <code>com.sun.star.awt.XRadioButton</code>
+* interface methods :
+* <ul>
+* <li><code> addItemListener()</code></li>
+* <li><code> removeItemListener()</code></li>
+* <li><code> getState()</code></li>
+* <li><code> setState()</code></li>
+* <li><code> setLabel()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.awt.XRadioButton
+*/
+public class _XRadioButton extends MultiMethodTest {
+
+ public XRadioButton oObj = null;
+ private boolean state = false ;
+
+ /**
+ * Listener implementation which sets flags on appropriate method calls
+ */
+ protected class TestItemListener implements com.sun.star.awt.XItemListener {
+ public boolean disposingCalled = false ;
+ public boolean itemStateChangedCalled = false ;
+ private java.io.PrintWriter log = null ;
+
+ public TestItemListener(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 itemStateChanged(com.sun.star.awt.ItemEvent e) {
+ itemStateChangedCalled = true ;
+ log.println(" itemStateChanged was called.") ;
+ }
+
+ }
+
+ TestItemListener itemListener = null ;
+
+ /**
+ * !!! Can be checked only interactively !!!
+ */
+ public void _addItemListener() {
+
+ itemListener = new TestItemListener(log) ;
+
+ oObj.addItemListener(itemListener) ;
+
+ tRes.tested("addItemListener()", Status.skipped(true)) ;
+ }
+
+ /**
+ * !!! Can be checked only interactively !!!
+ */
+ public void _removeItemListener() {
+ requiredMethod("addItemListener()") ;
+
+ oObj.removeItemListener(itemListener) ;
+
+ tRes.tested("removeItemListener()", Status.skipped(true)) ;
+ }
+
+ /**
+ * Gets state and stores it. <p>
+ * Has <b> OK </b> status if no runtime exceptions occurred
+ */
+ public void _getState() {
+
+ boolean result = true ;
+ state = oObj.getState() ;
+
+ tRes.tested("getState()", result) ;
+ }
+
+ /**
+ * Sets a new state and the gets it for checking. <p>
+ * Has <b> OK </b> status if set and get states are equal. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getState </code> </li>
+ * </ul>
+ */
+ public void _setState() {
+ requiredMethod("getState()") ;
+
+ boolean result = true ;
+ oObj.setState(!state) ;
+
+ try {
+ Thread.sleep(200) ;
+ } catch (InterruptedException e) {}
+
+ result = oObj.getState() == !state ;
+
+ tRes.tested("setState()", result) ;
+ }
+
+ /**
+ * Just sets a new label. <p>
+ * Has <b> OK </b> status if no runtime exceptions occurred
+ */
+ public void _setLabel() {
+
+ boolean result = true ;
+ oObj.setLabel("XRadioButton") ;
+
+ tRes.tested("setLabel()", result) ;
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/awt/_XScrollBar.java b/qadevOOo/tests/java/ifc/awt/_XScrollBar.java
new file mode 100644
index 000000000000..a5a55d300aeb
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XScrollBar.java
@@ -0,0 +1,228 @@
+/*************************************************************************
+ *
+ * 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.awt;
+
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleComponent;
+import com.sun.star.awt.Point;
+import com.sun.star.awt.ScrollBarOrientation;
+import com.sun.star.awt.XScrollBar;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+
+import java.awt.Robot;
+import java.awt.event.InputEvent;
+
+import lib.MultiMethodTest;
+
+
+public class _XScrollBar extends MultiMethodTest {
+ public XScrollBar oObj;
+ public boolean adjusted = false;
+ com.sun.star.awt.XAdjustmentListener listener = new AdjustmentListener();
+
+ public void _addAdjustmentListener() {
+ util.FormTools.switchDesignOf((XMultiServiceFactory) tParam.getMSF(),
+ (XTextDocument) tEnv.getObjRelation("Document"));
+ shortWait();
+ oObj.addAdjustmentListener(listener);
+ adjustScrollBar();
+
+ boolean res = adjusted;
+ oObj.removeAdjustmentListener(listener);
+ adjusted = false;
+ adjustScrollBar();
+ res &= !adjusted;
+ tRes.tested("addAdjustmentListener()", res);
+ }
+
+ public void _removeAdjustmentListener() {
+ //this method is checked in addAjustmentListener
+ //so that method is requiered here and if it works
+ //this method is given OK too
+ requiredMethod("addAdjustmentListener()");
+ tRes.tested("removeAdjustmentListener()", true);
+ }
+
+ public void _setBlockIncrement() {
+ oObj.setBlockIncrement(15);
+ oObj.setBlockIncrement(5);
+ int bi = oObj.getBlockIncrement();
+ tRes.tested("setBlockIncrement()",bi==5);
+ }
+
+ public void _getBlockIncrement() {
+ //this method is checked in the corresponding set method
+ //so that method is requiered here and if it works
+ //this method is given OK too
+ requiredMethod("setBlockIncrement()");
+ tRes.tested("getBlockIncrement()", true);
+ }
+
+ public void _setLineIncrement() {
+ oObj.setLineIncrement(12);
+ oObj.setLineIncrement(2);
+ int li = oObj.getLineIncrement();
+ tRes.tested("setLineIncrement()",li==2);
+ }
+
+ public void _getLineIncrement() {
+ //this method is checked in the corresponding set method
+ //so that method is requiered here and if it works
+ //this method is given OK too
+ requiredMethod("setLineIncrement()");
+ tRes.tested("getLineIncrement()", true);
+ }
+
+ public void _setMaximum() {
+ oObj.setMaximum(490);
+ oObj.setMaximum(480);
+ int max = oObj.getMaximum();
+ tRes.tested("setMaximum()",max==480);
+ }
+
+ public void _getMaximum() {
+ //this method is checked in the corresponding set method
+ //so that method is requiered here and if it works
+ //this method is given OK too
+ requiredMethod("setMaximum()");
+ tRes.tested("getMaximum()", true);
+ }
+
+ public void _setOrientation() {
+ oObj.setOrientation(ScrollBarOrientation.HORIZONTAL);
+ oObj.setOrientation(ScrollBarOrientation.VERTICAL);
+ int ori = oObj.getOrientation();
+ tRes.tested("setOrientation()",ori==ScrollBarOrientation.VERTICAL);
+ }
+
+ public void _getOrientation() {
+ //this method is checked in the corresponding set method
+ //so that method is requiered here and if it works
+ //this method is given OK too
+ requiredMethod("setOrientation()");
+ tRes.tested("getOrientation()", true);
+ }
+
+ public void _setValue() {
+ oObj.setMaximum(600);
+ oObj.setValue(480);
+ oObj.setValue(520);
+ int val = oObj.getValue();
+ tRes.tested("setValue()",val==520);
+ }
+
+ public void _getValue() {
+ //this method is checked in the corresponding set method
+ //so that method is requiered here and if it works
+ //this method is given OK too
+ requiredMethod("setValue()");
+ tRes.tested("getValue()", true);
+ }
+
+ public void _setVisibleSize() {
+ oObj.setVisibleSize(700);
+ oObj.setVisibleSize(500);
+ int vs = oObj.getVisibleSize();
+ tRes.tested("setVisibleSize()",vs==500);
+ }
+
+ public void _getVisibleSize() {
+ //this method is checked in the corresponding set method
+ //so that method is requiered here and if it works
+ //this method is given OK too
+ requiredMethod("setVisibleSize()");
+ tRes.tested("getVisibleSize()", true);
+ }
+
+ public void _setValues() {
+ oObj.setValues(80, 200, 300);
+ oObj.setValues(70, 210, 500);
+ int val = oObj.getValue();
+ int vs = oObj.getVisibleSize();
+ int max = oObj.getMaximum();
+ tRes.tested("setValues()",((val==70) && (vs==210) && (max==500)));
+ }
+
+ private void adjustScrollBar() {
+
+
+ XScrollBar sc = (XScrollBar) UnoRuntime.queryInterface(
+ XScrollBar.class, tEnv.getTestObject());
+
+ sc.setValue(500);
+
+ shortWait();
+
+ XAccessible acc = (XAccessible) UnoRuntime.queryInterface(
+ XAccessible.class, tEnv.getTestObject());
+
+ XAccessibleComponent aCom = (XAccessibleComponent) UnoRuntime.queryInterface(
+ XAccessibleComponent.class,
+ acc.getAccessibleContext());
+
+ Point location = aCom.getLocationOnScreen();
+ //Point location = (Point) tEnv.getObjRelation("Location");
+ //XAccessibleComponent aCom = (XAccessibleComponent) tEnv.getObjRelation("Location");
+ //Point location = aCom.getLocationOnScreen();
+ try {
+ Robot rob = new Robot();
+ rob.mouseMove(location.X + 50, location.Y + 75);
+ rob.mousePress(InputEvent.BUTTON1_MASK);
+ rob.mouseRelease(InputEvent.BUTTON1_MASK);
+ } catch (java.awt.AWTException e) {
+ System.out.println("couldn't adjust scrollbar");
+ }
+
+ shortWait();
+ }
+
+ /**
+ * Sleeps for 0.5 sec. to allow Office to react
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException e) {
+ log.println("While waiting :" + e);
+ }
+ }
+
+ public class AdjustmentListener
+ implements com.sun.star.awt.XAdjustmentListener {
+ public void adjustmentValueChanged(com.sun.star.awt.AdjustmentEvent adjustmentEvent) {
+ System.out.println("Adjustment Value changed");
+ System.out.println("AdjustmentEvent: " + adjustmentEvent.Value);
+ adjusted = true;
+ }
+
+ public void disposing(com.sun.star.lang.EventObject eventObject) {
+ System.out.println("Listener disposed");
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/ifc/awt/_XSpinField.java b/qadevOOo/tests/java/ifc/awt/_XSpinField.java
new file mode 100644
index 000000000000..ba701e6c72e4
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XSpinField.java
@@ -0,0 +1,216 @@
+/*************************************************************************
+ *
+ * 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.awt;
+
+import lib.MultiMethodTest;
+
+import com.sun.star.awt.SpinEvent;
+import com.sun.star.awt.XSpinField;
+import com.sun.star.awt.XSpinListener;
+import com.sun.star.lang.EventObject;
+
+/**
+* Testing <code>com.sun.star.awt.XSpinField</code>
+* interface methods :
+* <ul>
+* <li><code> addSpinListener()</code></li>
+* <li><code> removeSpinListener()</code></li>
+* <li><code> up()</code></li>
+* <li><code> down()</code></li>
+* <li><code> first()</code></li>
+* <li><code> last()</code></li>
+* <li><code> enableRepeat()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.awt.XSpinField
+*/
+public class _XSpinField extends MultiMethodTest {
+
+ public XSpinField oObj = null;
+
+ /**
+ * Listener implementation which set flags on appropriate
+ * listener methods calls.
+ */
+ protected class TestListener implements XSpinListener {
+ public boolean upFl = false ;
+ public boolean downFl = false ;
+ public boolean firstFl = false ;
+ public boolean lastFl = false ;
+
+ public void up(SpinEvent e) {
+ upFl = true ;
+ }
+ public void down(SpinEvent e) {
+ downFl = true ;
+ }
+ public void first(SpinEvent e) {
+ firstFl = true ;
+ }
+ public void last(SpinEvent e) {
+ lastFl = true ;
+ }
+ public void disposing(EventObject e) {}
+ }
+
+ private TestListener listener = new TestListener() ;
+
+ /**
+ * Just adds a listener. <p>
+ * Has <b>OK</b> status if no runtime exceptions occurred.
+ */
+ public void _addSpinListener() {
+ oObj.addSpinListener(listener) ;
+
+ tRes.tested("addSpinListener()", true) ;
+ }
+
+ /**
+ * Calls the method. <p>
+ * Has <b>OK</b> status if the appropriate listener method
+ * was called. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addSpinListener </code> </li>
+ * </ul>
+ */
+ public void _up() {
+ requiredMethod("addSpinListener()") ;
+
+ oObj.up() ;
+ shortWait();
+
+ tRes.tested("up()", listener.upFl) ;
+ }
+
+ /**
+ * Calls the method. <p>
+ * Has <b>OK</b> status if the appropriate listener method
+ * was called. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addSpinListener </code> </li>
+ * </ul>
+ */
+ public void _down() {
+ requiredMethod("addSpinListener()") ;
+
+ oObj.down() ;
+ shortWait();
+
+ tRes.tested("down()", listener.downFl) ;
+ }
+
+ /**
+ * Calls the method. <p>
+ * Has <b>OK</b> status if the appropriate listener method
+ * was called.<p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addSpinListener </code> </li>
+ * </ul>
+ */
+ public void _first() {
+ requiredMethod("addSpinListener()") ;
+
+ oObj.first() ;
+ shortWait();
+
+ tRes.tested("first()", listener.firstFl) ;
+ }
+
+ /**
+ * Calls the method. <p>
+ * Has <b>OK</b> status if the appropriate listener method
+ * was called.<p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addSpinListener </code> </li>
+ * </ul>
+ */
+ public void _last() {
+ requiredMethod("addSpinListener()") ;
+
+ oObj.last() ;
+ shortWait();
+
+ tRes.tested("last()", listener.lastFl) ;
+ }
+
+ /**
+ * Removes the listener, then calls <code>up</code> method and
+ * checks if te listener wasn't called. <p>
+ * Has <b>OK</b> status if listener wasn't called. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addSpinListener </code> </li>
+ * <li> <code> up </code> </li>
+ * <li> <code> down </code> </li>
+ * <li> <code> first </code> </li>
+ * <li> <code> last </code> </li>
+ * </ul>
+ */
+ public void _removeSpinListener() {
+ requiredMethod("addSpinListener()") ;
+ executeMethod("up()") ;
+ executeMethod("down()") ;
+ executeMethod("first()") ;
+ executeMethod("last()") ;
+
+ listener.upFl = false ;
+
+ oObj.removeSpinListener(listener) ;
+
+ oObj.up() ;
+
+ tRes.tested("removeSpinListener()", !listener.upFl) ;
+ }
+
+ /**
+ * Enables then disables repeating. <p>
+ * Has <b>OK</b> status if no runtime exceptions occurred.
+ */
+ public void _enableRepeat() {
+ oObj.enableRepeat(true) ;
+ oObj.enableRepeat(false) ;
+
+ tRes.tested("enableRepeat()", true) ;
+ }
+
+ /**
+ * Waits for 0.5 sec to allow listener to be called.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(500);
+ }
+ catch (InterruptedException ex) {
+ }
+
+ }
+}
diff --git a/qadevOOo/tests/java/ifc/awt/_XSpinValue.java b/qadevOOo/tests/java/ifc/awt/_XSpinValue.java
new file mode 100644
index 000000000000..e0ab3513b6fe
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XSpinValue.java
@@ -0,0 +1,220 @@
+/*************************************************************************
+ *
+ * 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.awt;
+
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleComponent;
+import com.sun.star.awt.Point;
+import com.sun.star.awt.ScrollBarOrientation;
+import com.sun.star.awt.XSpinValue;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import java.awt.Robot;
+import java.awt.event.InputEvent;
+import lib.MultiMethodTest;
+
+public class _XSpinValue extends MultiMethodTest {
+
+ public XSpinValue oObj;
+ public boolean adjusted = false;
+ com.sun.star.awt.XAdjustmentListener listener = new AdjustmentListener();
+
+ public void _addAdjustmentListener() {
+ util.FormTools.switchDesignOf((XMultiServiceFactory) tParam.getMSF(),
+ (XTextDocument) tEnv.getObjRelation("Document"));
+ shortWait();
+ oObj.addAdjustmentListener(listener);
+ adjustScrollBar();
+
+ boolean res = adjusted;
+ oObj.removeAdjustmentListener(listener);
+ adjusted = false;
+ adjustScrollBar();
+ res &= !adjusted;
+ tRes.tested("addAdjustmentListener()", res);
+ }
+
+ public void _removeAdjustmentListener() {
+ //this method is checked in addAjustmentListener
+ //so that method is requiered here and if it works
+ //this method is given OK too
+ requiredMethod("addAdjustmentListener()");
+ tRes.tested("removeAdjustmentListener()", true);
+ }
+
+ public void _setSpinIncrement() {
+ oObj.setSpinIncrement(15);
+ oObj.setSpinIncrement(5);
+ int bi = oObj.getSpinIncrement();
+ tRes.tested("setSpinIncrement()",bi==5);
+ }
+
+ public void _getSpinIncrement() {
+ //this method is checked in the corresponding set method
+ //so that method is requiered here and if it works
+ //this method is given OK too
+ requiredMethod("setSpinIncrement()");
+ tRes.tested("getSpinIncrement()", true);
+ }
+
+
+ public void _setMaximum() {
+ oObj.setMaximum(490);
+ oObj.setMaximum(480);
+ int max = oObj.getMaximum();
+ tRes.tested("setMaximum()",max==480);
+ }
+
+ public void _getMaximum() {
+ //this method is checked in the corresponding set method
+ //so that method is requiered here and if it works
+ //this method is given OK too
+ requiredMethod("setMaximum()");
+ tRes.tested("getMaximum()", true);
+ }
+
+ public void _setMinimum() {
+ oObj.setMinimum(90);
+ oObj.setMinimum(80);
+ int max = oObj.getMinimum();
+ tRes.tested("setMinimum()",max==80);
+ }
+
+ public void _getMinimum() {
+ //this method is checked in the corresponding set method
+ //so that method is requiered here and if it works
+ //this method is given OK too
+ requiredMethod("setMinimum()");
+ tRes.tested("getMinimum()", true);
+ }
+
+ public void _setOrientation() {
+ boolean res = true;
+ try {
+ oObj.setOrientation(ScrollBarOrientation.HORIZONTAL);
+ oObj.setOrientation(ScrollBarOrientation.VERTICAL);
+ } catch (com.sun.star.lang.NoSupportException e) {
+ log.println("Couldn't set Orientation");
+ }
+ int ori = oObj.getOrientation();
+ res &= (ori==ScrollBarOrientation.VERTICAL);
+ tRes.tested("setOrientation()",res );
+ }
+
+ public void _getOrientation() {
+ //this method is checked in the corresponding set method
+ //so that method is requiered here and if it works
+ //this method is given OK too
+ requiredMethod("setOrientation()");
+ tRes.tested("getOrientation()", true);
+ }
+
+ public void _setValue() {
+ oObj.setMaximum(600);
+ oObj.setValue(480);
+ oObj.setValue(520);
+ int val = oObj.getValue();
+ tRes.tested("setValue()",val==520);
+ }
+
+ public void _getValue() {
+ //this method is checked in the corresponding set method
+ //so that method is requiered here and if it works
+ //this method is given OK too
+ requiredMethod("setValue()");
+ tRes.tested("getValue()", true);
+ }
+
+ public void _setValues() {
+ oObj.setValues(80, 200, 180);
+ oObj.setValues(70, 210, 200);
+ int val = oObj.getValue();
+ int min = oObj.getMinimum();
+ int max = oObj.getMaximum();
+ tRes.tested("setValues()",((min==70) && (max==210) && (val==200)));
+ }
+
+ private void adjustScrollBar() {
+
+
+ XSpinValue sv = (XSpinValue) UnoRuntime.queryInterface(
+ XSpinValue.class, tEnv.getTestObject());
+
+ sv.setValue(500);
+
+ shortWait();
+
+ XAccessible acc = (XAccessible) UnoRuntime.queryInterface(
+ XAccessible.class, tEnv.getTestObject());
+
+ XAccessibleComponent aCom = (XAccessibleComponent) UnoRuntime.queryInterface(
+ XAccessibleComponent.class,
+ acc.getAccessibleContext());
+
+ Point location = aCom.getLocationOnScreen();
+ //Point location = (Point) tEnv.getObjRelation("Location");
+ //XAccessibleComponent aCom = (XAccessibleComponent) tEnv.getObjRelation("Location");
+ //Point location = aCom.getLocationOnScreen();
+ try {
+ Robot rob = new Robot();
+ rob.mouseMove(location.X + 20, location.Y + 10);
+ rob.mousePress(InputEvent.BUTTON1_MASK);
+ rob.mouseRelease(InputEvent.BUTTON1_MASK);
+ } catch (java.awt.AWTException e) {
+ System.out.println("couldn't adjust scrollbar");
+ }
+
+ shortWait();
+ }
+
+ /**
+ * Sleeps for 0.5 sec. to allow Office to react
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException e) {
+ log.println("While waiting :" + e);
+ }
+ }
+
+ public class AdjustmentListener
+ implements com.sun.star.awt.XAdjustmentListener {
+ public void adjustmentValueChanged(com.sun.star.awt.AdjustmentEvent adjustmentEvent) {
+ System.out.println("Adjustment Value changed");
+ System.out.println("AdjustmentEvent: " + adjustmentEvent.Value);
+ adjusted = true;
+ }
+
+ public void disposing(com.sun.star.lang.EventObject eventObject) {
+ System.out.println("Listener disposed");
+ }
+ }
+
+}
diff --git a/qadevOOo/tests/java/ifc/awt/_XSystemChildFactory.java b/qadevOOo/tests/java/ifc/awt/_XSystemChildFactory.java
new file mode 100644
index 000000000000..fec9281871eb
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XSystemChildFactory.java
@@ -0,0 +1,40 @@
+/*************************************************************************
+*
+* 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.awt;
+
+import com.sun.star.awt.XSystemChildFactory;
+import lib.MultiMethodTest;
+
+public final class _XSystemChildFactory extends MultiMethodTest {
+ public XSystemChildFactory oObj;
+
+ public void _createSystemChild() {
+ //TODO
+ tRes.tested("createSystemChild()", true);
+ }
+}
diff --git a/qadevOOo/tests/java/ifc/awt/_XTabController.java b/qadevOOo/tests/java/ifc/awt/_XTabController.java
new file mode 100644
index 000000000000..baf9b8f97bcc
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XTabController.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.awt;
+
+import lib.MultiMethodTest;
+import lib.Status;
+
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlContainer;
+import com.sun.star.awt.XTabController;
+import com.sun.star.awt.XTabControllerModel;
+
+/**
+* This interface is DEPRECATED !!!
+* All test results are SKIPPED.OK now.
+* Testing <code>com.sun.star.awt.XTabController</code>
+* interface methods :
+* <ul>
+* <li><code> activateFirst()</code></li>
+* <li><code> activateLast()</code></li>
+* <li><code> activateTabOrder()</code></li>
+* <li><code> autoTabOrder()</code></li>
+* <li><code> getContainer()</code></li>
+* <li><code> getCotrols()</code></li>
+* <li><code> getModel()</code></li>
+* <li><code> setContainer()</code></li>
+* <li><code> setModel()</code></li>
+* </ul><p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'MODEL'</code> : <code>XTabControllerModel</code> a model for
+* the object</li>
+* <li> <code>'CONTAINER'</code> : <code>XControlContainer</code> a container
+* for the object</li>
+* <ul> <p>
+* @see com.sun.star.awt.XTabController
+*/
+public class _XTabController extends MultiMethodTest {
+ public XTabController oObj = null;
+
+ /**
+ * Test calls the method with object relation 'MODEL' as a parameter.<p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ */
+ public void _setModel() {
+ oObj.setModel( (XTabControllerModel) tEnv.getObjRelation("MODEL"));
+ tRes.tested("setModel()", Status.skipped(true) );
+ }
+
+ /**
+ * Test calls the method, then checks returned value.<p>
+ * Has <b> OK </b> status if method returns a value that equals to
+ * corresponding object relation.<p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setModel() </code> : sets model for the object </li>
+ * </ul>
+ */
+ public void _getModel() {
+ requiredMethod("setModel()");
+ XTabControllerModel setModel = oObj.getModel();
+ tRes.tested("getModel()", Status.skipped(true));
+ }
+
+ /**
+ * Test calls the method with object relation 'CONTAINER' as a parameter.<p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ */
+ public void _setContainer() {
+ oObj.setContainer( (XControlContainer)
+ tEnv.getObjRelation("CONTAINER"));
+ tRes.tested("setContainer()", Status.skipped(true));
+ }
+
+ /**
+ * Test calls the method, then checks returned value.<p>
+ * Has <b> OK </b> status if method returns a value that equals to
+ * corresponding object relation.<p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setContainer() </code> : sets container for the object</li>
+ * </ul>
+ */
+ public void _getContainer() {
+ requiredMethod( "setContainer()");
+ XControlContainer setContainer = oObj.getContainer();
+ XControlContainer relContainer = (XControlContainer )
+ tEnv.getObjRelation("CONTAINER");
+ tRes.tested("getContainer()", Status.skipped(true) );
+ }
+
+ /**
+ * Test calls the method, then checks returned sequence.<p>
+ * Has <b> OK </b> status if returned sequence is not null.<p>
+ */
+ public void _getControls() {
+ XControl[] aControl = oObj.getControls();
+ tRes.tested("getControls()", Status.skipped(true) );
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ */
+ public void _autoTabOrder() {
+ oObj.autoTabOrder();
+ tRes.tested("autoTabOrder()", Status.skipped(true));
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ */
+ public void _activateTabOrder() {
+ oObj.activateTabOrder();
+ tRes.tested("activateTabOrder()", Status.skipped(true));
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ */
+ public void _activateFirst() {
+ oObj.activateFirst();
+ tRes.tested("activateFirst()", Status.skipped(true));
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ */
+ public void _activateLast() {
+ oObj.activateLast();
+ tRes.tested("activateLast()", Status.skipped(true));
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_XTabControllerModel.java b/qadevOOo/tests/java/ifc/awt/_XTabControllerModel.java
new file mode 100644
index 000000000000..42442185c539
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XTabControllerModel.java
@@ -0,0 +1,166 @@
+/*************************************************************************
+ *
+ * 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.awt;
+
+import lib.MultiMethodTest;
+import lib.Status;
+
+import com.sun.star.awt.XTabControllerModel;
+
+/**
+* Testing <code>com.sun.star.awt.XTabControllerModel</code>
+* interface methods :
+* <ul>
+* <li><code> getGroupControl()</code></li>
+* <li><code> setGroupControl()</code></li>
+* <li><code> setControlModels()</code></li>
+* <li><code> getControlModels()</code></li>
+* <li><code> setGroup()</code></li>
+* <li><code> getGroupCount()</code></li>
+* <li><code> getGroup()</code></li>
+* <li><code> getGroupByName()</code></li>
+* </ul> <p>
+*
+* Since the interface is <b>DEPRECATED</b> all methods have
+* status SKIPPED.OK <p>
+*
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'Model1'</code> : <code>XControlModel</code> relation
+* , any control model belonging to the object tested.</li>
+* <li> <code>'Model2'</code> : <code>XControlModel</code> relation
+* , any control model belonging to the object tested.</li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.awt.XTabControllerModel
+*/
+public class _XTabControllerModel extends MultiMethodTest {
+
+ public XTabControllerModel oObj = null;
+
+
+ /**
+ * Sets group control to <code>true</code> then calls
+ * <code>getGroupControl()</code> method and checks the value. <p>
+ * Has <b> OK </b> status if the method returns <code>true</code>
+ * <p>
+ */
+ public void _getGroupControl() {
+ log.println("Always SKIPPED.OK since deprecated.");
+ tRes.tested("getGroupControl()", Status.skipped(true));
+ }
+
+ /**
+ * Sets group control to <code>false</code> then calls
+ * <code>getGroupControl()</code> method and checks the value. <p>
+ * Has <b> OK </b> status if the method returns <code>false</code>
+ * <p>
+ */
+ public void _setGroupControl() {
+ log.println("Always SKIPPED.OK since deprecated.");
+ tRes.tested("setGroupControl()", Status.skipped(true));
+ }
+
+ /**
+ * Test calls the method and sets control models to a single
+ * model from 'Model1' relation. <p>
+ * Has <b> OK </b> status if no exceptions were thrown. <p>
+ */
+ public void _setControlModels() {
+ log.println("Always SKIPPED.OK since deprecated.");
+ tRes.tested("setControlModels()", Status.skipped(true));
+ }
+
+ /**
+ * Calls method and checks if models were properly set in
+ * <code>setControlModels</code> method test. <p>
+ * Has <b>OK</b> status if the model sequence set is equal
+ * to the sequence get. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setControlModels </code> : to set sequence of models.</li>
+ * </ul>
+ */
+ public void _getControlModels() {
+ log.println("Always SKIPPED.OK since deprecated.");
+ tRes.tested("getControlModels()", Status.skipped(true));
+ }
+
+ /**
+ * Sets the group named 'XTabControlModel' to sequence with a single
+ * element from 'Model2' relation. <p>
+ * Has <b> OK </b> status if no exceptions were thrown. <p>
+ */
+ public void _setGroup() {
+ log.println("Always SKIPPED.OK since deprecated.");
+ tRes.tested("setGroup()", Status.skipped(true));
+ }
+
+ /**
+ * Calls method and checks if the group was properly set in
+ * <code>setGroup</code> method test. <p>
+ * Has <b>OK</b> status if the sequence set is equal
+ * to the sequence get. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setGroup </code> : to set the sequence.</li>
+ * </ul>
+ */
+ public void _getGroup() {
+ log.println("Always SKIPPED.OK since deprecated.");
+ tRes.tested("getGroup()", Status.skipped(true));
+ }
+
+ /**
+ * Retrieves group named 'XTabControllerModel' added in <code>
+ * setGroup</code> method test, and checks it. <p>
+ * Has <b> OK </b> status if sequence get is equal to sequence set.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setGroup </code> : to set the sequence.</li>
+ * </ul>
+ */
+ public void _getGroupByName() {
+ log.println("Always SKIPPED.OK since deprecated.");
+ tRes.tested("getGroupByName()", Status.skipped(true));
+ }
+
+ /**
+ * Gets number of groups.
+ * Has <b> OK </b> status if the number is greater than 0.
+ * <ul>
+ * <li> <code> setGroup </code> : to has at least one group.</li>
+ * </ul>
+ */
+ public void _getGroupCount() {
+ log.println("Always SKIPPED.OK since deprecated.");
+ tRes.tested("getGroupCount()", Status.skipped(true));
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_XTextComponent.java b/qadevOOo/tests/java/ifc/awt/_XTextComponent.java
new file mode 100644
index 000000000000..850b281b00f8
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XTextComponent.java
@@ -0,0 +1,270 @@
+/*************************************************************************
+ *
+ * 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.awt;
+
+import lib.MultiMethodTest;
+import util.ValueComparer;
+
+import com.sun.star.awt.Selection;
+import com.sun.star.awt.TextEvent;
+import com.sun.star.awt.XTextComponent;
+import com.sun.star.awt.XTextListener;
+import com.sun.star.lang.EventObject;
+
+/**
+* Testing <code>com.sun.star.awt.XTextComponent</code>
+* interface methods:
+* <ul>
+* <li><code> addTextListener() </code></li>
+* <li><code> removeTextListener() </code></li>
+* <li><code> setText() </code></li>
+* <li><code> getText() </code></li>
+* <li><code> insertText() </code></li>
+* <li><code> getSelectedText() </code></li>
+* <li><code> setSelection() </code></li>
+* <li><code> getSelection() </code></li>
+* <li><code> setEditable() </code></li>
+* <li><code> isEditable() </code></li>
+* <li><code> setMaxTextLen() </code></li>
+* <li><code> getMaxTextLen() </code></li>
+* </ul><p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'XTextComponent.onlyNumbers'</code> (of type <code>Object</code>):
+* needed for checking if component can contain only numeric values </li>
+* </ul><p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.awt.XTextComponent
+*/
+public class _XTextComponent extends MultiMethodTest {
+ public XTextComponent oObj = null;
+ public boolean textChanged = false;
+ // indicates that component can contain only numeric values
+ private boolean num = false ;
+
+ /**
+ * Listener implementation which just set flag when listener
+ * method is called.
+ */
+ protected class MyChangeListener implements XTextListener {
+ public void disposing ( EventObject oEvent ) {}
+ public void textChanged(TextEvent ev) {
+ textChanged = true;
+ }
+ }
+
+ XTextListener listener = new MyChangeListener();
+
+ /**
+ * Retrieves object relation, then sets flag 'num' to 'true'
+ * if relation is not null.
+ */
+ public void before() {
+ if (tEnv.getObjRelation("XTextComponent.onlyNumbers") != null)
+ num = true;
+ }
+
+ /**
+ * After test calls the method, a new text is set to the object. Then
+ * we check if listener was called, and set a new text value
+ * to the object.<p>
+ * Has <b> OK </b> status if listener was called.
+ */
+ public void _addTextListener(){
+ oObj.addTextListener(listener);
+ oObj.setText("Listen");
+ try {
+ Thread.sleep(500);
+ } catch(java.lang.InterruptedException e) {
+ e.printStackTrace(log);
+ }
+ if (!textChanged) {
+ log.println("Listener wasn't called after changing Text");
+ }
+
+ tRes.tested("addTextListener()",textChanged);
+ }
+
+ /**
+ * After setting flag 'textChanged' to false, test calls the method.
+ * Then a new text value is set to the object. <p>
+ * Has <b> OK </b> status if listener was not called. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li><code> addTextListener() </code>: adds listener to the object.</li>
+ * </ul>
+ */
+ public void _removeTextListener() {
+ requiredMethod("addTextListener()");
+ textChanged = false;
+ oObj.removeTextListener(listener);
+ oObj.setText("Do not listen");
+ tRes.tested("removeTextListener()",!textChanged);
+ }
+
+ /**
+ * At first we're setting some string variable 'newText' depending of a kind
+ * of object we are working with. Then test calls the method. <p>
+ * Has <b> OK </b> status if set value is equal to a value obtained after.
+ */
+ public void _setText() {
+ String newText = num ? "823" : "setText" ;
+ if (tEnv.getTestCase().getObjectName().equals("OTimeControl")) {
+ newText = "8:15";
+ }
+ log.println("Setting text to : '" + newText + "'") ;
+ oObj.setText(newText);
+ log.println("Getting text : '" + oObj.getText() + "'") ;
+ tRes.tested("setText()",oObj.getText().equals(newText));
+ }
+
+ /**
+ * At first we're setting some string variable 'newText' depending of a kind
+ * of object we are working with. Then we set text to the object and call
+ * the method. <p>
+ * Has <b> OK </b> status if set value is equal to a value obtained using
+ * getText() method.
+ */
+ public void _getText() {
+ String newText = num ? "823" : "setText" ;
+ if (tEnv.getTestCase().getObjectName().equals("OTimeControl")) {
+ newText = "8:15";
+ }
+ oObj.setText(newText);
+ tRes.tested("getText()",oObj.getText().equals(newText));
+ }
+
+ /**
+ * At first we're setting string variables 'text' and 'itext' depending
+ * of a kind of object we are working with. Next, value from 'text' variable
+ * is set to an object using setText(), then the method insertText() is called.
+ * <p>
+ * Has <b> OK </b> status if text is inserted to the object.
+ */
+ public void _insertText() {
+ String text = num ? "753" : "iText" ;
+ String itext = num ? "6" : "insert" ;
+ log.println("Setting text to : '" + text + "'") ;
+ oObj.setText(text);
+ log.println("Iserting text to (0,1) : '" + itext + "'") ;
+ oObj.insertText(new Selection(0,1), itext);
+ log.println("getText() returns: " + oObj.getText());
+ tRes.tested("insertText()", oObj.getText().equals
+ (num ? "653" : "insertText"));
+ }
+
+ /**
+ * After text is set to the object, test calls the method.<p>
+ * Has <b> OK </b> status if selected text is equal to first three symbols
+ * of text added before.
+ */
+ public void _getSelectedText() {
+ String text = num ? "753" : "txt" ;
+ oObj.setText(text);
+ oObj.setSelection(new Selection(0,3));
+ boolean result = oObj.getSelectedText().equals(text);
+
+ if (! result) {
+ System.out.println("Getting '"+oObj.getSelectedText()+"'");
+ System.out.println("Expected '"+text+"'");
+ }
+
+ tRes.tested("getSelectedText()",result);
+ }
+
+ /**
+ * After setting new text to an object, and defining selection variable,
+ * test calls the method. <p>
+ * Has <b> OK </b> status if selection set before is equal to a selection we
+ * got using getSelection().
+ */
+ public void _setSelection() {
+ oObj.setText("setSelection");
+ Selection sel = new Selection(0,3);
+ oObj.setSelection(sel);
+ tRes.tested("setSelection()", ValueComparer.equalValue
+ (oObj.getSelection(), sel));
+ }
+
+ /**
+ * After setting new text to an object, and defining selection variable,
+ * test calls the method. <p>
+ * Has <b> OK </b> status if selection set before is equal to a selection we
+ * got using getSelection().
+ */
+ public void _getSelection() {
+ oObj.setText("getSelection");
+ Selection sel = new Selection(2,3);
+ oObj.setSelection(sel);
+ tRes.tested("getSelection()", ValueComparer.equalValue
+ (oObj.getSelection(), sel));
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if method has changed a property 'Editable'.
+ */
+ public void _setEditable(){
+ oObj.setEditable(true);
+ tRes.tested("setEditable()", oObj.isEditable());
+ }
+
+ /**
+ * First we set 'Editable' variable to false. Then test calls the method.<p>
+ * Has <b> OK </b> status if method returns value we set before.
+ */
+ public void _isEditable(){
+ oObj.setEditable(false);
+ tRes.tested("isEditable()", ! oObj.isEditable());
+ }
+
+ /**
+ * Test calls the method. Then new text value is set to the object. <p>
+ * Has <b> OK </b> status if text, returned by getText() is a string of
+ * length we set before.
+ */
+ public void _setMaxTextLen() {
+ oObj.setMaxTextLen((short)10);
+ //oObj.setText("0123456789ABCDE");
+ //String get = oObj.getText();
+ //tRes.tested("setMaxTextLen()",get.length() == 10);
+ tRes.tested("setMaxTextLen()",oObj.getMaxTextLen()==10);
+ }
+
+ /**
+ * At first we set MaxTextLen, then test calls the method. <p>
+ * Has <b> OK </b> status if method returns a value we set before.
+ */
+ public void _getMaxTextLen() {
+ oObj.setMaxTextLen((short)15);
+ log.println("getMaxTextLen() returns: "+oObj.getMaxTextLen());
+ tRes.tested("getMaxTextLen()",oObj.getMaxTextLen()==15);
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_XTextLayoutConstrains.java b/qadevOOo/tests/java/ifc/awt/_XTextLayoutConstrains.java
new file mode 100644
index 000000000000..135a1abe917b
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XTextLayoutConstrains.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.awt;
+
+import lib.MultiMethodTest;
+
+import com.sun.star.awt.Size;
+import com.sun.star.awt.XTextLayoutConstrains;
+
+/**
+* Testing <code>com.sun.star.awt.XTextLayoutConstrains</code>
+* interface methods:
+* <ul>
+* <li><code> getMinimumSize() </code></li>
+* <li><code> getColumnsAndLines() </code></li>
+* </ul><p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.awt.XTextLayoutConstrains
+*/
+public class _XTextLayoutConstrains extends MultiMethodTest {
+ public XTextLayoutConstrains oObj = null;
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if both returned size fields are not equal to zero.
+ */
+ public void _getMinimumSize() {
+ short nCols = 0;
+ short nLines = 0;
+ Size mSize = oObj.getMinimumSize(nCols,nLines);
+ boolean res = ( (mSize.Height != 0) && (mSize.Width != 0) );
+ if (res == false) {
+ log.println("mSize.height: " + mSize.Height);
+ log.println("mSize.width: " + mSize.Width);
+ }
+ tRes.tested("getMinimumSize()", res);
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if both returned values are not equal to zero.
+ */
+ public void _getColumnsAndLines() {
+ short[] nCols = new short[1];
+ short[] nLines = new short[1];
+ oObj.getColumnsAndLines(nCols,nLines);
+ boolean res = ( (nCols[0] != 0) && (nLines[0] != 0) );
+ if (res == false) {
+ log.println("nCols: " + nCols[0]);
+ log.println("nLines: " + nLines[0]);
+ }
+ tRes.tested("getColumnsAndLines()",res);
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_XTextListener.java b/qadevOOo/tests/java/ifc/awt/_XTextListener.java
new file mode 100644
index 000000000000..df40799cb369
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XTextListener.java
@@ -0,0 +1,128 @@
+/*************************************************************************
+ *
+ * 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.awt;
+
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+import com.sun.star.awt.TextEvent;
+import com.sun.star.awt.XTextListener;
+
+/**
+* Testing <code>com.sun.star.awt.XTextListener</code>
+* interface methods:
+* <ul>
+* <li><code> textChanged() </code></li>
+* </ul><p>
+*
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'TestTextListener'</code>
+* (of type <code>ifc.awt._XTextListener.TestTextListener</code>):
+* this listener implementation must be registered for object tested for
+* checking
+* <code>textChanged()</code> method call. The listener must be registered
+* in object environment creation because it's not a fact that tested
+* component supports <code>XTextComponent</code> interface and the listener
+* can be registered in another object.</li>
+* <ul> <p>
+*
+* @see com.sun.star.awt.XTextListener
+*/
+public class _XTextListener extends MultiMethodTest {
+ public XTextListener oObj = null;
+
+ /**
+ * Listener implementation which sets flags on appropriate method calls
+ * and stores event passed.
+ */
+ public static class TestTextListener implements
+ com.sun.star.awt.XTextListener {
+ public boolean textChangedCalled = false ;
+ public TextEvent event = null ;
+
+ public void textChanged(TextEvent e) {
+ textChangedCalled = true ;
+ event = e ;
+ }
+
+ public void disposing(com.sun.star.lang.EventObject e) {}
+
+ }
+
+ TestTextListener textListener = null;
+ /**
+ * Retrieves object relation.
+ * @throws StatusException If the relation not found.
+ */
+ public void before() {
+ textListener = (TestTextListener)
+ tEnv.getObjRelation("TestTextListener");
+ if (textListener == null) {
+ throw new StatusException(Status.failed("Relation not found"));
+ }
+ }
+
+ /**
+ * First a <code>TextEvent</code> object created and
+ * it is passed to <code>textChanged</code> method
+ * call. Then a short wait follows for listener already
+ * registered at the object to be called. <p>
+ * Has <b> OK </b> status if the listener was called with
+ * the same <code>TextEvent</code> object as was created
+ * before.
+ */
+ public void _textChanged() {
+
+ boolean result = true ;
+
+ TextEvent event = new TextEvent() ;
+ event.dummy1 = 2;
+ oObj.textChanged(event);
+
+ try {
+ Thread.sleep(200) ;
+ } catch (InterruptedException e) {}
+
+ result = textListener.textChangedCalled &&
+ textListener.event.dummy1 == 2;
+
+ tRes.tested("textChanged()", result) ;
+ }
+
+ /**
+ * Forces environment recreation.
+ */
+ protected void after() {
+ disposeEnvironment();
+ }
+
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_XTimeField.java b/qadevOOo/tests/java/ifc/awt/_XTimeField.java
new file mode 100644
index 000000000000..a2e2965a609b
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XTimeField.java
@@ -0,0 +1,295 @@
+/*************************************************************************
+ *
+ * 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.awt;
+
+
+import lib.MultiMethodTest;
+
+import com.sun.star.awt.XTimeField;
+
+/**
+* Testing <code>com.sun.star.awt.XTimeField</code>
+* interface methods :
+* <ul>
+* <li><code> setTime()</code></li>
+* <li><code> getTime()</code></li>
+* <li><code> setMin()</code></li>
+* <li><code> getMin()</code></li>
+* <li><code> setMax()</code></li>
+* <li><code> getMax()</code></li>
+* <li><code> setFirst()</code></li>
+* <li><code> getFirst()</code></li>
+* <li><code> setLast()</code></li>
+* <li><code> getLast()</code></li>
+* <li><code> setEmpty()</code></li>
+* <li><code> isEmpty()</code></li>
+* <li><code> setStrictFormat()</code></li>
+* <li><code> isStrictFormat()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.awt.XTimeField
+*/
+public class _XTimeField extends MultiMethodTest {
+
+ public XTimeField oObj = null;
+ private boolean strict = false ;
+
+ /**
+ * Sets a new value and checks if it was correctly set. <p>
+ * Has <b> OK </b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getTime </code> </li>
+ * </ul>
+ */
+ public void _setTime() {
+ requiredMethod("getTime()") ;
+
+ boolean result = true ;
+ oObj.setTime(11150000) ;
+
+ result = oObj.getTime() == 11150000 ;
+
+ if (! result ) {
+ System.out.println("Getting "+oObj.getTime()+ " expected 11150000");
+ }
+
+ tRes.tested("setTime()", result) ;
+ }
+
+ /**
+ * Gets the current value. <p>
+ * Has <b> OK </b> status if no runtime exceptions occurred
+ */
+ public void _getTime() {
+
+ boolean result = true ;
+ oObj.getTime() ;
+
+ tRes.tested("getTime()", result) ;
+ }
+
+ /**
+ * Sets a new value and checks if it was correctly set. <p>
+ * Has <b> OK </b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getMin </code> </li>
+ * </ul>
+ */
+ public void _setMin() {
+
+ boolean result = true ;
+ oObj.setMin(4978) ;
+
+ result = oObj.getMin() == 4978 ;
+
+ tRes.tested("setMin()", result) ;
+ }
+
+ /**
+ * Gets the current value. <p>
+ * Has <b> OK </b> status if no runtime exceptions occurred
+ */
+ public void _getMin() {
+
+ boolean result = true ;
+ oObj.getMin() ;
+
+ tRes.tested("getMin()", result) ;
+ }
+
+ /**
+ * Sets a new value and checks if it was correctly set. <p>
+ * Has <b> OK </b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getMax </code> </li>
+ * </ul>
+ */
+ public void _setMax() {
+
+ boolean result = true ;
+ oObj.setMax(27856) ;
+
+ result = oObj.getMax() == 27856 ;
+
+ tRes.tested("setMax()", result) ;
+ }
+
+ /**
+ * Gets the current value. <p>
+ * Has <b> OK </b> status if no runtime exceptions occurred
+ */
+ public void _getMax() {
+
+ boolean result = true ;
+ oObj.getMax() ;
+
+ tRes.tested("getMax()", result) ;
+ }
+
+ /**
+ * Sets a new value and checks if it was correctly set. <p>
+ * Has <b> OK </b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getFirst </code> </li>
+ * </ul>
+ */
+ public void _setFirst() {
+
+ boolean result = true ;
+ oObj.setFirst(5118) ;
+
+ result = oObj.getFirst() == 5118 ;
+
+ if (!result) {
+ log.println("Set to " + 5118 + " but returned " + oObj.getFirst()) ;
+ }
+
+ tRes.tested("setFirst()", result) ;
+ }
+
+ /**
+ * Gets the current value. <p>
+ * Has <b> OK </b> status if no runtime exceptions occurred
+ */
+ public void _getFirst() {
+
+ boolean result = true ;
+ int val = oObj.getFirst() ;
+
+ log.println("getFirst() = " + val) ;
+
+ tRes.tested("getFirst()", result) ;
+ }
+
+ /**
+ * Sets a new value and checks if it was correctly set. <p>
+ * Has <b> OK </b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getLast </code> </li>
+ * </ul>
+ */
+ public void _setLast() {
+
+ boolean result = true ;
+ oObj.setLast(23450) ;
+
+ result = oObj.getLast() == 23450 ;
+
+ if (!result) {
+ log.println("Set to " + 23450 + " but returned " + oObj.getLast()) ;
+ }
+
+ tRes.tested("setLast()", result) ;
+ }
+
+ /**
+ * Gets the current value. <p>
+ * Has <b> OK </b> status if no runtime exceptions occurred
+ */
+ public void _getLast() {
+
+ boolean result = true ;
+ int val = oObj.getLast() ;
+
+ log.println("getLast() = " + val) ;
+
+ tRes.tested("getLast()", result) ;
+ }
+
+ /**
+ * Sets the value to empty. <p>
+ * Has <b> OK </b> status if no runtime exceptions occurred
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setTime </code> : value must be not empty </li>
+ * </ul>
+ */
+ public void _setEmpty() {
+ requiredMethod("setTime()") ;
+
+ boolean result = true ;
+ oObj.setEmpty() ;
+
+ tRes.tested("setEmpty()", result) ;
+ }
+
+ /**
+ * Checks if the field is empty. <p>
+ * Has <b> OK </b> status if the value is empty.<p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setEmpty() </code> </li>
+ * </ul>
+ */
+ public void _isEmpty() {
+ requiredMethod("setEmpty()") ;
+
+ boolean result = true ;
+ result = oObj.isEmpty() ;
+
+ tRes.tested("isEmpty()", result) ;
+ }
+
+ /**
+ * Checks strict state. <p>
+ * Has <b> OK </b> status if strict format is set.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> isStrictFormat </code> </li>
+ * </ul>
+ */
+ public void _setStrictFormat() {
+ requiredMethod("isStrictFormat()") ;
+
+ boolean result = true ;
+ oObj.setStrictFormat(!strict) ;
+
+ result = oObj.isStrictFormat() == !strict ;
+
+ tRes.tested("setStrictFormat()", result) ;
+ }
+
+ /**
+ * Gets strict state and stores it. <p>
+ * Has <b> OK </b> status if no runtime exceptions occurred.
+ */
+ public void _isStrictFormat() {
+
+ boolean result = true ;
+ strict = oObj.isStrictFormat() ;
+
+ tRes.tested("isStrictFormat()", result) ;
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/awt/_XToolkit.java b/qadevOOo/tests/java/ifc/awt/_XToolkit.java
new file mode 100644
index 000000000000..f69acb0fe0a5
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XToolkit.java
@@ -0,0 +1,156 @@
+/*************************************************************************
+ *
+ * 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.awt;
+
+import lib.MultiMethodTest;
+
+import com.sun.star.awt.Rectangle;
+import com.sun.star.awt.WindowDescriptor;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XRegion;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.lang.XComponent;
+import com.sun.star.uno.UnoRuntime;
+
+/**
+* Testing <code>com.sun.star.awt.XToolkit</code>
+* interface methods:
+* <ul>
+* <li><code> getDesktopWindow() </code></li>
+* <li><code> getWorkArea() </code></li>
+* <li><code> createWindow() </code></li>
+* <li><code> createWindows() </code></li>
+* <li><code> createScreenCompatibleDevice() </code></li>
+* <li><code> createRegion() </code></li>
+* </ul><p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.awt.XToolkit
+*/
+public class _XToolkit extends MultiMethodTest {
+ public XToolkit oObj = null;
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status always, because Desktop component
+ * currently is not supported as visible.
+ */
+ public void _getDesktopWindow() {
+ XWindowPeer win = oObj.getDesktopWindow();
+ if (win == null) {
+ log.println("getDesktopWindow() returns NULL");
+ }
+ tRes.tested("getDesktopWindow()", true);
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method does not return null.
+ */
+ public void _getWorkArea() {
+ Rectangle area = oObj.getWorkArea();
+ tRes.tested("getWorkArea()", area != null);
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method does not return null.
+ */
+ public void _createWindow() {
+ boolean res = false;
+ try {
+ XWindowPeer cWin = oObj.createWindow(
+ createDesc(new Rectangle(0,0,100,100)));
+ if (cWin == null) {
+ log.println("createWindow() create a NULL Object");
+ } else {
+ UnoRuntime.queryInterface(XComponent.class, cWin).dispose();
+ res = true;
+ }
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ log.println("Exception occurred while checking 'createWindow':");
+ ex.printStackTrace(log);
+ }
+ tRes.tested("createWindow()", res);
+ }
+
+ /**
+ * After defining of WindowDescriptor array, test calls the method. <p>
+ * Has <b> OK </b> status if all elements of the returned array are
+ * not null.
+ */
+ public void _createWindows() {
+ boolean res = false;
+ try {
+ WindowDescriptor[] descs = new WindowDescriptor[2];
+ descs[0] = createDesc(new Rectangle(0,0,100,100));
+ descs[1] = createDesc(new Rectangle(100,100,200,200));
+ XWindowPeer[] cWins = oObj.createWindows(descs);
+ if ( (cWins[0] == null) || (cWins[1] == null) ) {
+ log.println("createWindows() creates NULL Windows");
+ } else {
+ UnoRuntime.queryInterface(XComponent.class, cWins[0]).dispose();
+ UnoRuntime.queryInterface(XComponent.class, cWins[1]).dispose();
+ res = true;
+ }
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ log.println("Exception occurred while checking 'createWindows':");
+ ex.printStackTrace(log);
+ }
+ tRes.tested("createWindows()", res);
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method does not return null.
+ */
+ public void _createScreenCompatibleDevice() {
+ XDevice dev = oObj.createScreenCompatibleDevice(100, 100);
+ tRes.tested("createScreenCompatibleDevice()", dev != null);
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method does not return null.
+ */
+ public void _createRegion() {
+ XRegion reg = oObj.createRegion();
+ tRes.tested("createRegion()", reg != null);
+ }
+
+ /**
+ * Just creates the WindowDescriptor as an argument for createWindow().
+ */
+ public WindowDescriptor createDesc(Rectangle rect) {
+ XWindowPeer win = (XWindowPeer) tEnv.getObjRelation("WINPEER");
+ return new WindowDescriptor(com.sun.star.awt.WindowClass.TOP,
+ "", win, (short) -1, rect, com.sun.star.awt.WindowAttribute.SHOW);
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_XTopWindow.java b/qadevOOo/tests/java/ifc/awt/_XTopWindow.java
new file mode 100644
index 000000000000..25dce084da78
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XTopWindow.java
@@ -0,0 +1,206 @@
+/*************************************************************************
+ *
+ * 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.awt;
+
+import java.io.PrintWriter;
+
+import lib.MultiMethodTest;
+
+import com.sun.star.awt.XMenuBar;
+import com.sun.star.awt.XTopWindow;
+import com.sun.star.awt.XTopWindowListener;
+import com.sun.star.lang.EventObject;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+
+/**
+* Testing <code>com.sun.star.awt.XTopWindow</code>
+* interface methods :
+* <ul>
+* <li><code> addTopWindowListener()</code></li>
+* <li><code> removeTopWindowListener()</code></li>
+* <li><code> toFront()</code></li>
+* <li><code> toBack()</code></li>
+* <li><code> setMenuBar()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.awt.XTopWindow
+*/
+public class _XTopWindow extends MultiMethodTest {
+
+ public XTopWindow oObj = null;
+
+ /**
+ * Listener implementation which sets flags on different
+ * method calls.
+ */
+ protected class TestListener implements XTopWindowListener {
+ private PrintWriter log = null ;
+ public boolean activated = false ;
+ public boolean deactivated = false ;
+
+ public TestListener(PrintWriter log) {
+ this.log = log ;
+ }
+
+ public void initListener() {
+ activated = false;
+ deactivated = false;
+ }
+
+ public void windowOpened(EventObject e) {
+ log.println("windowOpened() called") ;
+ }
+ public void windowClosing(EventObject e) {
+ log.println("windowClosing() called") ;
+ }
+ public void windowClosed(EventObject e) {
+ log.println("windowClosed() called") ;
+ }
+ public void windowMinimized(EventObject e) {
+ log.println("windowMinimized() called") ;
+ }
+ public void windowNormalized(EventObject e) {
+ log.println("windowNormalized() called") ;
+ }
+ public void windowActivated(EventObject e) {
+ activated = true;
+ log.println("windowActivated() called") ;
+ }
+ public void windowDeactivated(EventObject e) {
+ deactivated = true;
+ log.println("windowDeactivated() called") ;
+ }
+ public void disposing(EventObject e) {}
+ }
+
+ protected TestListener listener = null ;
+
+ XTextDocument aTextDoc = null;
+
+
+ protected void before() {
+ aTextDoc = util.WriterTools.createTextDoc((XMultiServiceFactory)tParam.getMSF());
+ }
+
+ /**
+ * Adds a listener . <p>
+ *
+ * Has <b>OK</b> status always (listener calls are checked in
+ * other methods. <p>
+ */
+ public void _addTopWindowListener() {
+ listener = new TestListener(log) ;
+
+ oObj.addTopWindowListener(listener) ;
+
+ tRes.tested("addTopWindowListener()", true);
+ }
+
+ /**
+ * Removes a listener added before. <p>
+ * Has <b>OK</b> status always. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> toBack </code> : to have a definite method execution
+ * order.</li>
+ * </ul>
+ */
+ public void _removeTopWindowListener() {
+ executeMethod("toBack()");
+
+ oObj.removeTopWindowListener(listener);
+
+ tRes.tested("removeTopWindowListener()", true);
+ }
+
+ /**
+ * Moves the window to front and check the listener calls. <p>
+ * Has <b>OK</b> status if listener <code>activated</code> method
+ * was called.
+ */
+ public void _toFront() {
+ requiredMethod("addTopWindowListener()");
+ listener.initListener();
+ oObj.toFront();
+ shortWait();
+
+ tRes.tested("toFront()", listener.activated && !listener.deactivated);
+ }
+
+ /**
+ * This method doesn't do anything the Office implementation. <p>
+ * So it has always <b>OK</b> status
+ */
+ public void _toBack() {
+ oObj.toBack();
+ tRes.tested("toBack()", true);
+ }
+
+ /**
+ * Creates a simple menu bar and adds to the window. <p>
+ * Has <b>OK</b> status if no runtime exceptions occurred.
+ */
+ public void _setMenuBar() {
+ XMenuBar menu = null ;
+ boolean result = true ;
+
+ try {
+ menu = (XMenuBar) UnoRuntime.queryInterface(XMenuBar.class,
+ ((XMultiServiceFactory)tParam.getMSF()).
+ createInstance("com.sun.star.awt.MenuBar")) ;
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Can't instanciate MenuBar service") ;
+ result = false ;
+ }
+
+ menu.insertItem((short)1, "MenuItem",
+ com.sun.star.awt.MenuItemStyle.CHECKABLE, (short)1) ;
+
+ oObj.setMenuBar(menu) ;
+
+ tRes.tested("setMenuBar()", result) ;
+ }
+
+ /**
+ * Disposes the document created in <code>before</code> method.
+ */
+ protected void after() {
+ aTextDoc.dispose();
+ }
+
+ private void shortWait() {
+ try {
+ Thread.sleep(1000) ;
+ } catch (InterruptedException e) {
+ System.out.println("While waiting :" + e) ;
+ }
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_XUnoControlContainer.java b/qadevOOo/tests/java/ifc/awt/_XUnoControlContainer.java
new file mode 100644
index 000000000000..99fd41135c1a
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XUnoControlContainer.java
@@ -0,0 +1,181 @@
+/*************************************************************************
+ *
+ * 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.awt;
+
+import com.sun.star.awt.XTabController;
+import com.sun.star.awt.XUnoControlContainer;
+import lib.MultiMethodTest;
+
+/**
+ * Testing <code>com.sun.star.awt.XUnoControlContainer</code>
+ * interface methods :
+ * <ul>
+ * <li><code> addTabController()</code></li>
+ * <li><code> removeTabController()</code></li>
+ * <li><code> getTabControllers()</code></li>
+ * <li><code> setTabControllers()</code></li>
+ * </ul> <p>
+ *
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'TABCONTROL1'</code> (of type <code>XTabController</code>)</li>
+* <li> <code>'TABCONTROL2'</code> (of type <code>XTabController</code>)</li>
+ *</ul>
+ *
+ * Test is <b> NOT </b> multithread compilant. <p>
+ */
+
+public class _XUnoControlContainer extends MultiMethodTest {
+ public XUnoControlContainer oObj = null;
+ private XTabController[] TabControllers = new XTabController[2];
+ private XTabController tabControl1 = null;
+ private XTabController tabControl2 = null;
+
+ /**
+ * This method gets the object relations.
+ *
+ */
+ protected void before() {
+
+ tabControl1 = (XTabController) tEnv.getObjRelation("TABCONTROL1");
+ tabControl2 = (XTabController) tEnv.getObjRelation("TABCONTROL2");
+ if ((tabControl1 == null) || (tabControl2 == null)){
+ log.println("ERROR: Needed object realtions 'TABCONTROL1' and "
+ + "'TABCONTROL2' are not found.");
+ }
+ TabControllers[0] = tabControl1;
+ TabControllers[1] = tabControl2;
+
+ }
+
+
+
+ /**
+ * This tests removes the object relations <code>TABCONTROL1</code> and
+ * <code>TABCONTROL1</code>.
+ * Has <b> OK </b> status if the sequenze of <code>XTabController[]</code>
+ * get before calling method is smaller then sequenze of
+ * <code>XTabController[]</code> get after calling method.<p>
+ *
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getTabControllers() </code> </li>
+ * <li> <code> removeTabController() </code> </li>
+ * </ul>
+ */
+ public void _setTabControllers() {
+ requiredMethod( "getTabControllers()");
+ requiredMethod( "removeTabController()");
+
+ log.println("removing TABCONTROL1 and TABCONTROL2");
+ oObj.removeTabController(tabControl1);
+ oObj.removeTabController(tabControl2);
+
+ log.println("get current controllers");
+ XTabController[] myTabControllers = oObj.getTabControllers();
+
+ log.println("set new controllers");
+ oObj.setTabControllers( TabControllers );
+
+ log.println("get new current controllers");
+ XTabController[] myNewTabControllers = oObj.getTabControllers();
+
+ tRes.tested("setTabControllers()",
+ (myTabControllers.length < myNewTabControllers.length ));
+
+ }
+
+ /**
+ * Test calls the method, then checks returned value.<p>
+ * Has <b> OK </b> status if method returns a value that greater then zerro.<p>
+ *
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addTabController() </code></li>
+ * </ul>
+ */
+ public void _getTabControllers() {
+ requiredMethod( "addTabController()");
+ XTabController[] myTabControllers = oObj.getTabControllers();
+ tRes.tested("getTabControllers()", ( myTabControllers.length > 0));
+ }
+
+ /**
+ * Test calls the method with object relation 'TABCONTROL1' as a parameter.<p>
+ * Has <b> OK </b> status if the sequenze of <code>XTabController[]</code>
+ * get before calling method is smaller then sequenze of
+ * <code>XTabController[]</code> get after calling method.<p>
+ */
+ public void _addTabController() {
+ log.println("get current controllers");
+ XTabController[] myTabControllers = oObj.getTabControllers();
+
+ log.println("add TABCONTROL1");
+ oObj.addTabController( tabControl1 );
+
+ log.println("get new current controllers");
+ XTabController[] myNewTabControllers = oObj.getTabControllers();
+
+ tRes.tested("addTabController()",
+ (myTabControllers.length < myNewTabControllers.length ));
+ }
+
+ /**
+ * Test calls the method with object relation 'TABCONTROL2' as a parameter.<p>
+ * Has <b> OK </b> status if the sequenze of <code>XTabController[]</code>
+ * get before calling method is smaller then sequenze of
+ * <code>XTabController[]</code> get after calling method.<p>
+ *
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getTabControllers() </code></li>
+ * <li> <code> addTabController() </code></li>
+ * </ul>
+ */
+ public void _removeTabController() {
+ requiredMethod( "getTabControllers()");
+ requiredMethod( "addTabController()");
+
+ log.println("add TABCONTROL2");
+ oObj.addTabController( tabControl2 );
+
+ log.println("get current controllers");
+ XTabController[] myTabControllers = oObj.getTabControllers();
+
+ log.println("remove TABCONTROL2");
+ oObj.removeTabController(tabControl2);
+
+ log.println("get new current controllers");
+ XTabController[] myNewTabControllers = oObj.getTabControllers();
+
+ tRes.tested("removeTabController()",
+ (myTabControllers.length > myNewTabControllers.length ));
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_XUserInputInterception.java b/qadevOOo/tests/java/ifc/awt/_XUserInputInterception.java
new file mode 100644
index 000000000000..cf52cfb5bd57
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XUserInputInterception.java
@@ -0,0 +1,539 @@
+/*************************************************************************
+ *
+ * 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.awt;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleComponent;
+import com.sun.star.accessibility.XAccessibleContext;
+import com.sun.star.awt.KeyEvent;
+import com.sun.star.awt.MouseEvent;
+import com.sun.star.awt.Point;
+import com.sun.star.awt.Rectangle;
+import com.sun.star.awt.XKeyHandler;
+import com.sun.star.awt.XMouseClickHandler;
+import com.sun.star.awt.XUserInputInterception;
+import com.sun.star.awt.XWindow;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.EventObject;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import java.awt.Robot;
+import java.awt.event.InputEvent;
+import lib.MultiMethodTest;
+import util.AccessibilityTools;
+
+/**
+* Testing <code>com.sun.star.awt.XUserInputInterception</code>
+* interface methods:
+* <ul>
+* <li><code> addKeyHandler() </code></li>
+* <li><code> removeKeyHandler() </code></li>
+* <li><code> addMouseClickHandler() </code></li>
+* <li><code> removeMouseClickHandler() </code></li>
+* </ul><p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'XUserInputInterception.XModel'</code> (of type <code>XModel</code>):
+* used as model where a mouse click or a key press could be done </li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.awt.XUserInputInterception
+*/
+public class _XUserInputInterception extends MultiMethodTest {
+ public XUserInputInterception oObj = null;
+
+ private XModel m_XModel = null;
+
+ /** the listener 1 for the mouse click test */
+ private MyMouseClickHandler1 m_MouseListener1 = null;
+ /** the listener 2 for the mouse click test */
+ private MyMouseClickHandler2 m_MouseListener2 = null;
+
+ /** the listener 1 for the key event test */
+ private MyKeyHandler1 m_KeyListener1 = null;
+ /** the listener 2 for the key event test */
+ private MyKeyHandler2 m_KeyListener2 = null;
+
+ /** indicates if the mousePressed event was called*/
+ private boolean m_mousePressed1 = false;
+ /** indicates if the mouseReleased event was called*/
+ private boolean m_mouseReleased1 = false;
+
+ /** indicates if the mousePressed event was called*/
+ private boolean m_mousePressed2 = false;
+ /** indicates if the mouseReleased event was called*/
+ private boolean m_mouseReleased2 = false;
+
+ /** indicates if the mousePressed event was called*/
+ private boolean m_keyPressed1 = false;
+ /** indicates if the mouseReleased event was called*/
+ private boolean m_keyReleased1 = false;
+
+ /** indicates if the mousePressed event was called*/
+ private boolean m_keyPressed2 = false;
+ /** indicates if the mouseReleased event was called*/
+ private boolean m_keyReleased2 = false;
+
+ /** get the object rlation XUserInputInterception.XModel from the
+ * test environment
+ */
+ protected void before() {
+ log.print("try to get object relation 'XUserInputInterception.XModel': ");
+ m_XModel = (XModel)tEnv.getObjRelation("XUserInputInterception.XModel");
+ if (m_XModel == null) log.println("failed => null");
+ else log.println("OK");
+
+ }
+
+ /**
+ * This test adds two different key listener to the object. <p>
+ *
+ * Has <b> OK </b> if no exception is thrown.
+ */
+ public void _addKeyHandler() {
+
+ log.println("creating key listener 1");
+ m_KeyListener1 = new MyKeyHandler1();
+
+ log.println("creating key listener 2");
+ m_KeyListener2 = new MyKeyHandler2();
+
+
+ log.println("adding key listener 1");
+ oObj.addKeyHandler(m_KeyListener1);
+
+
+ log.println("adding key listener 2");
+ oObj.addKeyHandler(m_KeyListener2);
+
+ tRes.tested("addKeyHandler()", true);
+ }
+
+ /**
+ * The test requires <CODE>addKeyHandler()</CODE> which adds two key listener.
+ * Then one of them will be removed. In a second thread a key event is released
+ * by the <CODE>robot</CODE> class.<p>
+ * Has <b> OK </b> status if only one of the listener are triggered. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addKeyHandler() </code> : adds two key listener </li>
+ * </ul>
+ */
+ public void _removeKeyHandler() {
+ requiredMethod("addKeyHandler()");
+
+ log.println("remove key listener 2");
+
+ oObj.removeKeyHandler(m_KeyListener2);
+
+ log.println("starting thread to check the key listener...");
+ EventTrigger et = new EventTrigger(m_XModel, EventTriggerType.KEY_TEXT_INTO_DOC);
+
+ et.run();
+
+ util.utils.shortWait(tParam.getInt(util.PropertyName.SHORT_WAIT) * 2);
+ log.println("key listener thread should be finished.");
+
+
+ boolean bOK = m_keyPressed1 & m_keyReleased1 &
+ ! m_keyPressed2 & ! m_keyReleased2;
+
+ if (! bOK){
+ log.println("The key listener has not the expectd status:");
+ log.println("listener\texpected\tgot");
+ log.println("keyPressed1\ttrue\t"+m_keyPressed1);
+ log.println("keyReleased1\ttrue\t"+m_keyReleased1);
+ log.println("keyPressed2\tfalse\t"+m_keyPressed2);
+ log.println("keyReleased2\tfalse\t"+m_keyReleased2);
+ }
+
+ log.println("remove Key listener 1");
+ oObj.removeKeyHandler(m_KeyListener1);
+
+ tRes.tested("removeKeyHandler()", bOK);
+ }
+
+ /**
+ * This test adds two different mouse klick listener to the object. <p>
+ *
+ * Has <b> OK </b> if no exception is thrown.
+ */
+ public void _addMouseClickHandler() {
+ log.println("creating mouse listener 1");
+ m_MouseListener1 = new MyMouseClickHandler1();
+ log.println("creating mouse listener 2");
+ m_MouseListener2 = new MyMouseClickHandler2();
+
+ log.println("adding mouse listener 1");
+ oObj.addMouseClickHandler(m_MouseListener1);
+ log.println("adding mouse listener 2");
+ oObj.addMouseClickHandler(m_MouseListener2);
+
+ tRes.tested("addMouseClickHandler()", true);
+ }
+
+ /**
+ * The test requires <CODE>addMouseClickHandler()</CODE> which adds two key listener.
+ * Then one of them will be removed. In a second thread a mouse klick event is released
+ * by the <CODE>robot</CODE> class.<p>
+ * Has <b> OK </b> status if only one of the listener are triggered. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addMouseKlickHandler() </code> : adds two key listener </li>
+ * </ul>
+ */
+ public void _removeMouseClickHandler() {
+ requiredMethod("addMouseClickHandler");
+
+ log.println("remove mouse listener 2");
+
+ oObj.removeMouseClickHandler(m_MouseListener2);
+
+ log.println("starting thread to check the mouse listener...");
+ EventTrigger et = new EventTrigger(m_XModel, EventTriggerType.MOUSE_KLICK_INTO_DOC);
+
+ et.run();
+
+ util.utils.shortWait(tParam.getInt(util.PropertyName.SHORT_WAIT) * 2);
+ log.println("mouse listener thread should be finished.");
+
+ boolean bOK = m_mousePressed1 & m_mouseReleased1 &
+ ! m_mousePressed2 & ! m_mouseReleased2;
+
+ if (! bOK){
+ log.println("The mouse listener has not the expectd status:");
+ log.println("listener\t\texpected\tgot");
+ log.println("mousePressed1\ttrue\t\t"+m_mousePressed1);
+ log.println("mouseReleased1\ttrue\t\t"+m_mouseReleased1);
+ log.println("mousePressed2\tfalse\t\t"+m_mousePressed2);
+ log.println("mouseReleased2\tfalse\t\t"+m_mouseReleased2);
+ }
+
+ log.println("remove mouse listener 1");
+ oObj.removeMouseClickHandler(m_MouseListener1);
+
+ tRes.tested("removeMouseClickHandler()", bOK);
+ }
+
+
+ /**
+ * Forces environment recreation.
+ */
+ protected void after() {
+ disposeEnvironment();
+ }
+
+ /**
+ * Listener which added and its method must be called
+ * on <code>keyPressed</code> and <code>keyReleased</code> call.
+ */
+ public class MyKeyHandler1 implements XKeyHandler {
+ /**
+ * This event sets the member <code>m_keyPressed</coed> to
+ * <code>true</code>
+ * @param oEvent The key event informs about the pressed key.
+ * @return returns <CODE>TRUE</CODE> in erery case
+ */
+ public boolean keyPressed( KeyEvent oEvent ){
+ log.println("XKeyHandler 1: keyPressed-Event");
+ m_keyPressed1 = true;
+ return true;
+ }
+ /**
+ * This event sets the member <code>m_keyReleased</coed> to
+ * <code>true</code>
+ * @param oEvent The key event informs about the pressed key.
+ * @return returns <CODE>TRUE</CODE> in erery case
+ */
+ public boolean keyReleased( KeyEvent oEvent ){
+ log.println("XKeyHandler 1: keyReleased-Event");
+ m_keyReleased1 = true;
+ return true;
+ }
+ /**
+ * This event does nothing usefull
+ * @param oEvent refers to the object that fired the event.
+ */
+ public void disposing( EventObject oEvent ){
+ log.println("XKeyHandler 1: disposing-Event");
+ }
+ }
+ /**
+ * Listener which added and its method must be called
+ * on <code>keyPressed</code> and <code>keyReleased</code> call.
+ */
+ public class MyKeyHandler2 implements XKeyHandler {
+ /**
+ * This event sets the member <code>m_keyPressed</coed> to
+ * <code>true</code>
+ * @param oEvent The key event informs about the pressed key.
+ * @return returns <CODE>TRUE</CODE> in erery case
+ */
+ public boolean keyPressed( KeyEvent oEvent ){
+ log.println("XKeyHandler 2: keyPressed-Event: " +
+ "This should not be happen because listener is removed!");
+ m_keyPressed2 = true;
+ return true;
+ }
+ /**
+ * This event sets the member <code>m_keyReleased</coed> to
+ * <code>true</code>
+ * @param oEvent The key event informs about the pressed key.
+ * @return returns <CODE>TRUE</CODE> in erery case
+ */
+ public boolean keyReleased( KeyEvent oEvent ){
+ log.println("XKeyHandler 2: keyReleased-Event: " +
+ "This should not be happen because listener is removed!");
+ m_keyReleased2 = true;
+ return true;
+ }
+ /**
+ * This event does nothing usefull
+ * @param oEvent refers to the object that fired the event.
+ */
+ public void disposing( EventObject oEvent ){
+ log.println("XKeyHandler 2: disposing-Event: " +
+ "This should not be happen because listener is removed!");
+ }
+ }
+
+ /**
+ * Listener which added and its method must be called
+ * on <code>mousePressed</code> and <code>mouseReleased</code> call.
+ */
+ public class MyMouseClickHandler1 implements XMouseClickHandler {
+ /**
+ * This event sets the member <code>m_mousePressed</coed> to
+ * <code>true</code>
+ * @param oEvent The mouse event informs about the kind of mouse event.
+ * @return returns <CODE>TRUE</CODE> in erery case
+ */
+ public boolean mousePressed( MouseEvent oEvent ){
+ log.println("XMouseClickHandler 1: mousePressed-Event");
+ m_mousePressed1 = true;
+ return true;
+ }
+ /**
+ * This event sets the member <code>m_mouseReleased</coed> to
+ * <code>true</code>
+ * @param oEvent The mouse event informs about the kind of mouse event.
+ * @return returns <CODE>TRUE</CODE> in erery case
+ */
+ public boolean mouseReleased( MouseEvent oEvent ){
+ log.println("XMouseClickHandler 1: mouseReleased-Event");
+ m_mouseReleased1 = true;
+ return true;
+ }
+ /**
+ * This event does nothing usefull
+ * @param oEvent refers to the object that fired the event.
+ */
+ public void disposing( EventObject oEvent ){
+ log.println("XMouseClickHandler 1: disposing-Event");
+ }
+ };
+
+ /**
+ * Listener which added and removed. Its method must NOT be called
+ * on <code>mousePressed</code> and <code>mouseReleased</code> call.
+ */
+ public class MyMouseClickHandler2 implements XMouseClickHandler {
+ /**
+ * This event sets the member <code>m_mousePressed</coed> to
+ * <code>true</code>
+ * @param oEvent The mouse event informs about the kind of mouse event.
+ * @return returns <CODE>TRUE</CODE> in erery case
+ */
+ public boolean mousePressed( MouseEvent oEvent ){
+ log.println("XMouseClickHandler 2: mousePressed-Event: " +
+ "This should not be happen because listener is removed!");
+ m_mousePressed2 = true;
+ return true;
+ }
+ /**
+ * This event sets the member <code>m_mouseReleased</coed> to
+ * <code>true</code>
+ * @param oEvent The mouse event informs about the kind of mouse event.
+ * @return returns <CODE>TRUE</CODE> in erery case
+ */
+ public boolean mouseReleased( MouseEvent oEvent ){
+ log.println("XMouseClickHandler 2: mouseReleased-Event: " +
+ "This should not be happen because listener is removed!");
+ m_mouseReleased2 = true;
+ return true;
+ }
+ /**
+ * This event does nothing usefull
+ * @param oEvent refers to the object that fired the event.
+ */
+ public void disposing( EventObject oEvent ){
+ log.println("XMouseClickHandler 2: disposing-Event: " +
+ " This should not be happen because listener is removed!");
+ }
+ };
+
+ /**
+ * To check the events this class is a thread which click a mouse button and
+ * press a key with the <CODE>Robot</CODE> class
+ * @see java.awt.Robot
+ */
+ private class EventTrigger extends Thread{
+
+ /**
+ * represents a <CODE>AccessibilityTools</CODE>
+ */
+ private final AccessibilityTools at = new AccessibilityTools();
+ /**
+ * represents an <CODE>EventType</CODE>
+ * @see EventTest.EventTriggerType
+ */
+ private int eventType = 0;
+ /**
+ * represents a <CODE>XModel</CODE> of a document
+ */
+ private XModel xModel = null;
+
+ /**
+ * Creates an instacne of this class. The parameter <CODE>eType</CODE> represents
+ * the kind of event wich will be triggert at <CODE>run()</CODE>
+ * @param model the model of a document
+ * @param eType the kind of event which should be trigger
+ */
+ public EventTrigger(XModel model, int eType)
+ {
+ this.xModel = model;
+ this.eventType = eType;
+ }
+
+ /**
+ * Triggers the event wich is represented by <CODE>eventType</CODE>
+ * The scenarios are:
+ * <ul>
+ * <li>EventTest.EventTriggerType.MOUSE_KLICK_INTO_DOC
+ * which calls
+ * <li><CODE>clickIntoDoc</CODE></LI>
+ * </LI>
+ * <li>EventTest.EventTriggerType.KEY_TEXT_INTO_DOC
+ * which calls
+ * <li><CODE>clickIntodoc</CODE></LI>
+ * <li><CODE>keyIntoDoc</CODE></LI>
+ * </LI>
+ * </UL>
+ */
+ public void run(){
+
+ switch (this.eventType){
+
+ case EventTriggerType.MOUSE_KLICK_INTO_DOC:
+ clickIntoDoc();
+ break;
+ case EventTriggerType.KEY_TEXT_INTO_DOC:
+ clickIntoDoc();
+ keyIntoDoc();
+ break;
+
+ }
+ }
+ /**
+ * This method cklicks into the middel of a document. It uses Accessibility
+ * to get the document and query for its position and its range to calculate
+ * the middle. This values was used for <CODE>Robot</CODE> Class. This
+ * Robot class is able to move the mouse and to cklick a mouse button
+ * @see java.awt.Robot
+ */
+ private void clickIntoDoc(){
+ try{
+
+ util.DesktopTools.bringWindowToFront(xModel);
+
+ XWindow xWindow = at.getCurrentWindow(
+ (XMultiServiceFactory) tParam.getMSF(),
+ xModel);
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+
+
+ XAccessibleContext xPanel = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PANEL);
+ XAccessibleComponent xPanelCont = (XAccessibleComponent) UnoRuntime.queryInterface(XAccessibleComponent.class, xPanel);
+
+ // the position of the panel
+ Point point = xPanelCont.getLocationOnScreen();
+
+ // the range of the panel
+ Rectangle rect = xPanelCont.getBounds();
+
+ try {
+ Robot rob = new Robot();
+ int x = point.X + (rect.Width / 2);
+ int y = point.Y + (rect.Height / 2);
+ log.println("try to klick into the middle of the document");
+ rob.mouseMove(x, y);
+ rob.mousePress(InputEvent.BUTTON1_MASK);
+ rob.mouseRelease(InputEvent.BUTTON1_MASK);
+ } catch (java.awt.AWTException e) {
+ log.println("couldn't press mouse button");
+ }
+ } catch (java.lang.Exception e){
+ log.println("could not click into the scroll bar: " + e.toString());
+ }
+ }
+
+ /**
+ * This method press the "A" key. Therefore it uses the <CODE>Robot</CODE>
+ * class.
+ * @see java.awt.Robot
+ */
+ private void keyIntoDoc(){
+ try {
+ Robot rob = new Robot();
+ log.println("try to press 'A'");
+ rob.keyPress(java.awt.event.KeyEvent.VK_A);
+ rob.keyRelease(java.awt.event.KeyEvent.VK_A);
+ } catch (java.awt.AWTException e) {
+ log.println("couldn't press key");
+ }
+
+ }
+ }
+
+ /** This interface represents all possible actions which could be used
+ * in the <CODE>EventTrigger</CODE> class.
+ * @see EventTest.EventTrigger
+ */
+ private interface EventTriggerType{
+
+ /** klick the mouse into the scroll bar*/
+ final public static int MOUSE_KLICK_INTO_DOC = 1;
+
+ /** write some text into a spread sheet*/
+ final public static int KEY_TEXT_INTO_DOC = 2;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_XView.java b/qadevOOo/tests/java/ifc/awt/_XView.java
new file mode 100644
index 000000000000..a3f87c2ea3dc
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XView.java
@@ -0,0 +1,143 @@
+/*************************************************************************
+ *
+ * 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.awt;
+
+import lib.MultiMethodTest;
+
+import com.sun.star.awt.Size;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XView;
+
+/**
+* Testing <code>com.sun.star.awt.XView</code>
+* interface methods:
+* <ul>
+* <li><code> setGraphics() </code></li>
+* <li><code> getGraphics() </code></li>
+* <li><code> getSize() </code></li>
+* <li><code> draw() </code></li>
+* <li><code> setZoom() </code></li>
+* </ul><p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'GRAPHICS'</code> (of type <code>XGraphics</code>):
+* used as a parameter to setGraphics() </li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.awt.XView
+*/
+public class _XView extends MultiMethodTest {
+ public XView oObj = null;
+
+ /**
+ * After obtaining object relation 'GRAPHICS', test calls the method. <p>
+ * Has <b> OK </b> status if the method returns true.
+ */
+ public void _setGraphics() {
+ XGraphics graph = (XGraphics) tEnv.getObjRelation("GRAPHICS");
+ boolean isSet = oObj.setGraphics(graph);
+ if ( !isSet ) {
+ log.println("setGraphics() returns false");
+ }
+ tRes.tested("setGraphics()", isSet);
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method does not return null. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setGraphics() </code> : sets the output device </li>
+ * </ul>
+ */
+ public void _getGraphics() {
+ requiredMethod("setGraphics()");
+ XGraphics graph = oObj.getGraphics();
+ if (graph == null) {
+ log.println("getGraphics() returns NULL");
+ }
+ tRes.tested("getGraphics()", graph != null);
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method returns structure with fields that
+ * are not equal to zero. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setGraphics() </code> : sets the output device </li>
+ * </ul>
+ */
+ public void _getSize() {
+ requiredMethod("setGraphics()");
+ Size aSize = oObj.getSize();
+ boolean res = (aSize.Height != 0) && (aSize.Width != 0);
+ if ( !res ) {
+ log.println("Height: " + aSize.Height);
+ log.println("Width: " + aSize.Width);
+ }
+ tRes.tested("getSize()", res);
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setGraphics() </code> : sets the output device </li>
+ * </ul>
+ */
+ public void _draw() {
+ requiredMethod("setGraphics()");
+ oObj.draw(20, 20);
+ tRes.tested("draw()", true);
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setGraphics() </code> : sets the output device </li>
+ * </ul>
+ */
+ public void _setZoom() {
+ requiredMethod("setGraphics()");
+ oObj.setZoom(2,2);
+ tRes.tested("setZoom()", true);
+ }
+
+ /**
+ * Forces environment recreation.
+ */
+ protected void after() {
+ disposeEnvironment();
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_XWindow.java b/qadevOOo/tests/java/ifc/awt/_XWindow.java
new file mode 100644
index 000000000000..eb48a5346e18
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XWindow.java
@@ -0,0 +1,624 @@
+/*************************************************************************
+ *
+ * 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.awt;
+
+import com.sun.star.awt.FocusEvent;
+import com.sun.star.awt.KeyEvent;
+import com.sun.star.awt.MouseEvent;
+import com.sun.star.awt.PaintEvent;
+import com.sun.star.awt.Point;
+import com.sun.star.awt.PosSize;
+import com.sun.star.awt.Rectangle;
+import com.sun.star.awt.Size;
+import com.sun.star.awt.WindowEvent;
+import com.sun.star.awt.XFocusListener;
+import com.sun.star.awt.XKeyListener;
+import com.sun.star.awt.XMouseListener;
+import com.sun.star.awt.XMouseMotionListener;
+import com.sun.star.awt.XPaintListener;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowListener;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.lang.EventObject;
+import lib.MultiMethodTest;
+import util.ValueComparer;
+
+/**
+* Testing <code>com.sun.star.awt.XWindow</code>
+* interface methods :
+* <ul>
+* <li><code> setPosSize()</code></li>
+* <li><code> getPosSize()</code></li>
+* <li><code> setVisible()</code></li>
+* <li><code> setEnable()</code></li>
+* <li><code> setFocus()</code></li>
+* <li><code> addWindowListener()</code></li>
+* <li><code> removeWindowListener()</code></li>
+* <li><code> addFocusListener()</code></li>
+* <li><code> removeFocusListener()</code></li>
+* <li><code> addKeyListener()</code></li>
+* <li><code> removeKeyListener()</code></li>
+* <li><code> addMouseListener()</code></li>
+* <li><code> removeMouseListener()</code></li>
+* <li><code> addMouseMotionListener()</code></li>
+* <li><code> removeMouseMotionListener()</code></li>
+* <li><code> addPaintListener()</code></li>
+* <li><code> removePaintListener()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'XWindow.AnotherWindow'</code> (of type <code>XWindow</code>):
+* Some another window which can gain focus so the tested one
+* must lost it. </li>
+* <li> <code>'XWindow.ControlShape'</code> <b>optional</b>
+* (of type <code>XControlShape</code>):
+* Some shapes cann't change their size within fixed ControlShape
+* and their size could be changed only if size of container
+* ControlShape is changed. For such shapes this relation should
+* be passed for proper <code>addWindowListener</code> test. </li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.awt.XWindow
+*/
+public class _XWindow extends MultiMethodTest {
+ public XWindow oObj = null;
+ private Rectangle posSize = null ;
+ private XWindow win = null;
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method does not return null.
+ */
+ public void _getPosSize() {
+ posSize = oObj.getPosSize() ;
+ tRes.tested("getPosSize()", posSize != null) ;
+ }
+
+ /**
+ * After defining Rectangle structure to be set, test calls the method. <p>
+ * Has <b> OK </b> status if structure obtained using getPosSize() is
+ * equal to structure previously set using setPosSize(). <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getPosSize() </code> : returns the outer bounds of
+ * the window </li>
+ * </ul>
+ */
+ public void _setPosSize() {
+ Rectangle newRec = new Rectangle();
+
+ requiredMethod("getPosSize()");
+ newRec.X = posSize.X + 1;
+ newRec.Y = posSize.Y + 1;
+ newRec.Width = posSize.Width - 3;
+ newRec.Height = posSize.Height - 3;
+ oObj.setPosSize(newRec.X, newRec.Y, newRec.Width, newRec.Height,
+ PosSize.POSSIZE);
+ Rectangle gPS = oObj.getPosSize();
+ log.println("Was : (" + posSize.X + ", " + posSize.Y + ", " +
+ posSize.Width + ", " + posSize.Height + "), ");
+ log.println("Set : (" + newRec.X + ", " + newRec.Y + ", " +
+ newRec.Width + ", " + newRec.Height + "), ");
+ log.println("Get : (" + gPS.X + ", " + gPS.Y + ", " +
+ gPS.Width + ", " + gPS.Height + "). ");
+ tRes.tested("setPosSize()", ValueComparer.equalValue(newRec, gPS) );
+ }
+
+ /**
+ * At first object relation 'XWindow.AnotherWindow' is obtained.
+ * Then test calls the methods of two 'XWindow' objects several times to be
+ * sure that the focus has changed. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown.
+ */
+ public void _setFocus() {
+ win = (XWindow) tEnv.getObjRelation("XWindow.AnotherWindow");
+ oObj.setFocus();
+ win.setFocus();
+ oObj.setFocus();
+ tRes.tested("setFocus()", true);
+ }
+
+ /**
+ * Test calls the method twice with two parameters: 'true' and 'false'. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown.
+ */
+ public void _setVisible() {
+ oObj.setVisible(false);
+ oObj.setVisible(true);
+ tRes.tested("setVisible()", true);
+ }
+
+ /**
+ * Test calls the method twice with two parameters: 'true' and 'false'. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown.
+ */
+ public void _setEnable() {
+ oObj.setEnable(false);
+ oObj.setEnable(true);
+ tRes.tested("setEnable()", true);
+ }
+
+
+ /**
+ * A class we use to test addWindowListener() and
+ * removeWindowListener()
+ */
+ public class TestWindowListener implements XWindowListener {
+ public boolean resized = false ;
+ public boolean moved = false ;
+ public boolean hidden = false ;
+ public boolean shown = false ;
+
+ public void init() {
+ resized = false ;
+ moved = false ;
+ hidden = false ;
+ shown = false ;
+ }
+
+ public void windowResized(WindowEvent e) {
+ resized = true ;
+ }
+ public void windowMoved(WindowEvent e) {
+ moved = true ;
+ }
+ public void windowHidden(EventObject e) {
+ hidden = true ;
+ }
+ public void windowShown(EventObject e) {
+ shown = true ;
+ }
+ public void disposing(EventObject e) {}
+
+ }
+
+ private TestWindowListener wListener = new TestWindowListener() ;
+
+
+ /**
+ * Test calls the method. Then we check if listener's methods were called
+ * when we move, resize, hide and show the window. The resizing is
+ * performed depending on 'XWindow.ControlShape' existance. If this
+ * relation exists then the size and position of container control
+ * shape is changed, else the position and size of window itself is
+ * chaged<p>
+ *
+ * Has <b> OK </b> status if methods of wListener were called when
+ * corresponding events occurred. <p>
+ *
+ * The following method tests are to be executed before :
+ * <ul>
+ * <li> <code> setPosSize() </code>: sets the outer bounds of the
+ * window</li>
+ * <li> <code> setVisible() </code>: shows or hides the window
+ * depending on the parameter</li>
+ * </ul>
+ */
+ public void _addWindowListener() {
+ executeMethod("setPosSize()");
+ executeMethod("setVisible()");
+ boolean result = true ;
+
+ oObj.addWindowListener(wListener);
+
+ // testing wListener.windowMoved()
+ XControlShape ctrlShape = (XControlShape)
+ tEnv.getObjRelation("XWindow.ControlShape");
+ log.println("change object position and size...");
+
+ if (ctrlShape != null) {
+ try {
+ Size sz = ctrlShape.getSize();
+ sz.Height += 100;
+ ctrlShape.setSize(sz);
+ Point pos = ctrlShape.getPosition();
+ pos.X += 100 ;
+ ctrlShape.setPosition(pos);
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ log.println("Couldn't change size or position: ");
+ e.printStackTrace(log);
+ }
+ } else {
+ oObj.setPosSize(posSize.X + 2, 0, 0, 0, PosSize.X);
+ oObj.setPosSize(0, 0, 100, 100, PosSize.WIDTH);
+ }
+
+ shortWait();
+ boolean res = wListener.resized && wListener.moved &&
+ !wListener.hidden && !wListener.shown;
+ result &= res;
+ if (!res) {
+ log.println("\twindowHidden() wasn't called: " + !wListener.hidden);
+ log.println("\twindowShown() wasn't called: " + !wListener.shown);
+ log.println("\twindowResized() was called: " + wListener.resized);
+ log.println("\twindowMoved() was called: " + wListener.moved);
+ } else {
+ log.println("windowMoved() and windowResized() was called");
+ }
+
+ // testing wListener.windowHidden()
+ wListener.init();
+ shortWait();
+ log.println("set object invisible...");
+ oObj.setVisible(false);
+ shortWait();
+ res = wListener.hidden && !wListener.resized
+ && !wListener.moved && !wListener.shown;
+ result &= res;
+ if (!res) {
+ log.println("\twindowHidden() was called: " + wListener.hidden);
+ log.println("\twindowShown() wasn't called: " + !wListener.shown);
+ log.println("\twindowResized() wasn't called: " + !wListener.resized);
+ log.println("\twindowMoved() wasn't called: " + !wListener.moved);
+ } else {
+ log.println("windowHidden() was called");
+ }
+
+ // testing wListener.windowShown()
+ wListener.init() ;
+ shortWait();
+ log.println("set object visible...");
+ oObj.setVisible(true) ;
+ shortWait();
+ res = wListener.shown && !wListener.resized &&
+ !wListener.hidden && !wListener.moved;
+ result &= res;
+ if (!res) {
+ log.println("\twindowHidden() wasn't called: " + !wListener.hidden);
+ log.println("\twindowShown() was called: " + wListener.shown);
+ log.println("\twindowResized() wasn't called: " + !wListener.resized);
+ log.println("\twindowMoved() wasn't called: " + !wListener.moved);
+ } else {
+ log.println("windowShown() was called");
+ }
+
+ tRes.tested("addWindowListener()", result) ;
+ }
+
+
+ /**
+ * Test calls the method. Then we change window and check that listener's
+ * methods were not called. <p>
+ * Has <b> OK </b> status if listener does not react on window events.<p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addWindowListener() </code>: adds window listener to the
+ * object </li>
+ * </ul>
+ */
+ public void _removeWindowListener() {
+ requiredMethod("addWindowListener()");
+ oObj.removeWindowListener(wListener);
+ wListener.init();
+ oObj.setPosSize(posSize.X, posSize.Y,
+ posSize.Width , posSize.Height, PosSize.POSSIZE);
+ oObj.setVisible(false);
+ oObj.setVisible(true);
+ boolean res = !(wListener.resized || wListener.moved
+ || wListener.hidden || wListener.shown);
+
+ tRes.tested("removeWindowListener()", res);
+ }
+
+ /**
+ * A class we use to test addFocusListener() and
+ * removeFocusListener()
+ */
+ public class TestFocusListener implements XFocusListener {
+ public boolean gained = false ;
+ public boolean lost = false ;
+
+ public void focusGained(FocusEvent e) {
+ gained = true ;
+ }
+ public void focusLost(FocusEvent e) {
+ lost = true ;
+ }
+ public void init() {
+ gained = false;
+ lost = false;
+ }
+ public void disposing(EventObject e) {}
+
+ }
+
+ private TestFocusListener fListener = new TestFocusListener();
+
+ /**
+ * Test calls the method. Then we change focus and check that listener's
+ * methods were called. <p>
+ * Has <b> OK </b> status if methods of fListener were called when
+ * corresponding events occurred. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setFocus() </code>: sets the focus to the window </li>
+ * </ul>
+ */
+ public void _addFocusListener() {
+ boolean result = true ;
+
+ requiredMethod("setFocus()");
+ oObj.addFocusListener(fListener) ;
+
+ // testing fListener.lost()
+ oObj.setFocus();
+ shortWait();
+ win.setFocus();
+ shortWait();
+ result &= fListener.lost;
+ if (!fListener.lost) {
+ log.println("Lost focus was not notified about") ;
+ }
+
+ // testing fListener.gained()
+ oObj.setFocus() ;
+ shortWait();
+ result &= fListener.gained;
+ if (!fListener.gained) {
+ log.println("Gained focus was not notified about") ;
+ }
+
+ tRes.tested("addFocusListener()", result) ;
+ }
+
+ /**
+ * Test calls the method. Then we change focus and check that listener's
+ * methods were not called. <p>
+ * Has <b> OK </b> status if listener does not react on focus changing. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addFocusListener() </code> : adds focus listener to
+ * the object </li>
+ * </ul>
+ */
+ public void _removeFocusListener() {
+ requiredMethod("addFocusListener()");
+ oObj.removeFocusListener(fListener);
+ fListener.init();
+ oObj.setFocus();
+ win.setFocus();
+ oObj.setFocus();
+ boolean res = !(fListener.gained || fListener.lost);
+ tRes.tested("removeFocusListener()", res);
+ }
+
+ /**
+ * A class we use to test addKeyListener() and
+ * removeKeyListener()
+ */
+ public class TestKeyListener implements XKeyListener {
+ public boolean pressed = false;
+ public boolean released = false;
+ public void keyPressed(KeyEvent e) { pressed = true; }
+ public void keyReleased(KeyEvent e) { released = true; }
+ public void disposing(EventObject e) {}
+ public void init() { pressed = false; released = false; }
+ }
+
+ private TestKeyListener kListener = new TestKeyListener();
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if no exceptions were thrown. <p>
+ */
+ public void _addKeyListener() {
+ oObj.addKeyListener(kListener);
+ tRes.tested("addKeyListener()", true);
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addKeyListener() </code> : adds key listener to
+ * the object </li>
+ * </ul>
+ */
+ public void _removeKeyListener() {
+ requiredMethod("addKeyListener()");
+ oObj.removeKeyListener(kListener);
+ tRes.tested("removeKeyListener()", true);
+ }
+
+ /**
+ * A class we use to test addMouseListener() and
+ * removeMouseListener()
+ */
+ public class TestMouseListener implements XMouseListener {
+ public boolean pressed = false;
+ public boolean released = false;
+ public boolean entered = false;
+ public boolean exited = false;
+
+ public void mousePressed(MouseEvent e) {
+ pressed = true;
+ }
+
+ public void mouseReleased(MouseEvent e) {
+ released = true;
+ }
+
+ public void mouseEntered(MouseEvent e) {
+ entered = true;
+ }
+
+ public void mouseExited(MouseEvent e) {
+ exited = true;
+ }
+
+ public void disposing(EventObject e) {}
+
+ public void init() {
+ pressed = false;
+ released = false;
+ exited = false;
+ entered = false;
+ }
+
+ }
+
+ private TestMouseListener mListener = new TestMouseListener();
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if no exceptions were thrown. <p>
+ */
+ public void _addMouseListener() {
+ oObj.addMouseListener(mListener);
+ tRes.tested("addMouseListener()", true);
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addMouseListener() </code> : adds mouse listener to
+ * the object</li>
+ * </ul>
+ */
+ public void _removeMouseListener() {
+ requiredMethod("addMouseListener()");
+ oObj.removeMouseListener(mListener);
+ tRes.tested("removeMouseListener()", true);
+ }
+
+ /**
+ * A class we use to test addMouseMotionListener() and
+ * removeMouseMotionListener()
+ */
+ public class TestMouseMotionListener implements XMouseMotionListener {
+ public boolean dragged = false;
+ public boolean moved = false;
+
+ public void mouseDragged(MouseEvent e) {
+ dragged = true;
+ }
+
+ public void mouseMoved(MouseEvent e) {
+ moved = true;
+ }
+
+ public void disposing(EventObject e) {}
+
+ public void init() {
+ dragged = false;
+ moved = false;
+ }
+
+ }
+
+ private TestMouseMotionListener mmListener = new TestMouseMotionListener();
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if no exceptions were thrown. <p>
+ */
+ public void _addMouseMotionListener() {
+ oObj.addMouseMotionListener(mmListener);
+ tRes.tested("addMouseMotionListener()", true);
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addMouseMotionListener() </code> : adds mouse motion
+ * listener to the object</li>
+ * </ul>
+ */
+ public void _removeMouseMotionListener() {
+ requiredMethod("addMouseMotionListener()");
+ oObj.removeMouseMotionListener(mmListener);
+ tRes.tested("removeMouseMotionListener()", true);
+ }
+
+ /**
+ * A class we use to test addPaintListener() and
+ * removePaintListener()
+ */
+ public class TestPaintListener implements XPaintListener {
+ public boolean paint = false;
+
+ public void windowPaint(PaintEvent e) {
+ paint = true;
+ }
+
+ public void disposing(EventObject e) {}
+
+ public void init() {
+ paint = false;
+ }
+
+ }
+
+ private TestPaintListener pListener = new TestPaintListener();
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if no exceptions were thrown. <p>
+ */
+ public void _addPaintListener() {
+ oObj.addPaintListener(pListener);
+ tRes.tested("addPaintListener()", true);
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addPaintListener() </code> : adds paint listener to
+ * the object </li>
+ * </ul>
+ */
+ public void _removePaintListener() {
+ requiredMethod("addPaintListener()");
+ oObj.removePaintListener(pListener);
+ tRes.tested("removePaintListener()", true);
+ }
+
+ /**
+ * 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) ;
+ }
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/tree/_TreeControlModel.java b/qadevOOo/tests/java/ifc/awt/tree/_TreeControlModel.java
new file mode 100644
index 000000000000..197ec80110e8
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/tree/_TreeControlModel.java
@@ -0,0 +1,37 @@
+/*************************************************************************
+ *
+ * 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.awt.tree;
+
+import lib.MultiPropertyTest;
+
+/*
+* Testing <code>com.sun.star.awt.tree.TreeControlModel</code>
+* service properties </br>
+* @see com.sun.star.awt.tree.TreeControlModel
+*/
+public class _TreeControlModel extends MultiPropertyTest { }
diff --git a/qadevOOo/tests/java/ifc/awt/tree/_XMutableTreeDataModel.java b/qadevOOo/tests/java/ifc/awt/tree/_XMutableTreeDataModel.java
new file mode 100644
index 000000000000..cc21a2828db0
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/tree/_XMutableTreeDataModel.java
@@ -0,0 +1,99 @@
+/*************************************************************************
+ *
+ * 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.awt.tree;
+
+import com.sun.star.awt.tree.XMutableTreeDataModel;
+import com.sun.star.awt.tree.XMutableTreeNode;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.awt.tree.XMutableTreeDataModel</code>
+* interface methods :
+* <ul>
+* <li><code> createNode()</code></li>
+* <li><code> setRoot()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+
+* @see com.sun.star.awt.tree.XMutableTreeDataModel
+*/
+public class _XMutableTreeDataModel extends MultiMethodTest {
+
+ public XMutableTreeDataModel oObj = null;
+
+ private XMutableTreeNode mNewNode = null;
+
+ /**
+ * Sets the title to some string. <p>
+ * Has <b>OK</b> status if no runtime exceptions occurs.
+ */
+ public void _createNode() {
+
+ mNewNode = oObj.createNode("Hallo Welt", true);
+
+ tRes.tested("createNode()", true) ;
+ }
+
+ /**
+ * Gets the title and compares it to the value set in
+ * <code>setTitle</code> method test. <p>
+ * Has <b>OK</b> status is set/get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setTitle </code> </li>
+ * </ul>
+ */
+ public void _setRoot() {
+ requiredMethod("createNode()") ;
+
+ boolean bOK = true;
+ try {
+
+ oObj.setRoot(mNewNode);
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ bOK = false;
+ log.println("ERROR: while trying to set a new root an IllegalArgumentException was thrown:\n" + ex.toString());
+ }
+
+ try {
+
+ oObj.setRoot(null);
+ bOK = false;
+ log.println("ERROR: while trying to set a null object as root expected IllegalArgumentException was not thrown.");
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ log.println("expected IllegalArgumentException was thrown => ok");
+
+ }
+
+ tRes.tested("setRoot()", bOK);
+
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/awt/tree/_XMutableTreeNode.java b/qadevOOo/tests/java/ifc/awt/tree/_XMutableTreeNode.java
new file mode 100644
index 000000000000..e90665889733
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/tree/_XMutableTreeNode.java
@@ -0,0 +1,295 @@
+/*************************************************************************
+ *
+ * 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.awt.tree;
+
+import com.sun.star.awt.tree.XMutableTreeNode;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+ * Testing <code>com.sun.star.awt.tree.XTreeDataModel</code>
+ * interface methods :
+ * <ul>
+ * <li><code> appendChild()</code></li>
+ * <li><code> insertChildByIndex()</code></li>
+ * <li><code> removeChildByIndex()</code></li>
+ * <li><code> setHasChildrenOnDemand()</code></li>
+ * <li><code> setDisplayValue()</code></li>
+ * <li><code> setNodeGraphicURL()</code></li>
+ * <li><code> setExpandedGraphicURL()</code></li>
+ * <li><code> setCollapsedGraphicURL()</code></li>
+ * <li><code> DataValue()</code></li>
+ * </ul> <p>
+ * Test is <b> NOT </b> multithread compilant. <p>
+ *
+ * @see com.sun.star.awt.tree.XTreeDataModel
+ */
+public class _XMutableTreeNode extends MultiMethodTest {
+
+ public XMutableTreeNode oObj = null;
+
+ private int mCount = 0;
+
+ private XMutableTreeNodeCreator nodeCreator = null;
+
+ public static interface XMutableTreeNodeCreator{
+ public XMutableTreeNode createNode(String name);
+ }
+
+ public void before(){
+ nodeCreator = (XMutableTreeNodeCreator) tEnv.getObjRelation("XMutableTreeNodeCreator");
+ if (nodeCreator == null){
+ throw new StatusException(Status.failed(
+ "Couldn't get relation 'XMutableTreeNodeCreator'"));
+ }
+
+ }
+
+ public void _appendChild(){
+ boolean bOK = true;
+
+ log.println("try to append a valid node...");
+
+ XMutableTreeNode myNode = nodeCreator.createNode("myNodeToAppend");
+
+ try {
+ oObj.appendChild(myNode);
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ log.println("ERROR: could not appedn a valid node: " + ex.toString());
+ bOK = false;
+ }
+
+ log.println("try to append the node a second time...");
+ try {
+
+ oObj.appendChild(myNode);
+ log.println("ERROR: expected IllegalArgumentException was not thrown => FAILED");
+ bOK = false;
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ log.println("expected IllegalArgumentException was thrown => OK");
+ }
+
+ log.println("try to append the object itself...");
+ try {
+
+ oObj.appendChild(oObj);
+ log.println("ERROR: expected IllegalArgumentException was not thrown => FAILED");
+ bOK = false;
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ log.println("expected IllegalArgumentException was thrown => OK");
+ }
+
+ tRes.tested("appendChild()", bOK);
+ }
+
+ public void _insertChildByIndex(){
+ boolean bOK = true;
+
+ XMutableTreeNode myNode = nodeCreator.createNode("myNodeToInsert");
+
+ try {
+ log.println("try to insert a valid node...");
+ oObj.insertChildByIndex(0, myNode);
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ log.println("ERROR: could not insert a valid node: " + ex.toString());
+ bOK = false;
+ } catch (com.sun.star.lang.IndexOutOfBoundsException ex) {
+ log.println("ERROR: could not insert a valid node on index '0': " + ex.toString());
+ bOK = false;
+ }
+
+ try {
+ log.println("try to insert a valid node a second time...");
+ oObj.insertChildByIndex(0, myNode);
+ log.println("ERROR: expected IllegalArgumentException was not thrown => FAILED");
+ bOK = false;
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ log.println("expected IllegalArgumentException wa thrown => OK");
+ } catch (com.sun.star.lang.IndexOutOfBoundsException ex) {
+ log.println("ERROR: wrong IndexOutOfBoundsException was thrown. Expected is IllegalArgumentException => FAILED");
+ bOK = false;
+ }
+
+ XMutableTreeNode myNode2 = nodeCreator.createNode("myNodeToInsert2");
+
+ try {
+ log.println("try to insert a valid node on invalid index '-3'...");
+ oObj.insertChildByIndex(-3, myNode2);
+ log.println("ERROR: expected IndexOutOfBoundsException was not thrown => FAILED");
+ bOK = false;
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ log.println("ERROR: wrong IllegalArgumentException was thrown. Expeced is IndexOutOfBoundsException => FAILED");
+ bOK = false;
+ } catch (com.sun.star.lang.IndexOutOfBoundsException ex) {
+ log.println("Expected IndexOutOfBoundsException was thrown => OK");
+ }
+
+ try {
+ log.println("try to insert the object itself...");
+ oObj.insertChildByIndex(0, oObj);
+ log.println("ERROR: expected IllegalArgumentException was not thrown => FAILED");
+ bOK = false;
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ log.println("expected IllegalArgumentException was thrown => OK");
+ } catch (com.sun.star.lang.IndexOutOfBoundsException ex) {
+ log.println("unexpected IndexOutOfBoundsException was thrown, expected was IllegalArgumentException => FAILED");
+ bOK = false;
+ }
+
+ tRes.tested("insertChildByIndex()", bOK);
+ }
+
+ public void _removeChildByIndex(){
+
+ requiredMethod("insertChildByIndex()");
+ boolean bOK = true;
+
+ try {
+ log.println("try to remove node at index '0'...");
+ oObj.removeChildByIndex(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException ex) {
+ log.println("ERROR: IndexOutOfBoundsException was thrown => FAILED");
+ bOK = false;
+ }
+
+ try {
+ log.println("try to remove node at invalid index '-3'");
+ oObj.removeChildByIndex(-3);
+ log.println("ERROR: expeced IndexOutOfBoundsException was not thrown => FAILED");
+ bOK = false;
+ } catch (com.sun.star.lang.IndexOutOfBoundsException ex) {
+ log.println("expected IndexOutOfBoundsException was thrown => OK");
+ }
+ tRes.tested("removeChildByIndex()", bOK);
+ }
+
+ public void _setHasChildrenOnDemand(){
+ boolean bOK = true;
+
+ log.println("setHasChildrenOnDemand(true)");
+ oObj.setHasChildrenOnDemand(true);
+
+ log.println("setHasChildrenOnDemand(false)");
+ oObj.setHasChildrenOnDemand(false);
+
+ tRes.tested("setHasChildrenOnDemand()", bOK);
+ }
+
+ public void _setDisplayValue(){
+ boolean bOK = true;
+
+ log.println("setDisplayValue(\"MyTestValue\")");
+ oObj.setDisplayValue("MyTestValue");
+
+ log.println("setDisplayValue(null)");
+ oObj.setDisplayValue(null);
+
+ log.println("oObj.setDisplayValue(oObj)");
+ oObj.setDisplayValue(oObj);
+
+ tRes.tested("setDisplayValue()", bOK);
+ }
+
+ public void _setNodeGraphicURL(){
+ boolean bOK = true;
+
+ log.println("setNodeGraphicURL(\"MyTestURL\")");
+ oObj.setNodeGraphicURL("MyTestURL");
+
+ log.println("setNodeGraphicURL(null)");
+ oObj.setNodeGraphicURL(null);
+
+ tRes.tested("setNodeGraphicURL()", bOK);
+ }
+
+ public void _setExpandedGraphicURL(){
+ boolean bOK = true;
+
+ log.println("setExpandedGraphicURL(\"myExpandedURL\")");
+ oObj.setExpandedGraphicURL("myExpandedURL");
+
+ log.println("setExpandedGraphicURL(null)");
+ oObj.setExpandedGraphicURL(null);
+
+ tRes.tested("setExpandedGraphicURL()", bOK);
+ }
+
+ public void _setCollapsedGraphicURL(){
+ boolean bOK = true;
+
+ log.println("setCollapsedGraphicURL(\"myCollapsedURL\")");
+ oObj.setCollapsedGraphicURL("myCollapsedURL");
+
+ log.println("setCollapsedGraphicURL(null)");
+ oObj.setCollapsedGraphicURL(null);
+
+ tRes.tested("setCollapsedGraphicURL()", bOK);
+ }
+
+ public void _DataValue(){
+ boolean bOK = true;
+
+ log.println("setDataValue(\"myDataValue\")");
+ oObj.setDataValue("myDataValue");
+
+ String sDataValue = (String) oObj.getDataValue();
+
+ if ( ! sDataValue.equals("myDataValue")) {
+ log.println("ERROR: getDataVlaue does not return the value which is inserted before:\n" +
+ "\texpected: myDataValue\n" +
+ "\tgot: " + sDataValue);
+ bOK = false;
+ }
+
+ log.println("setDataValue(null)");
+ oObj.setDataValue(null);
+
+ Object oDataValue = oObj.getDataValue();
+ if ( oDataValue != null) {
+ log.println("ERROR: getDataVlaue does not return the value which is inserted before:\n" +
+ "\texpected: null\n" +
+ "\tgot: " + oDataValue.toString());
+ bOK = false;
+ }
+
+ log.println("oObj.setDisplayValue(oObj)");
+ oObj.setDisplayValue(oObj);
+
+ oDataValue = oObj.getDataValue();
+ if ( oDataValue != null) {
+ log.println("ERROR: getDataVlaue does not return the value which is inserted before:\n" +
+ "\texpected: " + oObj.toString() +"\n" +
+ "\tgot: " + oDataValue.toString());
+ bOK = false;
+ }
+
+ tRes.tested("DataValue()", bOK);
+ }
+
+}
diff --git a/qadevOOo/tests/java/ifc/awt/tree/_XTreeControl.java b/qadevOOo/tests/java/ifc/awt/tree/_XTreeControl.java
new file mode 100644
index 000000000000..600298aea9e9
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/tree/_XTreeControl.java
@@ -0,0 +1,671 @@
+/*************************************************************************
+ *
+ * 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.awt.tree;
+
+import com.sun.star.awt.tree.ExpandVetoException;
+import com.sun.star.awt.tree.TreeExpansionEvent;
+import com.sun.star.awt.tree.XMutableTreeNode;
+import com.sun.star.awt.tree.XTreeControl;
+import com.sun.star.awt.tree.XTreeEditListener;
+import com.sun.star.awt.tree.XTreeExpansionListener;
+import com.sun.star.awt.tree.XTreeNode;
+import com.sun.star.lang.EventObject;
+import com.sun.star.util.VetoException;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+ * Testing <code>com.sun.star.awt.tree.XTreeControl</code>
+ * interface methods :
+ * <ul>
+ * <li><code> isNodeExpanded()</code></li>
+ * <li><code> isNodeCollapsed()</code></li>
+ * <li><code> makeNodeVisible()</code></li>
+ * <li><code> isNodeVisible()</code></li>
+ * <li><code> expandNode()</code></li>
+ * <li><code> collapseNode()</code></li>
+ * <li><code> addTreeExpansionListener()</code></li>
+ * <li><code> removeTreeExpansionListener()</code></li>
+ * <li><code> getNodeForLocation()</code></li>
+ * <li><code> getClosestNodeForLocation()</code></li>
+ * <li><code> isEditing()</code></li>
+ * <li><code> stopEditing()</code></li>
+ * <li><code> cancelEditing()</code></li>
+ * <li><code> startEditingAtNode()</code></li>
+ * <li><code> addTreeEditListener()</code></li>
+ * <li><code> removeTreeEditListener()</code></li>
+ * <li><code> DefaultExpandedGraphicURL()</code></li>
+ * <li><code> DefaultCollapsedGraphicURL()</code></li>* </ul> <p>
+ * Test is <b> NOT </b> multithread compilant. <p>
+ *
+ * @see com.sun.star.awt.tree.XTreeControl
+ */
+public class _XTreeControl extends MultiMethodTest {
+
+ public XTreeControl oObj = null;
+
+ private XMutableTreeNode mNewNode = null;
+
+ private XMutableTreeNode mXNode = null;
+
+ XTreeExpansionListener mTreeExpansionListener1 = new TreeExpansionListenerImpl1();
+
+ XTreeExpansionListener mTreeExpansionListener2 = new TreeExpansionListenerImpl2();
+
+ XTreeEditListener mTreeEditListener1 = new TreeEditListenerImpl1();
+
+ XTreeEditListener mTreeEditListener2 = new TreeEditListenerImpl2();
+
+ boolean mTreeExpanded1 = false;
+ boolean mTreeExpanding1 = false;
+ boolean mTreeCollapsed1 = false;
+ boolean mTreeCollapsing1 = false;
+
+ boolean mTreeExpanded2 = false;
+ boolean mTreeExpanding2 = false;
+ boolean mTreeCollapsed2 = false;
+ boolean mTreeCollapsing2 = false;
+
+ boolean mTreeNodeEditing1 = false;
+ boolean mTreeNodeEdit1 = false;
+
+ boolean mTreeNodeEditing2 = false;
+ boolean mTreeNodeEdit2 = false;
+
+ public static interface XTreeDataModelListenerEvent{
+ public void fireEvent();
+ }
+
+ public class TreeExpansionListenerImpl1 implements XTreeExpansionListener{
+ public void requestChildNodes(TreeExpansionEvent treeExpansionEvent) {
+ log.println("event at ExpansionListener 1: requestChildNodes");
+ }
+
+ public void treeExpanding(TreeExpansionEvent treeExpansionEvent) throws ExpandVetoException {
+ log.println("event at ExpansionListener 1: treeExpanding");
+ mTreeExpanding1 = true;
+ }
+
+ public void treeCollapsing(TreeExpansionEvent treeExpansionEvent) throws ExpandVetoException {
+ log.println("event at ExpansionListener 1: treeCollapsing");
+ mTreeCollapsing1 = true;
+ }
+
+ public void treeExpanded(TreeExpansionEvent treeExpansionEvent) {
+ log.println("event at ExpansionListener 1: treeExpanded");
+ mTreeExpanded1 = true;
+ }
+
+ public void treeCollapsed(TreeExpansionEvent treeExpansionEvent) {
+ log.println("event at ExpansionListener 1: treeCollapsed");
+ mTreeCollapsed1 = true;
+ }
+
+ public void disposing(EventObject eventObject) {
+ log.println("event at ExpansionListener 1: disposing");
+ }
+ }
+
+ public class TreeExpansionListenerImpl2 implements XTreeExpansionListener{
+ public void requestChildNodes(TreeExpansionEvent treeExpansionEvent) {
+ log.println("event at ExpansionListener 2: requestChildNodes");
+ }
+
+ public void treeExpanding(TreeExpansionEvent treeExpansionEvent) throws ExpandVetoException {
+ log.println("event at ExpansionListener 2: treeExpanding");
+ mTreeExpanding2 = true;
+ }
+
+ public void treeCollapsing(TreeExpansionEvent treeExpansionEvent) throws ExpandVetoException {
+ log.println("event at ExpansionListener 2: treeCollapsing");
+ mTreeCollapsing2 = true;
+ }
+
+ public void treeExpanded(TreeExpansionEvent treeExpansionEvent) {
+ log.println("event at ExpansionListener 2: treeExpanded");
+ mTreeExpanded2 = true;
+ }
+
+ public void treeCollapsed(TreeExpansionEvent treeExpansionEvent) {
+ log.println("event at ExpansionListener 2: treeCollapsed");
+ mTreeCollapsed2 = true;
+ }
+
+ public void disposing(EventObject eventObject) {
+ log.println("event at ExpansionListener 2: disposing");
+ }
+
+ }
+
+ public class TreeEditListenerImpl1 implements XTreeEditListener{
+ public void nodeEditing(XTreeNode xTreeNode) throws VetoException {
+ log.println("event at EditListener 1: nodeEditing");
+ mTreeNodeEditing1 = true;
+ }
+
+ public void nodeEdited(XTreeNode xTreeNode, String string) {
+ log.println("event at EditListener 1: nodeEdited");
+ mTreeNodeEdit1 = true;
+ }
+
+ public void disposing(EventObject eventObject) {
+ log.println("event at EditListener 1: disposing");
+ }
+ }
+
+ public class TreeEditListenerImpl2 implements XTreeEditListener{
+ public void nodeEditing(XTreeNode xTreeNode) throws VetoException {
+ log.println("event at EditListener 2: nodeEditing");
+ mTreeNodeEditing2 = true;
+
+ }
+
+ public void nodeEdited(XTreeNode xTreeNode, String string) {
+ log.println("event at EditListener 2: nodeEdited");
+ mTreeNodeEdit2 = true;
+ }
+
+ public void disposing(EventObject eventObject) {
+ log.println("event at EditListener 2: disposing");
+ }
+ }
+
+ private void resetTreeExpandingListener(){
+ mTreeExpanded1 = false;
+ mTreeExpanded2 = false;
+ mTreeCollapsed1 = false;
+ mTreeCollapsed2 = false;
+ mTreeExpanding1 = false;
+ mTreeExpanding2 = false;
+ mTreeCollapsing1 = false;
+ mTreeCollapsing2 = false;
+ }
+
+ private void resetEditListener(){
+ mTreeNodeEditing1 = false;
+ mTreeNodeEdit1 = false;
+ mTreeNodeEditing2 = false;
+ mTreeNodeEdit2 = false;
+ }
+
+ public void before(){
+ mXNode = (XMutableTreeNode) tEnv.getObjRelation("XTreeControl_Node");
+ if (mXNode == null) {
+ throw new StatusException(Status.failed("ERROR: could not get object relation 'XTreeControl_Node'"));
+ }
+ }
+
+ public void _isNodeExpanded() throws ExpandVetoException{
+
+ boolean bOK = true;
+
+ boolean isExpanded = false;
+
+ try {
+ isExpanded = oObj.isNodeExpanded(mXNode);
+ log.println("node is expanded: " + isExpanded);
+
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ bOK = false;
+ log.println("ERROR: could not query for 'isNodeExpanded()': " + ex.toString());
+ }
+
+ if (isExpanded)
+ try {
+
+ log.println("try to collapse node...");
+ oObj.collapseNode(mXNode);
+
+ } catch (ExpandVetoException ex) {
+ bOK = false;
+ log.println("ERROR: could not collapse node: " + ex.toString());
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ bOK = false;
+ log.println("ERROR: could not collapse node: " + ex.toString());
+ }
+ else
+ try {
+
+ log.println("try to expand node...");
+ oObj.expandNode(mXNode);
+
+ } catch (ExpandVetoException ex) {
+ bOK = false;
+ log.println("ERROR: could not expand node: " + ex.toString());
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ bOK = false;
+ log.println("ERROR: could not expand node: " + ex.toString());
+ }
+
+ try {
+
+ boolean isAlsoExpanded = oObj.isNodeExpanded(mXNode);
+
+ bOK &= (isExpanded != isAlsoExpanded);
+
+ log.println("node is expanded: " + isAlsoExpanded + " => " + bOK);
+
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ bOK = false;
+ log.println("ERROR: could not query for 'isNodeExpanded()': " + ex.toString());
+ }
+
+ tRes.tested("isNodeExpanded()", bOK);
+
+ }
+ public void _isNodeCollapsed(){
+
+ boolean bOK = true;
+
+ boolean isCollapsed = false;
+
+ try {
+ isCollapsed = oObj.isNodeCollapsed(mXNode);
+ log.println("node is Collapsed: " + isCollapsed);
+
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ bOK = false;
+ log.println("ERROR: could not query for 'isNodeCollapsed()': " + ex.toString());
+ }
+
+ if ( ! isCollapsed)
+ try {
+
+ log.println("try to collapse node...");
+ oObj.collapseNode(mXNode);
+
+ } catch (ExpandVetoException ex) {
+ bOK = false;
+ log.println("ERROR: could not collapse node: " + ex.toString());
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ bOK = false;
+ log.println("ERROR: could not collapse node: " + ex.toString());
+ }
+ else
+ try {
+
+ log.println("try to expand node...");
+ oObj.expandNode(mXNode);
+
+ } catch (ExpandVetoException ex) {
+ bOK = false;
+ log.println("ERROR: could not expand node: " + ex.toString());
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ bOK = false;
+ log.println("ERROR: could not expand node: " + ex.toString());
+ }
+
+ try {
+
+ boolean isAlsoCollapsed = oObj.isNodeCollapsed(mXNode);
+
+ bOK &= (isCollapsed != isAlsoCollapsed);
+
+ log.println("node is Collapsed: " + isAlsoCollapsed + " => " + bOK);
+
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ bOK = false;
+ log.println("ERROR: could not query for 'isNodeCollapsed()': " + ex.toString());
+ }
+
+ tRes.tested("isNodeCollapsed()", bOK);
+
+ }
+ public void _makeNodeVisible(){
+
+ boolean bOK = true;
+ try {
+
+ oObj.makeNodeVisible(mXNode);
+ } catch (ExpandVetoException ex) {
+ bOK = false;
+ log.println("ERROR: could not call method 'makeNodeVisible()' successfully: " + ex.toString());
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ bOK = false;
+ log.println("ERROR: could not call method 'makeNodeVisible()' successfully: " + ex.toString());
+ }
+ try {
+
+ bOK &= oObj.isNodeVisible(mXNode);
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ bOK = false;
+ log.println("ERROR: could not call method 'isNodeVisible()' successfully: " + ex.toString());
+ }
+
+ tRes.tested("makeNodeVisible()", bOK);
+
+ }
+ public void _isNodeVisible(){
+
+ this.requiredMethod("makeNodeVisible()");
+
+ boolean bOK = true;
+ log.println("since required method 'makeNodeVisible()' uses method 'isNodeVisible()' this test is ok.");
+ tRes.tested("isNodeVisible()", bOK);
+
+ }
+
+ public void _expandNode(){
+
+ this.requiredMethod("isNodeExpanded()");
+
+ boolean bOK = true;
+ log.println("since required method 'isnodeExpanded()' uses method 'expandNode()' this test is ok.");
+ tRes.tested("expandNode()", bOK);
+
+ }
+
+ public void _collapseNode(){
+
+ this.requiredMethod("isNodeCollapsed()");
+
+ boolean bOK = true;
+ log.println("since required method 'isnodeCollapsed()' uses method 'expandNode()' this test is ok.");
+ tRes.tested("collapseNode()", bOK);
+
+ }
+
+ public void _addTreeExpansionListener(){
+
+ boolean bOK = true;
+
+ log.println("collapse Node to get an initial status...");
+ try {
+
+ oObj.collapseNode(mXNode);
+ } catch (ExpandVetoException ex) {
+ bOK = false;
+ log.println("ERROR: could not collapse node: " + ex.toString());
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ bOK = false;
+ log.println("ERROR: could not collapse node: " + ex.toString());
+ }
+
+ log.println("add mTreeExpansionListener1...");
+ oObj.addTreeExpansionListener(mTreeExpansionListener1);
+
+ log.println("add mTreeExpansionListener2");
+ oObj.addTreeExpansionListener(mTreeExpansionListener2);
+
+ resetTreeExpandingListener();
+
+ log.println("expand Node...");
+ try {
+
+ oObj.expandNode(mXNode);
+
+ } catch (ExpandVetoException ex) {
+ bOK = false;
+ log.println("ERROR: could not expand node: " + ex.toString());
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ bOK = false;
+ log.println("ERROR: could not expand node: " + ex.toString());
+ }
+
+ bOK &= mTreeExpanded1 & mTreeExpanded2 & ! mTreeCollapsed1 & ! mTreeCollapsed2
+ & mTreeExpanding1 & mTreeExpanding2 & ! mTreeCollapsing1 & ! mTreeCollapsing2;
+
+ resetTreeExpandingListener();
+
+ log.println("collapse Node...");
+ try {
+
+ oObj.collapseNode(mXNode);
+ } catch (ExpandVetoException ex) {
+ bOK = false;
+ log.println("ERROR: could not collapse node: " + ex.toString());
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ bOK = false;
+ log.println("ERROR: could not collapse node: " + ex.toString());
+ }
+
+ bOK &= ! mTreeExpanded1 & ! mTreeExpanded2 & mTreeCollapsed1 & mTreeCollapsed2
+ & ! mTreeExpanding1 & ! mTreeExpanding2 & mTreeCollapsing1 & mTreeCollapsing2;
+
+ tRes.tested("addTreeExpansionListener()", bOK);
+
+ }
+
+ public void _removeTreeExpansionListener(){
+
+ this.requiredMethod("addTreeExpansionListener()");
+
+ boolean bOK = true;
+
+ log.println("collapse Node to get an initial status...");
+ try {
+
+ oObj.collapseNode(mXNode);
+ } catch (ExpandVetoException ex) {
+ bOK = false;
+ log.println("ERROR: could not collapse node: " + ex.toString());
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ bOK = false;
+ log.println("ERROR: could not collapse node: " + ex.toString());
+ }
+
+ resetTreeExpandingListener();
+
+ log.println("remove mTreeExpansionListener2 ...");
+ oObj.removeTreeExpansionListener(mTreeExpansionListener2);
+
+ log.println("expand Node...");
+ try {
+
+ oObj.expandNode(mXNode);
+
+ } catch (ExpandVetoException ex) {
+ bOK = false;
+ log.println("ERROR: could not expand node: " + ex.toString());
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ bOK = false;
+ log.println("ERROR: could not expand node: " + ex.toString());
+ }
+
+ bOK &= mTreeExpanded1 & ! mTreeExpanded2 & ! mTreeCollapsed1 & ! mTreeCollapsed2
+ & mTreeExpanding1 & ! mTreeExpanding2 & ! mTreeCollapsing1 & ! mTreeCollapsing2;
+
+ resetTreeExpandingListener();
+
+ log.println("collapse Node...");
+ try {
+
+ oObj.collapseNode(mXNode);
+ } catch (ExpandVetoException ex) {
+ bOK = false;
+ log.println("ERROR: could not collapse node: " + ex.toString());
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ bOK = false;
+ log.println("ERROR: could not collapse node: " + ex.toString());
+ }
+
+ bOK &= ! mTreeExpanded1 & ! mTreeExpanded2 & mTreeCollapsed1 & ! mTreeCollapsed2
+ & ! mTreeExpanding1 & ! mTreeExpanding2 & mTreeCollapsing1 & ! mTreeCollapsing2;
+
+ log.println("remove mTreeExpansionListener2 ...");
+ oObj.removeTreeExpansionListener(mTreeExpansionListener2);
+
+ tRes.tested("removeTreeExpansionListener()", bOK);
+
+ }
+
+ public void _getNodeForLocation(){
+
+ boolean bOK = false;
+
+
+ tRes.tested("getNodeForLocation()", bOK);
+
+ }
+
+ public void _getClosestNodeForLocation(){
+
+ boolean bOK = false;
+
+ log.println("try to get Node for location 100,100");
+ XTreeNode myNode = oObj.getClosestNodeForLocation(100,100);
+
+ bOK &= (myNode != null);
+
+ tRes.tested("getClosestNodeForLocation()", bOK);
+
+ }
+
+ public void _isEditing(){
+
+ boolean bOK = false;
+
+ log.println("not ready because of i78701");
+
+ tRes.tested("isEditing()", bOK);
+
+ }
+
+ public void _stopEditing(){
+
+ boolean bOK = false;
+ log.println("not ready because of i78701");
+
+
+ tRes.tested("stopEditing()", bOK);
+
+ }
+
+ public void _cancelEditing(){
+
+ boolean bOK = false;
+
+ log.println("not ready because of i78701");
+
+ tRes.tested("cancelEditing()", bOK);
+
+ }
+
+ public void _startEditingAtNode(){
+
+ boolean bOK = false;
+
+ log.println("not ready because of i78701");
+
+ tRes.tested("startEditingAtNode()", bOK);
+
+ }
+
+ public void _addTreeEditListener(){
+
+ boolean bOK = true;
+
+ log.println("add EditListener 1....");
+ oObj.addTreeEditListener(mTreeEditListener1);
+
+ log.println("add EditListener 2....");
+ oObj.addTreeEditListener(mTreeEditListener2);
+
+ resetEditListener();
+
+ try {
+
+ oObj.startEditingAtNode(mXNode);
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ log.println("ERROR: could not start editing at node: " + ex.toString());
+ bOK = false;
+ }
+
+ log.println("not ready because of i78701");
+ bOK = false;
+
+
+ tRes.tested("addTreeEditListener()", bOK);
+
+ }
+
+ public void _removeTreeEditListener(){
+
+ boolean bOK = false;
+
+ log.println("not ready because of i78701");
+
+ tRes.tested("removeTreeEditListener()", bOK);
+
+ }
+
+ public void _DefaultExpandedGraphicURL(){
+
+ boolean bOK = true;
+
+ String current = oObj.getDefaultExpandedGraphicURL();
+ log.println("current DefaultExpandedGraphicURL: " + current);
+
+ String changeUrl = null;
+
+ if (current.equals("private:graphicrepository/sd/res/triangle_right.png"))
+ changeUrl = "private:graphicrepository/sd/res/triangle_down.png";
+ else changeUrl = "private:graphicrepository/sd/res/triangle_right.png";
+
+ log.println("try to set '" + changeUrl + "' as new DefaultExpandedGraphicURL");
+
+ oObj.setDefaultExpandedGraphicURL(changeUrl);
+
+ String newUrl = oObj.getDefaultExpandedGraphicURL();
+
+ log.println("new DefaultExpandedGraphicURL: " + newUrl);
+
+ bOK &= ! newUrl.equals(current);
+
+ tRes.tested("DefaultExpandedGraphicURL()", bOK);
+
+ }
+
+ public void _DefaultCollapsedGraphicURL(){
+
+ boolean bOK = true;
+
+ String current = oObj.getDefaultCollapsedGraphicURL();
+ log.println("current DefaultCollapsedGraphicURL: " + current);
+
+ String changeUrl = null;
+
+ if (current.equals("private:graphicrepository/sd/res/triangle_right.png"))
+ changeUrl = "private:graphicrepository/sd/res/triangle_down.png";
+ else changeUrl = "private:graphicrepository/sd/res/triangle_right.png";
+
+ log.println("try to set '" + changeUrl + "' as new DefaultCollapsedGraphicURL");
+ oObj.setDefaultCollapsedGraphicURL(changeUrl);
+
+ String newUrl = oObj.getDefaultCollapsedGraphicURL();
+
+ log.println("new DefaultCollapsedGraphicURL: " + newUrl);
+
+ bOK &= ! newUrl.equals(current);
+
+ tRes.tested("DefaultCollapsedGraphicURL()", bOK);
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/awt/tree/_XTreeDataModel.java b/qadevOOo/tests/java/ifc/awt/tree/_XTreeDataModel.java
new file mode 100644
index 000000000000..c2a98b744bae
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/tree/_XTreeDataModel.java
@@ -0,0 +1,183 @@
+/*************************************************************************
+ *
+ * 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.awt.tree;
+
+import com.sun.star.awt.tree.TreeDataModelEvent;
+import com.sun.star.awt.tree.XMutableTreeNode;
+import com.sun.star.awt.tree.XTreeDataModel;
+import com.sun.star.awt.tree.XTreeDataModelListener;
+import com.sun.star.awt.tree.XTreeNode;
+import com.sun.star.lang.EventObject;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+ * Testing <code>com.sun.star.awt.tree.XTreeDataModel</code>
+ * interface methods :
+ * <ul>
+ * <li><code> createNode()</code></li>
+ * <li><code> setRoot()</code></li>
+ * </ul> <p>
+ * Test is <b> NOT </b> multithread compilant. <p>
+ *
+ * @see com.sun.star.awt.tree.XTreeDataModel
+ */
+public class _XTreeDataModel extends MultiMethodTest {
+
+ public XTreeDataModel oObj = null;
+
+ private XMutableTreeNode mNewNode = null;
+
+ XTreeDataModelListener mListener1 = new myEventListener1();
+
+ XTreeDataModelListener mListener2 = new myEventListener2();
+
+ XTreeDataModelListenerEvent mListenerEvent = null;
+
+ boolean mTreeStructureChanged1 = false;
+
+ boolean mTreeStructureChanged2 = false;
+
+ public static interface XTreeDataModelListenerEvent{
+ public void fireEvent();
+ }
+
+ public class myEventListener1 implements XTreeDataModelListener{
+ public void treeNodesChanged(TreeDataModelEvent treeDataModelEvent) {
+ log.println("Listener 1: treeNodesChanged");
+ }
+
+ public void treeNodesInserted(TreeDataModelEvent treeDataModelEvent) {
+ log.println("Listener 1: treeNodesInserted");
+ }
+
+ public void treeNodesRemoved(TreeDataModelEvent treeDataModelEvent) {
+ log.println("Listener 1: treeNodesRemoved");
+ }
+
+ public void treeStructureChanged(TreeDataModelEvent treeDataModelEvent) {
+ log.println("Listener 1: treeStructureChanged");
+ mTreeStructureChanged1 = true;
+ }
+
+ public void disposing(EventObject eventObject) {
+ log.println("Listener 1: disposing");
+ }
+ }
+
+ public class myEventListener2 implements XTreeDataModelListener{
+ public void treeNodesChanged(TreeDataModelEvent treeDataModelEvent) {
+ log.println("Listener 2: treeNodesChanged");
+ }
+
+ public void treeNodesInserted(TreeDataModelEvent treeDataModelEvent) {
+ log.println("Listener 2: treeNodesInserted");
+ }
+
+ public void treeNodesRemoved(TreeDataModelEvent treeDataModelEvent) {
+ log.println("Listener 2: treeNodesRemoved");
+ }
+
+ public void treeStructureChanged(TreeDataModelEvent treeDataModelEvent) {
+ log.println("Listener 2: treeStructureChanged");
+ mTreeStructureChanged2 = true;
+ }
+
+ public void disposing(EventObject eventObject) {
+ log.println("Listener 2: disposing");
+ }
+
+ }
+
+ public void before(){
+ mListenerEvent = (XTreeDataModelListenerEvent) tEnv.getObjRelation("XTreeDataModelListenerEvent");
+ if (mListenerEvent == null) {
+ throw new StatusException(Status.failed("ERROR: could not get object relation 'XTreeDataModelListenerEvent'\n" +
+ "This object relation must be kind of 'ifc.awt.tree._XTreeDataModel.XTreeDataModelListenerEvent'"));
+ }
+ }
+
+ /**
+ * Gets the title and compares it to the value set in
+ * <code>setTitle</code> method test. <p>
+ * Has <b>OK</b> status is set/get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setTitle </code> </li>
+ * </ul>
+ */
+ public void _getRoot() {
+
+ boolean bOK = true;
+ XTreeNode root = oObj.getRoot();
+
+ tRes.tested("getRoot()", bOK);
+
+ }
+
+ public void _addTreeDataModelListener(){
+
+ boolean bOK = true;
+
+ log.println("add listener 1 to object...");
+ oObj.addTreeDataModelListener(mListener1);
+
+ log.println("add listener 2 to object...");
+ oObj.addTreeDataModelListener(mListener2);
+
+ mTreeStructureChanged1 = false;
+ mTreeStructureChanged2 = false;
+
+ mListenerEvent.fireEvent();
+
+ bOK = mTreeStructureChanged1 & mTreeStructureChanged2;
+
+ tRes.tested("addTreeDataModelListener()", bOK);
+ }
+
+ public void _removeTreeDataModelListener(){
+
+ boolean bOK = true;
+
+ log.println("remove listener 2 from object...");
+ oObj.removeTreeDataModelListener(mListener2);
+
+ mTreeStructureChanged1 = false;
+ mTreeStructureChanged2 = false;
+
+ mListenerEvent.fireEvent();
+
+ bOK = mTreeStructureChanged1 & ! mTreeStructureChanged2;
+
+ tRes.tested("removeTreeDataModelListener()", bOK);
+
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/awt/tree/_XTreeNode.java b/qadevOOo/tests/java/ifc/awt/tree/_XTreeNode.java
new file mode 100644
index 000000000000..e1eba75eb497
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/tree/_XTreeNode.java
@@ -0,0 +1,261 @@
+/*************************************************************************
+ *
+ * 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.awt.tree;
+
+import com.sun.star.awt.tree.XTreeNode;
+import com.sun.star.uno.AnyConverter;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+ * Testing <code>com.sun.star.awt.tree.XTreeDataModel</code>
+ * interface methods :
+ * <ul>
+ * <li><code> getChildAt()</code></li>
+ * <li><code> getChildCount()</code></li>
+ * <li><code> getParent()</code></li>
+ * <li><code> getIndex()</code></li>
+ * <li><code> hasChildrenOnDemand()</code></li>
+ * <li><code> getDisplayValue()</code></li>
+ * <li><code> getNodeGraphicURL()</code></li>
+ * <li><code> getExpandedGraphicURL()</code></li>
+ * <li><code> getCollapsedGraphicURL()</code></li> * </ul> <p>
+ * Test is <b> NOT </b> multithread compilant. <p>
+ *
+ * @see com.sun.star.awt.tree.XTreeDataModel
+ */
+public class _XTreeNode extends MultiMethodTest {
+
+ public XTreeNode oObj = null;
+
+ private int mCount = 0;
+
+ String msDisplayValue = null;
+ String msExpandedGraphicURL = null;
+ String msCollapsedGraphicURL = null;
+ String msNodeGraphicURL = null;
+
+
+ public void before(){
+ msDisplayValue = (String) tEnv.getObjRelation("XTreeNode_DisplayValue");
+ if (msDisplayValue == null){
+ throw new StatusException(Status.failed(
+ "Couldn't get relation 'XTreeNode_DisplayVlaue'"));
+ }
+
+ msExpandedGraphicURL = (String) tEnv.getObjRelation("XTreeNode_ExpandedGraphicURL");
+ if (msExpandedGraphicURL == null){
+ throw new StatusException(Status.failed(
+ "Couldn't get relation 'XTreeNode_ExpandedGraphicURL'"));
+ }
+
+ msCollapsedGraphicURL = (String) tEnv.getObjRelation("XTreeNode_CollapsedGraphicURL");
+ if (msCollapsedGraphicURL == null){
+ throw new StatusException(Status.failed(
+ "Couldn't get relation 'XTreeNode_CollapsedGraphicURL'"));
+ }
+
+ msNodeGraphicURL = (String) tEnv.getObjRelation("XTreeNode_NodeGraphicURL");
+ if(msNodeGraphicURL == null){
+ throw new StatusException(Status.failed(
+ "Couldn't get relation 'XTreeNode_NodeGraphicURL'"));
+ }
+
+ }
+
+ /**
+ * Gets the title and compares it to the value set in
+ * <code>setTitle</code> method test. <p>
+ * Has <b>OK</b> status is set/get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setTitle </code> </li>
+ * </ul>
+ */
+ public void _getChildAt(){
+ this.requiredMethod("getChildCount()");
+ boolean bOK = true;
+
+ for (int i=0; i < mCount ; i++){
+ XTreeNode xNode = null;
+ try {
+ xNode = oObj.getChildAt(i);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException ex) {
+ log.println("ERROR: getChildAt(" + i + "): " + ex.toString());
+ }
+ if (xNode == null){
+ log.println("ERROR: getChildAt(" + i + ") returns null => FAILED");
+ bOK = false;
+ }
+ }
+
+ tRes.tested("getChildAt()", bOK);
+ }
+
+
+ public void _getChildCount(){
+
+ boolean bOK = true;
+ mCount = oObj.getChildCount();
+ log.println("got count '" + mCount + "' of children");
+ if (mCount < 1 ) {
+ log.println("ERROR: got a count < 1. The test object must be support morw then zero children => FAILED");
+ bOK = false;
+ }
+ tRes.tested("getChildCount()", bOK);
+ }
+
+
+ public void _getParent(){
+ this.requiredMethod("getChildAt()");
+
+ boolean bOK = true;
+ XTreeNode xNode = null;
+ try {
+ log.println("try to getChildAt(0)");
+ xNode = oObj.getChildAt(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException ex) {
+ log.println("ERROR: getChildAt(0): " + ex.toString());
+ }
+
+ log.println("try to get parrent of children");
+ XTreeNode xParrent = xNode.getParent();
+
+
+ bOK = oObj.equals(xParrent);
+ log.println("original object and parrent should be the same: " + bOK);
+ tRes.tested("getParent()", bOK);
+ }
+
+
+ public void _getIndex(){
+ this.requiredMethod("getChildAt()");
+
+ boolean bOK = true;
+ XTreeNode xNode = null;
+ try {
+ log.println("try to getChildAt(0)");
+ xNode = oObj.getChildAt(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException ex) {
+ log.println("ERROR: getChildAt(0): " + ex.toString());
+ }
+
+ log.println("try to get index from child...");
+ int index = oObj.getIndex(xNode);
+
+ if (index != 0){
+ log.println("ERROR: getIndex() does not return '0' => FAILED");
+ bOK = false;
+ }
+
+ tRes.tested("getIndex()", bOK);
+ }
+
+
+ public void _hasChildrenOnDemand(){
+
+ boolean bOK = true;
+
+ bOK = oObj.hasChildrenOnDemand();
+ tRes.tested("hasChildrenOnDemand()", bOK);
+ }
+
+
+ public void _getDisplayValue(){
+
+ boolean bOK = true;
+ String DisplayValue = null;
+ Object dispVal = oObj.getDisplayValue();
+
+ try {
+ DisplayValue = AnyConverter.toString(dispVal);
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ log.println("ERROR: could not convert the returned object of 'getDisplyValue()' " +
+ "to String with AnyConverter: " + ex.toString());
+ }
+
+ if ( ! this.msDisplayValue.equals(DisplayValue)){
+ log.println("ERROR: getNodeGraphicURL() does not return expected value:\n" +
+ "\tExpected: " + this.msDisplayValue +"\n" +
+ "\tGot: " + DisplayValue);
+ bOK = false;
+ }
+
+ tRes.tested("getDisplayValue()", bOK);
+ }
+
+
+ public void _getNodeGraphicURL(){
+
+ boolean bOK = true;
+ String graphicURL = oObj.getNodeGraphicURL();
+
+ if ( ! this.msNodeGraphicURL.equals(graphicURL)){
+ log.println("ERROR: getNodeGraphicURL() does not return expected value:\n" +
+ "\tExpected: " + this.msNodeGraphicURL +"\n" +
+ "\tGot: " + graphicURL);
+ bOK = false;
+ }
+ tRes.tested("getNodeGraphicURL()", bOK);
+ }
+
+
+ public void _getExpandedGraphicURL(){
+
+ boolean bOK = true;
+ String ExpandedGraphicURL = oObj.getExpandedGraphicURL();
+
+ if ( ! this.msExpandedGraphicURL.equals(ExpandedGraphicURL)){
+ log.println("ERROR: getExpandedGraphicURL() does not return expected value:\n" +
+ "\tExpected: " + this.msExpandedGraphicURL +"\n" +
+ "\tGot: " + ExpandedGraphicURL);
+ bOK = false;
+ }
+
+ tRes.tested("getExpandedGraphicURL()", bOK);
+ }
+
+
+ public void _getCollapsedGraphicURL(){
+
+ boolean bOK = true;
+
+ String CollapsedGraphicURL = oObj.getCollapsedGraphicURL();
+
+ if ( ! this.msCollapsedGraphicURL.equals(CollapsedGraphicURL)){
+ log.println("ERROR: getExpandedGraphicURL() does not return expected value:\n" +
+ "\tExpected: " + this.msCollapsedGraphicURL +"\n" +
+ "\tGot: " + CollapsedGraphicURL);
+ bOK = false;
+ }
+
+ tRes.tested("getCollapsedGraphicURL()", bOK);
+ }
+
+} \ No newline at end of file