summaryrefslogtreecommitdiff
path: root/qadevOOo/tests/java/ifc/ui/dialogs
diff options
context:
space:
mode:
Diffstat (limited to 'qadevOOo/tests/java/ifc/ui/dialogs')
-rw-r--r--qadevOOo/tests/java/ifc/ui/dialogs/_FilePicker.java36
-rw-r--r--qadevOOo/tests/java/ifc/ui/dialogs/_XControlAccess.java142
-rw-r--r--qadevOOo/tests/java/ifc/ui/dialogs/_XControlInformation.java192
-rw-r--r--qadevOOo/tests/java/ifc/ui/dialogs/_XExecutableDialog.java195
-rw-r--r--qadevOOo/tests/java/ifc/ui/dialogs/_XFilePicker.java160
-rw-r--r--qadevOOo/tests/java/ifc/ui/dialogs/_XFilePickerControlAccess.java202
-rw-r--r--qadevOOo/tests/java/ifc/ui/dialogs/_XFilePickerNotifier.java290
-rw-r--r--qadevOOo/tests/java/ifc/ui/dialogs/_XFilePreview.java122
-rw-r--r--qadevOOo/tests/java/ifc/ui/dialogs/_XFilterGroupManager.java64
-rw-r--r--qadevOOo/tests/java/ifc/ui/dialogs/_XFilterManager.java106
-rw-r--r--qadevOOo/tests/java/ifc/ui/dialogs/_XFolderPicker.java115
11 files changed, 1624 insertions, 0 deletions
diff --git a/qadevOOo/tests/java/ifc/ui/dialogs/_FilePicker.java b/qadevOOo/tests/java/ifc/ui/dialogs/_FilePicker.java
new file mode 100644
index 000000000000..a3f681277d41
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/ui/dialogs/_FilePicker.java
@@ -0,0 +1,36 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package ifc.ui.dialogs;
+
+import lib.MultiPropertyTest;
+
+public class _FilePicker extends MultiPropertyTest {
+
+
+} // EOF Calendar
+
diff --git a/qadevOOo/tests/java/ifc/ui/dialogs/_XControlAccess.java b/qadevOOo/tests/java/ifc/ui/dialogs/_XControlAccess.java
new file mode 100644
index 000000000000..a1a9197cd4a6
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/ui/dialogs/_XControlAccess.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.ui.dialogs;
+
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+import com.sun.star.ui.dialogs.XControlAccess;
+import com.sun.star.ui.dialogs.XControlInformation;
+import com.sun.star.uno.UnoRuntime;
+
+/**
+* Testing <code>com.sun.star.ui.XFilePicker</code>
+* interface methods :
+* <ul>
+* <li><code> setControlProperty()</code></li>
+* <li><code> getControlProperty()</code></li>
+* </ul> <p>
+*
+* For testing this interface the component must implement
+* <code>com.sun.star.ui.dialogs.XControlInformation</code>
+* interface. <p>
+*
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.ui.XFolderPicker
+*/
+public class _XControlAccess extends MultiMethodTest {
+
+ public XControlAccess oObj = null;
+ private XControlInformation xCI = null ;
+ private String[] supControls = null ;
+ private String[][] supProperties = null ;
+
+ /**
+ * Tries to query <code>com.sun.star.ui.dialogs.XControlInformation</code>
+ * interface, and obtain properties' names of each available
+ * control. <p>
+ *
+ * @throw StatusException if interface is not supported or
+ * properties couldn't be get.
+ */
+ protected void before() {
+ xCI = (XControlInformation) UnoRuntime.queryInterface
+ (XControlInformation.class, oObj);
+
+ if (xCI == null) throw new StatusException
+ (Status.failed("XControlInformation not supported")) ;
+
+ supControls = xCI.getSupportedControls();
+ supProperties = new String[supControls.length][];
+ for (int i = 0; i < supControls.length; i++) {
+ try {
+ supProperties[i] =
+ xCI.getSupportedControlProperties(supControls[i]);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException
+ ("Exception while init.", e) ;
+ }
+ }
+ }
+
+ /**
+ * Tries to change each property of each control.
+ * Has <b>OK</b> status if values are properly changed.
+ */
+ public void _setControlProperty() {
+ boolean result = true ;
+ String error = "";
+
+ for (int i = 0; i < supControls.length; i++) {
+ log.println("Checking properties for control " + supControls[i]);
+ for (int j = 0; j < supProperties[i].length; j++) {
+ log.println("\t" + supProperties[i][j]);
+ try {
+ Object oldVal = oObj.getControlProperty(supControls[i],
+ supProperties[i][j]);
+ Object newVal = util.ValueChanger.changePValue(oldVal);
+ if (supProperties[i][j].startsWith("Help")) {
+ newVal = "HID:133";
+ }
+ oObj.setControlProperty
+ (supControls[i], supProperties[i][j], newVal) ;
+ Object resVal = oObj.getControlProperty(supControls[i],
+ supProperties[i][j]);
+ log.println("\t Old:" + oldVal + ",New:" + newVal
+ + ",Result:" + resVal);
+ if (!util.ValueComparer.equalValue(newVal, resVal)) {
+ error += "####Property '"+supProperties[i][j]+
+ " of "+supControls[i]+" didn't work\n\r"+
+ "\t Old:" + oldVal + ",New:" + newVal
+ + ",Result:" + resVal+ "\n\r";
+ }
+ result &= util.ValueComparer.equalValue(newVal, resVal);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Unexpected exception:" );
+ e.printStackTrace(log);
+ result = false ;
+ }
+ }
+ }
+
+ log.println(error);
+
+ tRes.tested("setControlProperty()", result) ;
+ tRes.tested("getControlProperty()", result) ;
+ }
+
+ /**
+ * Does nothing. Testing performed in <code>setControlProperty</code>
+ * method test.
+ */
+ public void _getControlProperty() {}
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/ui/dialogs/_XControlInformation.java b/qadevOOo/tests/java/ifc/ui/dialogs/_XControlInformation.java
new file mode 100644
index 000000000000..ad7c8d782d7d
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/ui/dialogs/_XControlInformation.java
@@ -0,0 +1,192 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package ifc.ui.dialogs;
+
+import lib.MultiMethodTest;
+
+import com.sun.star.ui.dialogs.XControlInformation;
+
+/**
+* Testing <code>com.sun.star.ui.XControlInformation</code>
+* interface methods :
+* <ul>
+* <li><code> getSupportedControls()</code></li>
+* <li><code> isControlSupported()</code></li>
+* <li><code> getSupportedControlProperties()</code></li>
+* <li><code> isControlPropertySupported()</code></li>
+* </ul> <p>
+*
+* @see com.sun.star.ui.XFolderPicker
+*/
+public class _XControlInformation extends MultiMethodTest {
+
+ public XControlInformation oObj = null;
+ private String[] supControls = null ;
+ private String[][] supProperties = null ;
+
+ /**
+ * Gets supported controls and stores them. <p>
+ * Has <b>OK</b> status if not <code>null</code> returned.
+ */
+ public void _getSupportedControls() {
+ supControls = oObj.getSupportedControls();
+
+ tRes.tested("getSupportedControls()", supControls != null) ;
+ }
+
+ /**
+ * For every available control check if it is supported.
+ * Also wrong control name (non-existant and empty) are checked.<p>
+ *
+ * Has <b>OK</b> status if <code>true</code> returned for valid
+ * control names and <code>false</code> for invalid.<p>
+ *
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getSupportedControls </code> to have
+ * valid control names</li>
+ * </ul>
+ */
+ public void _isControlSupported() {
+ requiredMethod("getSupportedControls()") ;
+
+ boolean result = true ;
+
+ log.println("Supported controls :");
+ for (int i = 0; i < supControls.length; i++) {
+ log.println(" " + supControls[i]);
+ result &= oObj.isControlSupported(supControls[i]) ;
+ }
+
+ result &= !oObj.isControlSupported("SuchNameMustNotExist");
+ result &= !oObj.isControlSupported("");
+
+ tRes.tested("isControlSupported()", result) ;
+ }
+
+ /**
+ * For each control obtains its properties and stores them. Then tries to
+ * obtain properties for control with invalid name. <p>
+ *
+ * Has <b>OK</b> status if properties arrays are not null and exception
+ * thrown or null returned for control with invalid name <p>
+ *
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getSupportedControls </code> to have
+ * valid control names</li>
+ * </ul>
+ */
+ public void _getSupportedControlProperties() {
+ requiredMethod("getSupportedControls()") ;
+
+ boolean result = true;
+
+ supProperties = new String[supControls.length][];
+ for (int i = 0; i < supControls.length; i++) {
+ log.println("Getting proeprties for control: " + supControls[i]);
+ try {
+ supProperties[i] =
+ oObj.getSupportedControlProperties(supControls[i]);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Unexpected exception:" + e);
+ result = false ;
+ }
+ result &= supProperties[i] != null;
+ }
+
+ try {
+ Object prop = oObj.getSupportedControlProperties("NoSuchControl") ;
+ result &= prop == null;
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Expected exception getting properties " +
+ "for wrong control:" + e);
+ }
+
+ tRes.tested("getSupportedControlProperties()", true) ;
+ }
+
+ /**
+ * <ul>
+ * <li>For each property of each control checks if it is supported.</li>
+ * <li>For each control checks if non-existent property
+ * (with wrong name and with empty name) supported.</li>
+ * <li>Tries to check the property of non-existent control </li>
+ * </ul>
+ * <p>
+ * Has <b>OK</b> status if <code>true</code> returned for the first case,
+ * <code>false</code> for the second, and <code>false</code> or exception
+ * for the third.<p>
+ *
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getSupportedControlProperties </code> to have a set of
+ * valid properties </li>
+ * </ul>
+ */
+ public void _isControlPropertySupported() {
+ requiredMethod("getSupportedControlProperties()") ;
+
+ boolean result = true;
+
+ for (int i = 0; i < supControls.length; i++) {
+ log.println("Checking proeprties for control " + supControls[i]);
+ for (int j = 0; j < supProperties[i].length; j++) {
+ log.println(" " + supProperties[i][j]);
+ try {
+ result &= oObj.isControlPropertySupported
+ (supControls[i], supProperties[i][j]) ;
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Unexpected exception:" + e);
+ result = false ;
+ }
+ }
+
+ try {
+ result &= !oObj.isControlPropertySupported
+ (supControls[i], "NoSuchPropertyForThisControl") ;
+ result &= !oObj.isControlPropertySupported
+ (supControls[i], "") ;
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println
+ ("Unexpected exception (just false must be returned):" + e);
+ result = false ;
+ }
+ }
+
+ try {
+ result &= !oObj.isControlPropertySupported("NoSuchControl", "") ;
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Expected exception: " + e);
+ }
+
+ tRes.tested("isControlPropertySupported()", result) ;
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/ui/dialogs/_XExecutableDialog.java b/qadevOOo/tests/java/ifc/ui/dialogs/_XExecutableDialog.java
new file mode 100644
index 000000000000..95e2c27d9895
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/ui/dialogs/_XExecutableDialog.java
@@ -0,0 +1,195 @@
+/*************************************************************************
+ *
+ * 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.ui.dialogs;
+
+import lib.MultiMethodTest;
+
+import com.sun.star.ui.dialogs.XExecutableDialog;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.util.XCancellable;
+
+/**
+ * Testing <code>com.sun.star.ui.dialogs.XExecutableDialog</code>
+ * interface methods :
+ * <ul>
+ * <li><code> setTitle()</code></li>
+ * <li><code> execute()</code></li>
+ * </ul> <p>
+ *
+ * This interface methods cann't be checked, thereby methods
+ * are just called. <code>execute</code> method is not called
+ * at all as the dialog shown cann't be disposed. <p>
+ *
+ * Test is <b> NOT </b> multithread compilant. <p>
+ * @see com.sun.star.ui.dialogs.XExecutableDialog
+ */
+public class _XExecutableDialog extends MultiMethodTest {
+
+ public XExecutableDialog oObj = null;
+ private ExecThread eThread = null;
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ */
+ public void _setTitle() {
+ oObj.setTitle("The Title");
+ tRes.tested("setTitle()",true);
+ }
+
+ /**
+ * This method is excluded from automated test since
+ * we can't close the dialog. <p>
+ * Always has <b>OK</b> status.
+ */
+ public void _execute() {
+ String aName = tEnv.getTestCase().getObjectName();
+ boolean result = false;
+ if (aName.startsWith("OData") || aName.startsWith("OSQL")) {
+ log.println("dbaccess dialogs can't be closed via API");
+ log.println("therefore they aren't executed");
+ log.println("and the result is set to true");
+ result = true;
+ } else {
+ eThread = new ExecThread(oObj);
+ log.println("Starting Dialog");
+ eThread.start();
+ XCancellable canc = (XCancellable)UnoRuntime.queryInterface
+ (XCancellable.class, tEnv.getTestObject());
+ shortWait();
+ if (canc != null) {
+ closeDialog();
+ short res = eThread.execRes;
+ log.println("result: "+res);
+ result = (res == 0);
+ } else {
+ this.disposeEnvironment();
+ result=true;
+ log.println("XCancellable isn't supported and the "+
+ "environment is killed hard");
+ }
+
+
+ }
+ tRes.tested("execute()",result);
+ }
+
+ /**
+ * Calls <code>execute()</code> method in a separate thread.
+ * Necessary to check if this method works
+ */
+ protected class ExecThread extends Thread {
+
+ public short execRes = (short) 17 ;
+ private XExecutableDialog Diag = null ;
+
+ public ExecThread(XExecutableDialog Diag) {
+ this.Diag = Diag ;
+ }
+
+ public void run() {
+ try {
+ execRes = Diag.execute();
+ System.out.println("HERE: "+execRes);
+ } catch(Exception e) {
+ log.println("Thread has been interrupted ... ");
+ }
+ }
+ }
+
+ /**
+ * Sleeps for 5 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) ;
+ }
+ }
+
+ public void after() {
+ if (eThread.isAlive()) {
+ log.println("Thread didn't die ... cleaning up");
+ disposeEnvironment();
+ }
+ }
+
+ private void closeDialog() {
+ XCancellable canc = (XCancellable) UnoRuntime.queryInterface(
+ XCancellable.class, tEnv.getTestObject());
+ if (canc != null) {
+ log.println("Cancelling Dialog");
+ canc.cancel();
+ } else {
+ this.disposeEnvironment();
+ }
+
+ long st = System.currentTimeMillis();
+ boolean toLong = false;
+
+ log.println("waiting for dialog to close");
+
+ while (eThread.isAlive() && !toLong) {
+ //wait for dialog to close
+ toLong = (System.currentTimeMillis()-st > 10000);
+ }
+
+ log.println("done");
+
+ try {
+ if (eThread.isAlive()) {
+ log.println("Interrupting Thread");
+ eThread.interrupt();
+ eThread.yield();
+ }
+ } catch (Exception e) {
+ // who cares ;-)
+ }
+
+ st = System.currentTimeMillis();
+ toLong = false;
+
+ log.println("waiting for interruption to work");
+
+ while (eThread.isAlive() && !toLong) {
+ //wait for dialog to close
+ toLong = (System.currentTimeMillis()-st > 10000);
+ }
+
+ log.println("DialogThread alive: "+eThread.isAlive());
+
+ log.println("done");
+
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/ui/dialogs/_XFilePicker.java b/qadevOOo/tests/java/ifc/ui/dialogs/_XFilePicker.java
new file mode 100644
index 000000000000..45ceec2db964
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/ui/dialogs/_XFilePicker.java
@@ -0,0 +1,160 @@
+/*************************************************************************
+ *
+ * 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.ui.dialogs;
+
+import lib.MultiMethodTest;
+
+import com.sun.star.ui.dialogs.XFilePicker;
+
+/**
+* Testing <code>com.sun.star.ui.XFilePicker</code>
+* interface methods :
+* <ul>
+* <li><code> setMultiSelectionMode()</code></li>
+* <li><code> setDefaultName()</code></li>
+* <li><code> setDisplayDirectory()</code></li>
+* <li><code> getDisplayDirectory()</code></li>
+* <li><code> getPath()</code></li>
+* </ul> <p>
+* The following predefined files needed to complete the test:
+* <ul>
+* <li> <code>'space-metal.jpg'</code> : just to exist. </li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.ui.XFolderPicker
+*/
+public class _XFilePicker extends MultiMethodTest {
+
+ public XFilePicker oObj = null;
+ private String dir = null ;
+ private String fname = "space-metal.jpg" ;
+
+ /**
+ * Sets the current directory to the test document directory. <p>
+ * Has <b>OK</b> status if no exceptions occured.
+ */
+ public void _setDisplayDirectory() {
+ boolean result = true ;
+ dir = util.utils.getFullTestURL("") ;
+
+ log.println("Trying to set dir '" + dir + "'") ;
+ try {
+ oObj.setDisplayDirectory(dir) ;
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Directory '" + dir + "' not found :" + e) ;
+ result = false ;
+ }
+
+ tRes.tested("setDisplayDirectory()", result) ;
+ }
+
+ /**
+ * Gets the current directory. <p>
+ * Has <b>OK</b> status if get value is equal to set value
+ * passed to <code>setDisplayDirectory</code> <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setDisplayDirectory </code> </li>
+ * </ul>
+ */
+ public void _getDisplayDirectory() {
+ requiredMethod("setDisplayDirectory()") ;
+
+ String gDir = oObj.getDisplayDirectory() ;
+
+ log.println("Get dir '" + gDir + "'") ;
+
+ tRes.tested("getDisplayDirectory()", dir.equals(gDir)) ;
+ }
+
+ /**
+ * Sets default name to file name existing in test document
+ * directory ('space-metal.jpg'). <p>
+ * Has <b>OK</b> status if no exceptions occured.
+ */
+ public void _setDefaultName() {
+ boolean result = true ;
+
+ try {
+ oObj.setDefaultName(fname) ;
+ } catch (Exception e) {
+ log.println("Exception setting default name :" + e) ;
+ result = false ;
+ }
+
+ tRes.tested("setDefaultName()", result) ;
+ }
+
+ /**
+ * Just switch object to MultiSelectionMode. There is no ways
+ * to check this method (only interactively). <p>
+ * Has <b>OK</b> status if no runtime exceptions occured.
+ */
+ public void _setMultiSelectionMode() {
+
+ oObj.setMultiSelectionMode(true) ;
+
+ tRes.tested("setMultiSelectionMode()", true) ;
+ }
+
+ /**
+ * Gets completed path from dialog. If <code>execute()</code>
+ * method was not called then zero length array is returned.
+ * So to check actual functionality of this method interactive
+ * testing is required. <p>
+ * Has <b>OK</b> status if zero length array returned (this
+ * occurs if <code>execute()</code>
+ * method was not called yet) or if array contains at least one
+ * element and it equals to <code>[Directory set] +
+ * [Default file name set]</code>. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setDisplayDirectory </code> </li>
+ * <li> <code> setDefaultName </code> </li>
+ * </ul>
+ */
+ public void _getFiles() {
+ requiredMethod("setDisplayDirectory()");
+ requiredMethod("setDefaultName()");
+
+ String[] files = oObj.getFiles();
+
+ if (files.length > 0) {
+ log.println("Path get : '" + files[0] + "'") ;
+
+ tRes.tested("getFiles()", (dir + fname).equals(files[0])) ;
+ } else {
+ log.println("No files were selected or execute() method was not called.") ;
+
+ tRes.tested("getFiles()", true);
+ }
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/ui/dialogs/_XFilePickerControlAccess.java b/qadevOOo/tests/java/ifc/ui/dialogs/_XFilePickerControlAccess.java
new file mode 100644
index 000000000000..07c5c3b93f6d
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/ui/dialogs/_XFilePickerControlAccess.java
@@ -0,0 +1,202 @@
+/*************************************************************************
+ *
+ * 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.ui.dialogs;
+
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+import util.ValueChanger;
+import util.ValueComparer;
+
+import com.sun.star.ui.dialogs.XFilePickerControlAccess;
+
+/**
+* Testing <code>com.sun.star.ui.XFilePickerControlAccess</code>
+* interface methods :
+* <ul>
+* <li><code> setValue()</code></li>
+* <li><code> getValue()</code></li>
+* <li><code> setLabel()</code></li>
+* <li><code> getLabel()</code></li>
+* <li><code> getFocused()</code></li>
+* <li><code> enableControl()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'XFilePickerControlAccess.ControlID'</code> (of type
+* <code>Short</code>) : control identifier in the extended
+* FilePicker dialog. </li>
+* <li> <code>'XFilePickerControlAccess.ControlValue'</code> (of type
+* <code>Object</code>) <b>optional</b> (but mostly desireable
+* since the control has emtpy initial value):
+* the value which can set for the control . </li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.ui.XFilePickerControlAccess
+*/
+public class _XFilePickerControlAccess extends MultiMethodTest {
+
+ public XFilePickerControlAccess oObj = null;
+ private short cntlID = -1 ;
+ private Object oldVal = null ;
+ private String oldLab = null ;
+
+ /**
+ * Retrieves object relations.
+ * @throws StatusException If one of relations not found.
+ */
+ public void before() {
+ Short ID = (Short) tEnv.getObjRelation
+ ("XFilePickerControlAccess.ControlID") ;
+ if (ID == null) {
+ log.println("!!! Relation not found !!!") ;
+ throw new StatusException(Status.failed("Relation not found")) ;
+ }
+
+ cntlID = ID.shortValue() ;
+ }
+
+ /**
+ * Gets the value of the control and stores it. <p>
+ * Has <b>OK</b> status if no runtime exceptions occured.
+ */
+ public void _getValue() {
+ boolean result = true ;
+
+ try {
+ oldVal = oObj.getValue(cntlID,(short)0);
+ } catch (Exception e) {
+ e.printStackTrace(log) ;
+ result = false ;
+ }
+
+ tRes.tested("getValue()", result) ;
+ }
+
+ /**
+ * Changes the value gotten by <code>getValue</code> method,
+ * or gets the value from relation if it exits.
+ * Sets this value and then check if it was properly set. <p>
+ * Has <b>OK</b> status if <code>getValue</code> method returns
+ * the same value which was set. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getValue </code> </li>
+ * </ul>
+ */
+ public void _setValue() {
+ requiredMethod("getValue()") ;
+ boolean result = true ;
+
+ Object newVal = tEnv.getObjRelation
+ ("XFilePickerControlAccess.ControlValue");
+ if (newVal == null) {
+ newVal = ValueChanger.changePValue(oldVal) ;
+ }
+
+ Object getVal = null ;
+
+ try {
+ oObj.setValue(cntlID, (short)0 , newVal) ;
+ getVal = oObj.getValue(cntlID,(short)0) ;
+ } catch (Exception e) {
+ e.printStackTrace(log) ;
+ result = false ;
+ }
+
+ result &= ValueComparer.equalValue(newVal, getVal) ;
+
+ tRes.tested("setValue()", result) ;
+ }
+
+ /**
+ * Gets the label of the control and stores it. <p>
+ * Has <b>OK</b> status if no runtime exceptions occured.
+ */
+ public void _getLabel() {
+
+ try {
+ oldLab = oObj.getLabel(cntlID);
+ } catch (Exception e) {
+ e.printStackTrace(log) ;
+ }
+
+ tRes.tested("getLabel()", oldLab != null) ;
+ }
+
+ /**
+ * Changes the label gotten by <code>getLabel</code> method,
+ * set this label and then check if it was properly set. <p>
+ * Has <b>OK</b> status if <code>getLael</code> method returns
+ * the same value which was set. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getLabel </code> </li>
+ * </ul>
+ */
+ public void _setLabel() {
+ requiredMethod("getLabel()") ;
+ boolean result = true ;
+
+ String newVal = oldLab + "_" ;
+ String getVal = null ;
+
+ try {
+ oObj.setLabel(cntlID, newVal) ;
+ getVal = oObj.getLabel(cntlID) ;
+ } catch (Exception e) {
+ e.printStackTrace(log) ;
+ result = false ;
+ }
+
+ result &= newVal.equals(getVal) ;
+
+ tRes.tested("setLabel()", result) ;
+ }
+
+ /**
+ * Disables and then enables the control. Can be checked only
+ * interactively. <p>
+ * Has <b>OK</b> status if no runtime exceptions occured.
+ */
+ public void _enableControl() {
+ boolean result = true ;
+
+ try {
+ oObj.enableControl(cntlID, false) ;
+ oObj.enableControl(cntlID, true) ;
+ } catch (Exception e) {
+ e.printStackTrace(log) ;
+ result = false ;
+ }
+
+ tRes.tested("enableControl()", result) ;
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/ui/dialogs/_XFilePickerNotifier.java b/qadevOOo/tests/java/ifc/ui/dialogs/_XFilePickerNotifier.java
new file mode 100644
index 000000000000..f39ec63ee80d
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/ui/dialogs/_XFilePickerNotifier.java
@@ -0,0 +1,290 @@
+/*************************************************************************
+ *
+ * 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.ui.dialogs;
+
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+import com.sun.star.lang.EventObject;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.ui.dialogs.FilePickerEvent;
+import com.sun.star.ui.dialogs.XExecutableDialog;
+import com.sun.star.ui.dialogs.XFilePicker;
+import com.sun.star.ui.dialogs.XFilePickerListener;
+import com.sun.star.ui.dialogs.XFilePickerNotifier;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.util.XCancellable;
+
+
+/**
+ * Testing <code>com.sun.star.ui.XFilePickerNotifier</code>
+ * interface methods :
+ * <ul>
+ * <li><code> addFilePickerListener()</code></li>
+ * <li><code> removeFilePickerListener()</code></li>
+ * </ul> <p>
+ * The object must implement <code>XFilePicker</code>
+ * interface to check if a listener was called. <p>
+ * Test is <b> NOT </b> multithread compilant. <p>
+ * @see com.sun.star.ui.XFilePickerNotifier
+ */
+public class _XFilePickerNotifier extends MultiMethodTest {
+
+ public XFilePickerNotifier oObj = null;
+ private XFilePicker fps = null ;
+ private String dir1 = null,
+ dir2 = null ;
+ ExecThread eThread = null;
+
+
+ /**
+ * Listener implementation which sets a flag if some of its
+ * methods was called.
+ */
+ protected class TestListener implements XFilePickerListener {
+ public boolean called = false ;
+
+ public void dialogSizeChanged() {
+ called = true;
+ }
+
+ public void fileSelectionChanged(FilePickerEvent e) {
+ called = true;
+ }
+
+ public void directoryChanged(FilePickerEvent e) {
+ log.println("***** Directory Changed *****");
+ called = true;
+ }
+
+ public String helpRequested(FilePickerEvent e) {
+ called = true;
+ return "help";
+ }
+
+ public void controlStateChanged(FilePickerEvent e) {
+ called = true;
+ }
+
+ public void disposing(EventObject e) {}
+ }
+
+ TestListener listener = new TestListener() ;
+
+ /**
+ * Tries to query object for <code>XFilePicker</code> interface, and
+ * initializes two different URLs for changing file picker directory. <p>
+ * @throw StatusException If object doesn't support <code>XFilePicker</code>
+ * interface.
+ */
+ public void before() {
+ fps = (XFilePicker) UnoRuntime.queryInterface
+ (XFilePicker.class, oObj) ;
+
+ if (fps == null) {
+ log.println("The object doesnt implement XFilePicker") ;
+ throw new StatusException(Status.failed
+ ("The object doesnt implement XFilePicker"));
+ }
+
+ XExecutableDialog exD = (XExecutableDialog) UnoRuntime.queryInterface(
+ XExecutableDialog.class, tEnv.getTestObject());
+
+ dir1 = util.utils.getOfficeTemp((XMultiServiceFactory)tParam.getMSF());
+ dir2 = util.utils.getFullTestURL("");
+ eThread = new ExecThread(exD);
+ }
+
+ /**
+ * Adds a listener, then tries to change display directory and
+ * checks if the listener was called. <p>
+ * Has <b>OK</b> status if a listener method was called.
+ */
+ public void _addFilePickerListener() {
+ oObj.addFilePickerListener(listener) ;
+
+ try {
+ log.println("***** Setting DisplayDirectory to " + dir1);
+ fps.setDisplayDirectory(dir1) ;
+ log.println("***** Getting: " + fps.getDisplayDirectory());
+ openDialog();
+ log.println("***** Setting DisplayDirectory to " + dir2);
+ fps.setDisplayDirectory(dir2) ;
+ log.println("***** Getting: " + fps.getDisplayDirectory());
+
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ log.println("!!! Exception changing dir !!!") ;
+ e.printStackTrace(log) ;
+ }
+
+ shortWait();
+
+ if (!listener.called) {
+ log.println("Listener wasn't called :-(");
+ }
+
+ closeDialog();
+
+ tRes.tested("addFilePickerListener()", listener.called) ;
+ }
+
+ /**
+ * Removes the listener and changes display directory. <p>
+ * Has <b>OK</b> status if the listener wasn't called. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addFilePickerListener </code> </li>
+ * </ul>
+ */
+ public void _removeFilePickerListener() {
+ requiredMethod("addFilePickerListener()") ;
+
+ oObj.removeFilePickerListener(listener) ;
+
+ listener.called = false ;
+
+ try {
+ fps.setDisplayDirectory(dir1) ;
+ openDialog();
+ fps.setDisplayDirectory(dir2) ;
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ log.println("!!! Exception changing dir !!!") ;
+ e.printStackTrace(log) ;
+ }
+
+ shortWait();
+
+ closeDialog();
+
+ tRes.tested("removeFilePickerListener()", !listener.called) ;
+ }
+
+ /**
+ * Calls <code>execute()</code> method in a separate thread.
+ * Necessary to check if this method works
+ */
+ protected class ExecThread extends Thread {
+
+ public short execRes = (short) 17 ;
+ private XExecutableDialog Diag = null ;
+
+ public ExecThread(XExecutableDialog Diag) {
+ this.Diag = Diag ;
+ }
+
+ public void run() {
+ try {
+ execRes = Diag.execute();
+ System.out.println("HERE: "+execRes);
+ } catch (Exception e) {
+ log.println("Thread has been interrupted ...");
+ }
+ }
+ }
+
+ /**
+ * Sleeps for 0.5 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) ;
+ }
+ }
+
+ private void closeDialog() {
+ XCancellable canc = (XCancellable) UnoRuntime.queryInterface(
+ XCancellable.class, tEnv.getTestObject());
+ if (canc != null) {
+ log.println("Cancelling Dialog");
+ canc.cancel();
+ } else {
+ this.disposeEnvironment();
+ }
+
+ long st = System.currentTimeMillis();
+ boolean toLong = false;
+
+ log.println("waiting for dialog to close");
+
+ while (eThread.isAlive() && !toLong) {
+ //wait for dialog to close
+ toLong = (System.currentTimeMillis()-st > 10000);
+ }
+
+ log.println("done");
+
+ try {
+ if (eThread.isAlive()) {
+ log.println("Interrupting Thread");
+ eThread.interrupt();
+ eThread.yield();
+ }
+ } catch (Exception e) {
+ // who cares ;-)
+ }
+
+ st = System.currentTimeMillis();
+ toLong = false;
+
+ log.println("waiting for interruption to work");
+
+ while (eThread.isAlive() && !toLong) {
+ //wait for dialog to close
+ toLong = (System.currentTimeMillis()-st > 10000);
+ }
+
+ log.println("DialogThread alive: "+eThread.isAlive());
+
+ log.println("done");
+
+ }
+
+ private void openDialog() {
+ log.println("Starting Dialog");
+ if (eThread.isAlive()) {
+ log.println("second interrupt");
+ eThread.interrupt();
+ eThread.yield();
+ }
+
+ XExecutableDialog exD = (XExecutableDialog) UnoRuntime.queryInterface(
+ XExecutableDialog.class, tEnv.getTestObject());
+
+ dir1 = util.utils.getOfficeTemp((XMultiServiceFactory)tParam.getMSF());
+ dir2 = util.utils.getFullTestURL("");
+ eThread = new ExecThread(exD);
+
+ eThread.start();
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/ui/dialogs/_XFilePreview.java b/qadevOOo/tests/java/ifc/ui/dialogs/_XFilePreview.java
new file mode 100644
index 000000000000..1a6565e38d96
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/ui/dialogs/_XFilePreview.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.ui.dialogs;
+
+import lib.MultiMethodTest;
+import lib.StatusException;
+
+import com.sun.star.ui.dialogs.XFilePreview;
+
+public class _XFilePreview extends MultiMethodTest {
+
+ public XFilePreview oObj=null;
+
+ /**
+ * _getSupportedImageFormats() gets all formats and
+ * stores them in an Array of short.<br>
+ * Is OK is the resulting Array isn't empty
+ */
+ public void _getSupportedImageFormats() {
+ short[] formats = oObj.getSupportedImageFormats();
+ tRes.tested("getSupportedImageFormats()", formats.length > 0);
+ }
+
+ /**
+ * _getTargetColorDepth() gets the color depth
+ * and stores it in an int.<br>
+ * Is OK is the resulting int isn't 1
+ */
+ public void _getTargetColorDepth() {
+ int CDepth = oObj.getTargetColorDepth();
+ tRes.tested("getTargetColorDepth()",CDepth != 1);
+ }
+
+ /**
+ * _getAvailableWidth() gets the width
+ * and stores it in an int.<br>
+ * Is OK is the resulting int isn't 1
+ */
+ public void _getAvailableWidth() {
+ int the_width = oObj.getAvailableWidth();
+ tRes.tested("getAvailableWidth()", the_width != 1);
+ }
+
+ /**
+ * _getAvailableHeight() gets the width
+ * and stores it in an int.<br>
+ * Is OK is the resulting int isn't 1
+ */
+ public void _getAvailableHeight() {
+ int the_height = oObj.getAvailableHeight();
+ tRes.tested("getAvailableHeight()", the_height != 1);
+ }
+
+ /**
+ * sets the empty image.
+ * Is OK if no exception no exceptions were thrown.
+ */
+ public void _setImage() {
+ boolean bOK = true;
+ try {
+ oObj.setImage
+ (com.sun.star.ui.dialogs.FilePreviewImageFormats.BITMAP,null);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ bOK = false;
+ throw new StatusException( "Can't set empty image", e );
+ }
+ tRes.tested("setImage()", bOK);
+ }
+
+ boolean prev_state;
+
+ /**
+ * _setShowState() sets the state
+ * to the opposite value returned by getShowState.<br>
+ * Is OK is the returned result is false or if
+ * the value that was set is equal to the value
+ * that was returned by getShowState.
+ */
+ public void _setShowState() {
+ requiredMethod("getShowState()");
+ boolean success = oObj.setShowState(!prev_state);
+ boolean res_state = oObj.getShowState();
+ tRes.tested("setShowState()", !success || res_state != prev_state);
+ }
+
+ /**
+ * _getShowState() gets the state
+ * and sets it to the opposite.<br>
+ * Is OK if no exceptions were thrown
+ */
+ public void _getShowState() {
+ prev_state = oObj.getShowState();
+ tRes.tested("getShowState()", true);
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/ui/dialogs/_XFilterGroupManager.java b/qadevOOo/tests/java/ifc/ui/dialogs/_XFilterGroupManager.java
new file mode 100644
index 000000000000..3ef3df73aa64
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/ui/dialogs/_XFilterGroupManager.java
@@ -0,0 +1,64 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package ifc.ui.dialogs;
+
+import lib.MultiMethodTest;
+
+import com.sun.star.beans.StringPair;
+import com.sun.star.ui.dialogs.XFilterGroupManager;
+
+/**
+* Testing <code>com.sun.star.ui.dialogs.XFilterGroupManager</code>
+* @see com.sun.star.ui.XFilterGroupManager
+*/
+public class _XFilterGroupManager extends MultiMethodTest {
+
+ public XFilterGroupManager oObj = null;
+
+ /**
+ * Appends a new FilterGroup (for extension 'txt'). <p>
+ * Has <b>OK</b> status if no runtime exceptions ocured.
+ */
+ public void _appendFilterGroup() {
+ boolean res = true;
+ try {
+ StringPair[] args = new StringPair[1];
+ args[0] = new StringPair();
+ args[0].First = "ApiTextFiles";
+ args[0].Second = "txt";
+ oObj.appendFilterGroup("TestFilter", args);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ res=false;
+ }
+
+ tRes.tested("appendFilterGroup()", res) ;
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/ui/dialogs/_XFilterManager.java b/qadevOOo/tests/java/ifc/ui/dialogs/_XFilterManager.java
new file mode 100644
index 000000000000..cc960d2b191b
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/ui/dialogs/_XFilterManager.java
@@ -0,0 +1,106 @@
+/*************************************************************************
+ *
+ * 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.ui.dialogs;
+
+import lib.MultiMethodTest;
+
+import com.sun.star.ui.dialogs.XFilterManager;
+
+/**
+* Testing <code>com.sun.star.ui.XFilterManager</code>
+* interface methods :
+* <ul>
+* <li><code> appendFilter()</code></li>
+* <li><code> setCurrentFilter()</code></li>
+* <li><code> getCurrentFilter()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.ui.XFilterManager
+*/
+public class _XFilterManager extends MultiMethodTest {
+
+ public XFilterManager oObj = null;
+
+ /**
+ * Appends a new filter (for extension 'txt'). <p>
+ * Has <b>OK</b> status if no runtime exceptions ocured.
+ */
+ public void _appendFilter() {
+ boolean res = true;
+ try {
+ oObj.appendFilter("TestFilter", "txt");
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ res=false;
+ }
+
+ tRes.tested("appendFilter()", res) ;
+ }
+
+ /**
+ * Sets the current filter to that which was appended before.<p>
+ * Has <b>OK</b> status if no exceptions occured, else one of
+ * <code>appendFilter</code> and <code>setCurrentFilter</code>
+ * methods failed. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> appendFilter </code> </li>
+ * </ul>
+ */
+ public void _setCurrentFilter() {
+ requiredMethod("appendFilter()") ;
+ boolean result = true;
+
+ try {
+ oObj.setCurrentFilter("TestFilter") ;
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("setCurrentFilter() or appendFilter() failed") ;
+ result = false ;
+ }
+
+ tRes.tested("setCurrentFilter()", result) ;
+ }
+
+ /**
+ * Gets current filter name and compares it filter name set before.<p>
+ * Has <b>OK</b> status if set and get filter names are equal.<p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setCurrentFilter </code> </li>
+ * </ul>
+ */
+ public void _getCurrentFilter() {
+ requiredMethod("setCurrentFilter()") ;
+
+ String gVal = oObj.getCurrentFilter() ;
+
+ tRes.tested("getCurrentFilter()", "TestFilter".equals(gVal)) ;
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/ui/dialogs/_XFolderPicker.java b/qadevOOo/tests/java/ifc/ui/dialogs/_XFolderPicker.java
new file mode 100644
index 000000000000..4b761e6dea65
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/ui/dialogs/_XFolderPicker.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.ui.dialogs;
+
+import lib.MultiMethodTest;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.ui.dialogs.XFolderPicker;
+
+/**
+* Testing <code>com.sun.star.ui.XFolderPicker</code>
+* interface methods :
+* <ul>
+* <li><code> setDisplayDirectory()</code></li>
+* <li><code> getDisplayDirectory()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.ui.XFolderPicker
+*/
+public class _XFolderPicker extends MultiMethodTest {
+
+ public XFolderPicker oObj = null;
+ private String dir = null ;
+
+ /**
+ * Sets the current directory to SOffice temp dir. <p>
+ * Has <b>OK</b> status if no exceptions occured.
+ */
+ public void _setDisplayDirectory() {
+ boolean result = true ;
+ dir = util.utils.getOfficeTemp((XMultiServiceFactory)tParam.getMSF()) ;
+
+ log.println("Trying to set dir '" + dir + "'") ;
+ try {
+ oObj.setDisplayDirectory(dir) ;
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Directory '" + dir + "' not found :" + e) ;
+ result = false ;
+ }
+
+ tRes.tested("setDisplayDirectory()", result) ;
+ }
+
+ /**
+ * Gets the current directory. <p>
+ * Has <b>OK</b> status if get value is equal to set value
+ * passed to <code>setDisplayDirectory</code> <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setDisplayDirectory </code> </li>
+ * </ul>
+ */
+ public void _getDisplayDirectory() {
+ requiredMethod("setDisplayDirectory()") ;
+
+ String gDir = oObj.getDisplayDirectory() ;
+
+ log.println("Get dir '" + gDir + "'") ;
+
+ tRes.tested("getDisplayDirectory()", dir.equals(gDir)) ;
+ }
+
+ /**
+ * Gets the directory chosen by the user. <p>
+ * Has <b>OK</b> status if get value is not NULL <p>
+ */
+ public void _getDirectory() {
+
+ String gDir = oObj.getDirectory() ;
+
+ log.println("Get dir '" + gDir + "'") ;
+
+ tRes.tested("getDirectory()", gDir != null) ;
+ }
+
+ /**
+ * Sets the Description for the dialog. <p>
+ * Has <b>OK</b> status if no error occurs <p>
+ */
+ public void _setDescription() {
+
+ oObj.setDescription("XFolderPicker") ;
+ //to visually check if the method works
+ //oObj.execute();
+ tRes.tested("setDescription()", true) ;
+ }
+
+}
+
+