summaryrefslogtreecommitdiff
path: root/qadevOOo/tests/java/ifc/ui
diff options
context:
space:
mode:
Diffstat (limited to 'qadevOOo/tests/java/ifc/ui')
-rw-r--r--qadevOOo/tests/java/ifc/ui/_XContextMenuInterception.java212
-rwxr-xr-xqadevOOo/tests/java/ifc/ui/_XModuleUIConfigurationManager.java81
-rwxr-xr-xqadevOOo/tests/java/ifc/ui/_XModuleUIConfigurationManagerSupplier.java64
-rwxr-xr-xqadevOOo/tests/java/ifc/ui/_XUIConfiguration.java102
-rwxr-xr-xqadevOOo/tests/java/ifc/ui/_XUIConfigurationListener.java53
-rwxr-xr-xqadevOOo/tests/java/ifc/ui/_XUIConfigurationManager.java363
-rwxr-xr-xqadevOOo/tests/java/ifc/ui/_XUIConfigurationPersistence.java83
-rwxr-xr-xqadevOOo/tests/java/ifc/ui/_XUIConfigurationStorage.java76
-rwxr-xr-xqadevOOo/tests/java/ifc/ui/_XUIElementFactory.java56
-rwxr-xr-xqadevOOo/tests/java/ifc/ui/_XUIElementFactoryRegistration.java83
-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
21 files changed, 2797 insertions, 0 deletions
diff --git a/qadevOOo/tests/java/ifc/ui/_XContextMenuInterception.java b/qadevOOo/tests/java/ifc/ui/_XContextMenuInterception.java
new file mode 100644
index 000000000000..3e5361e9f2e0
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/ui/_XContextMenuInterception.java
@@ -0,0 +1,212 @@
+/*************************************************************************
+ *
+ * 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;
+
+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.Point;
+import com.sun.star.awt.Rectangle;
+import com.sun.star.awt.XExtendedToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.IndexOutOfBoundsException;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.ui.XContextMenuInterception;
+import com.sun.star.ui.XContextMenuInterceptor;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import helper.ContextMenuInterceptor;
+import java.awt.Robot;
+import java.awt.event.InputEvent;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+import util.AccessibilityTools;
+import util.DesktopTools;
+import util.utils;
+
+public class _XContextMenuInterception extends MultiMethodTest {
+
+ private XModel docModel = null;
+ private XContextMenuInterceptor xCI = null;
+ public XContextMenuInterception oObj = null;
+ private XWindow xWindow = null;
+ private XMultiServiceFactory xMSF = null;
+ private Point point = null;
+
+ public void before() {
+ docModel = (XModel) UnoRuntime.queryInterface(
+ XModel.class,tEnv.getObjRelation("FirstModel"));
+
+ xCI = (XContextMenuInterceptor) UnoRuntime.queryInterface(
+ XContextMenuInterceptor.class, new ContextMenuInterceptor());
+
+ xMSF = (XMultiServiceFactory)tParam.getMSF();
+
+ //ensure that the first model is focused
+
+ log.println("ensure that the first model is focused");
+ DesktopTools.bringWindowToFront(docModel);
+
+ utils.shortWait(3000);
+ }
+
+ public void after() {
+ if (xCI != null) {
+ oObj.releaseContextMenuInterceptor(xCI);
+ }
+ }
+
+ public void _registerContextMenuInterceptor() {
+ oObj.registerContextMenuInterceptor(xCI);
+ openContextMenu(docModel);
+ boolean res = checkHelpEntry();
+ releasePopUp();
+ tRes.tested("registerContextMenuInterceptor()",res);
+ }
+
+ public void _releaseContextMenuInterceptor() {
+ requiredMethod("registerContextMenuInterceptor()");
+ oObj.releaseContextMenuInterceptor(xCI);
+ openContextMenu(docModel);
+ boolean res = checkHelpEntry();
+ releasePopUp();
+ tRes.tested("releaseContextMenuInterceptor()",!res);
+ }
+
+ private boolean checkHelpEntry(){
+ XInterface toolkit = null;
+ boolean res = true;
+
+ log.println("get accesibility...");
+ try{
+ toolkit = (XInterface) xMSF.createInstance("com.sun.star.awt.Toolkit");
+ } catch (com.sun.star.uno.Exception e){
+ log.println("could not get Toolkit " + e.toString());
+ }
+ XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface(
+ XExtendedToolkit.class, toolkit);
+
+ XAccessible xRoot = null;
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ try {
+ xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ tk.getTopWindow(0));
+
+ xRoot = at.getAccessibleObject(xWindow);
+ at.printAccessibleTree(log, xRoot, tParam.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Couldn't get Window");
+ }
+
+ XAccessibleContext oPopMenu = at.getAccessibleObjectForRole(xRoot, AccessibleRole.POPUP_MENU,true);
+
+ log.println("ImplementationName: " + util.utils.getImplName(oPopMenu));
+
+ XAccessible xHelp = null;
+ try{
+ log.println("Try to get second entry of context menu...");
+ xHelp = oPopMenu.getAccessibleChild(1);
+
+ } catch (IndexOutOfBoundsException e){
+ throw new StatusException("Not possible to get second entry of context menu",e);
+ }
+
+ if (xHelp == null) throw new StatusException(new Status("second entry of context menu is NULL", false));
+
+ XAccessibleContext xHelpCont = xHelp.getAccessibleContext();
+
+ if ( xHelpCont == null )
+ throw new StatusException(new Status("No able to retrieve accessible context from first entry of context menu",false));
+
+ String aAccessibleName = xHelpCont.getAccessibleName();
+ if ( !aAccessibleName.equals( "Help" )) {
+ log.println("Accessible name found = "+aAccessibleName );
+ log.println("Second entry of context menu is not from context menu interceptor");
+ res=false;
+ }
+
+ return res;
+
+ }
+
+ private void openContextMenu(XModel xModel){
+
+ log.println("try to open contex menu...");
+ AccessibilityTools at = new AccessibilityTools();
+
+ xWindow = at.getCurrentWindow(xMSF, xModel);
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ XInterface oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PANEL);
+
+ XAccessibleComponent window = (XAccessibleComponent) UnoRuntime.queryInterface(
+ XAccessibleComponent.class, oObj);
+
+ point = window.getLocationOnScreen();
+ Rectangle rect = window.getBounds();
+
+ log.println("klick mouse button...");
+ try {
+ Robot rob = new Robot();
+ int x = point.X + (rect.Width / 2);
+ int y = point.Y + (rect.Height / 2);
+ rob.mouseMove(x, y);
+ System.out.println("Press Button");
+ rob.mousePress(InputEvent.BUTTON3_MASK);
+ System.out.println("Release Button");
+ rob.mouseRelease(InputEvent.BUTTON3_MASK);
+ System.out.println("done");
+ } catch (java.awt.AWTException e) {
+ log.println("couldn't press mouse button");
+ }
+
+ utils.shortWait(1000);
+
+ }
+
+ private void releasePopUp() {
+ log.println("release the popup menu");
+ try {
+ Robot rob = new Robot();
+ int x = point.X;
+ int y = point.Y;
+ 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");
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/ifc/ui/_XModuleUIConfigurationManager.java b/qadevOOo/tests/java/ifc/ui/_XModuleUIConfigurationManager.java
new file mode 100755
index 000000000000..024f72d07259
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/ui/_XModuleUIConfigurationManager.java
@@ -0,0 +1,81 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package ifc.ui;
+
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.ui.XModuleUIConfigurationManager;
+import lib.MultiMethodTest;
+
+public class _XModuleUIConfigurationManager extends MultiMethodTest {
+
+ public XModuleUIConfigurationManager oObj = null;
+ private String resourceUrl = null;
+
+ public void before() {
+ resourceUrl = (String)tEnv.getObjRelation("XModuleUIConfigurationManager.ResourceURL");
+ }
+
+ public void _isDefaultSettings() {
+ boolean result;
+ try {
+ result = oObj.isDefaultSettings(resourceUrl);
+ }
+ catch(com.sun.star.lang.IllegalArgumentException e) {
+ log.println("'" + resourceUrl + "' is an illegal resource.");
+ result = false;
+ }
+ String notPossibleUrl = "private:resource/menubar/dingsbums";
+ try {
+ result &= !oObj.isDefaultSettings(notPossibleUrl);
+ }
+ catch(com.sun.star.lang.IllegalArgumentException e) {
+ log.println("'" + notPossibleUrl + "' is an illegal resource.");
+ result = false;
+ }
+
+ tRes.tested("isDefaultSettings()", result);
+ }
+
+ public void _getDefaultSettings() {
+ boolean result;
+ try {
+ XIndexAccess xIndexAcc = oObj.getDefaultSettings(resourceUrl);
+ result = xIndexAcc != null;
+ }
+ catch(com.sun.star.lang.IllegalArgumentException e) {
+ log.println("'" + resourceUrl + "' is an illegal resource.");
+ result = false;
+ }
+ catch(com.sun.star.container.NoSuchElementException e) {
+ log.println("No resource '" + resourceUrl + "' available.");
+ result = false;
+ }
+ tRes.tested("getDefaultSettings()", result);
+ }
+
+}
diff --git a/qadevOOo/tests/java/ifc/ui/_XModuleUIConfigurationManagerSupplier.java b/qadevOOo/tests/java/ifc/ui/_XModuleUIConfigurationManagerSupplier.java
new file mode 100755
index 000000000000..f2c87692d7bc
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/ui/_XModuleUIConfigurationManagerSupplier.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;
+
+import com.sun.star.lang.XServiceInfo;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.ui.XModuleUIConfigurationManagerSupplier;
+import lib.MultiMethodTest;
+
+public class _XModuleUIConfigurationManagerSupplier extends MultiMethodTest {
+
+ public XModuleUIConfigurationManagerSupplier oObj;
+
+ public void _getUIConfigurationManager() {
+ String configManagerName = null;
+ String implementationName = null;
+ try {
+ configManagerName = (String)tEnv.getObjRelation("XModuleUIConfigurationManagerSupplier.ConfigurationManager");
+ implementationName = (String)tEnv.getObjRelation("XModuleUIConfigurationManagerSupplier.ConfigManagerImplementationName");
+
+ // get a config manager for the StartModule
+ Object o = oObj.getUIConfigurationManager(configManagerName);
+ XServiceInfo xServiceInfo = (XServiceInfo)UnoRuntime.queryInterface(XServiceInfo.class, o);
+ String impName = xServiceInfo.getImplementationName();
+ boolean result = impName.equals(implementationName);
+ if (!result) {
+ log.println("Returned implementation was '" + impName +
+ "' but should have been '" + implementationName + "'");
+ }
+ tRes.tested("getUIConfigurationManager()", result);
+ return;
+ }
+ catch(com.sun.star.container.NoSuchElementException e) {
+ log.println("Could not get a configuration manager called '" + configManagerName + "'");
+ e.printStackTrace(log);
+ }
+ tRes.tested("getUIConfigurationManager()", false);
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/ifc/ui/_XUIConfiguration.java b/qadevOOo/tests/java/ifc/ui/_XUIConfiguration.java
new file mode 100755
index 000000000000..9b0fea0096c5
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/ui/_XUIConfiguration.java
@@ -0,0 +1,102 @@
+/*************************************************************************
+ *
+ * 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;
+
+import com.sun.star.ui.XUIConfiguration;
+import com.sun.star.ui.XUIConfigurationListener;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.ui.XUIConfiguration</code>
+* interface methods :
+* <ul>
+* <li><code> addConfigurationListener()</code></li>
+* <li><code> removeConfigurationListener()</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.ui.XUIConfiguration
+*/
+
+public class _XUIConfiguration extends MultiMethodTest {
+
+ public XUIConfiguration oObj;
+ XUIConfigurationListenerImpl xListener = null;
+
+ /**
+ * Interface for the Listener of the object relation
+ * <CODE>XUIConfiguration.XUIConfigurationListenerImpl</CODE>
+ * @see com.sun.star.ui.XUIConfigurationListener
+ */
+ public static interface XUIConfigurationListenerImpl
+ extends XUIConfigurationListener {
+ public void reset();
+ public void fireEvent();
+ public boolean actionWasTriggered();
+ }
+
+
+ /**
+ * try to get a listener out of the object relation
+ * <CODE>XUIConfiguration.XUIConfigurationListenerImpl</CODE>
+ */
+ public void before() {
+ xListener = (XUIConfigurationListenerImpl)tEnv.getObjRelation(
+ "XUIConfiguration.XUIConfigurationListenerImpl");
+ XUIConfigurationListener l;
+ }
+
+ /**
+ * adds a listener an fire an event
+ * Has <B>OK</B> status if listener was called
+ */
+ public void _addConfigurationListener() {
+ oObj.addConfigurationListener(xListener);
+ xListener.fireEvent();
+ tRes.tested("addConfigurationListener()", xListener.actionWasTriggered());
+ }
+
+ /**
+ * removes the listener and calls an event.
+ * Has <B>OK</B> status if listener is not called.
+ */
+ public void _removeConfigurationListener() {
+ requiredMethod("addConfigurationListener()");
+ oObj.removeConfigurationListener(xListener);
+ xListener.reset();
+ xListener.fireEvent();
+ tRes.tested("removeConfigurationListener()", !xListener.actionWasTriggered());
+ }
+
+ /**
+ * Dispose because the UIConfigurationManager has to be recreated
+ */
+ public void after() {
+ disposeEnvironment();
+ }
+}
diff --git a/qadevOOo/tests/java/ifc/ui/_XUIConfigurationListener.java b/qadevOOo/tests/java/ifc/ui/_XUIConfigurationListener.java
new file mode 100755
index 000000000000..cd24140d988e
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/ui/_XUIConfigurationListener.java
@@ -0,0 +1,53 @@
+/*************************************************************************
+ *
+ * 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;
+
+import com.sun.star.ui.ConfigurationEvent;
+import com.sun.star.ui.XUIConfigurationListener;
+import lib.MultiMethodTest;
+
+public class _XUIConfigurationListener extends MultiMethodTest {
+
+ public XUIConfigurationListener oObj = null;
+
+ public void _elementInserted() {
+ ConfigurationEvent event = new ConfigurationEvent();
+ oObj.elementInserted(event);
+ tRes.tested("elementInserted()", true);
+ }
+ public void _elementRemoved() {
+ ConfigurationEvent event = new ConfigurationEvent();
+ oObj.elementRemoved(event);
+ tRes.tested("elementRemoved()", true);
+ }
+ public void _elementReplaced() {
+ ConfigurationEvent event = new ConfigurationEvent();
+ oObj.elementReplaced(event);
+ tRes.tested("elementReplaced()", true);
+ }
+}
diff --git a/qadevOOo/tests/java/ifc/ui/_XUIConfigurationManager.java b/qadevOOo/tests/java/ifc/ui/_XUIConfigurationManager.java
new file mode 100755
index 000000000000..53ddc59e6ce9
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/ui/_XUIConfigurationManager.java
@@ -0,0 +1,363 @@
+/*************************************************************************
+ *
+ * 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;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.container.XIndexContainer;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.lang.XServiceInfo;
+import com.sun.star.lang.XSingleComponentFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XComponentContext;
+import com.sun.star.ui.UIElementType;
+import com.sun.star.ui.XImageManager;
+import com.sun.star.ui.XUIConfigurationManager;
+import java.io.PrintWriter;
+import lib.MultiMethodTest;
+
+public class _XUIConfigurationManager extends MultiMethodTest {
+
+ public XUIConfigurationManager oObj;
+ private String msResourceUrl = "private:resource/menubar/menubar";
+ private String msMyResourceUrl = "private:resource/menubar/mymenubar";
+ private XIndexContainer mxSettings = null;
+ private XIndexAccess mxMenuBarSettings = null;
+ private XMultiServiceFactory mxMSF = null;
+ private String sShortCutManagerServiceName = null;
+
+
+ /**
+ * Some stuff before the tests:
+ * extract the multi service factory.
+ */
+ protected void before() {
+ mxMSF = (XMultiServiceFactory)tParam.getMSF();
+ sShortCutManagerServiceName = (String)tEnv.getObjRelation("XConfigurationManager.ShortCutManager");
+
+ }
+
+ /**
+ * reset all changes: do at the end.
+ */
+ public void _reset() {
+ requiredMethod("removeSettings()");
+ oObj.reset();
+ tRes.tested("reset()", true);
+ }
+
+ public void _getUIElementsInfo() {
+ boolean result = true;
+ try {
+ PropertyValue[][]props = oObj.getUIElementsInfo(UIElementType.UNKNOWN);
+ for (int i=0; i<props.length; i++)
+ for(int j=0; j<props[i].length; j++)
+ log.println("Prop["+i+"]["+j+"]: " + props[i][j].Name + " " + props[i][j].Value.toString());
+ }
+ catch(com.sun.star.lang.IllegalArgumentException e) {
+ result = false;
+ e.printStackTrace(log);
+ }
+ tRes.tested("getUIElementsInfo()", result);
+ }
+
+ public void _createSettings() {
+ mxSettings = oObj.createSettings();
+ util.dbg.printInterfaces(mxSettings);
+ tRes.tested("createSettings()", mxSettings != null);
+ }
+
+ public void _hasSettings() {
+ boolean result = false;
+ try {
+ result = oObj.hasSettings(msResourceUrl);
+ }
+ catch(com.sun.star.lang.IllegalArgumentException e) {
+ log.println(e);
+ result = false;
+ }
+ tRes.tested("hasSettings()", result);
+ }
+
+ public void _getSettings() {
+ requiredMethod("hasSettings()");
+ boolean result = true;
+ try {
+ mxMenuBarSettings = oObj.getSettings(msResourceUrl, true);
+ result = mxMenuBarSettings != null;
+ for (int i=0; i<mxMenuBarSettings.getCount(); i++) {
+ Object[] o = (Object[])mxMenuBarSettings.getByIndex(i);
+ log.println("+++++++++ i = " + i);
+ for (int j=0; j<o.length; j++) {
+ PropertyValue prop = (PropertyValue)o[j];
+ log.println("Property" + j + ": " + prop.Name + " " + prop.Value.toString());
+ }
+ }
+ }
+ catch(com.sun.star.container.NoSuchElementException e) {
+ result = false;
+ e.printStackTrace(log);
+ }
+ catch(com.sun.star.lang.IllegalArgumentException e) {
+ result = false;
+ e.printStackTrace(log);
+ }
+ catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ result = false;
+ e.printStackTrace(log);
+ }
+ catch(com.sun.star.lang.WrappedTargetException e) {
+ result = false;
+ e.printStackTrace(log);
+ }
+ tRes.tested("getSettings()", result);
+ }
+
+ public void _replaceSettings() {
+ requiredMethod("getSettings()");
+ boolean result = true;
+ PropertyValue[] prop = createMenuBarEntry("My Entry", mxMenuBarSettings, mxMSF, log);
+ if (prop == null) {
+ tRes.tested("replaceSettings()", false);
+ return;
+ }
+
+ createMenuBarItem("Click for Macro", (XIndexContainer)UnoRuntime.queryInterface(
+ XIndexContainer.class, prop[3].Value), log);
+
+ XIndexContainer x = (XIndexContainer)UnoRuntime.queryInterface(XIndexContainer.class, mxMenuBarSettings);
+ try {
+ x.insertByIndex(x.getCount(), prop);
+ }
+ catch(com.sun.star.lang.IllegalArgumentException e) {
+ result = false;
+ e.printStackTrace(log);
+ }
+ catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ result = false;
+ e.printStackTrace(log);
+ }
+ catch(com.sun.star.lang.WrappedTargetException e) {
+ result = false;
+ e.printStackTrace(log);
+ }
+
+ try {
+ oObj.replaceSettings(msResourceUrl, mxMenuBarSettings);
+ }
+ catch(com.sun.star.container.NoSuchElementException e) {
+ result = false;
+ e.printStackTrace(log);
+ }
+ catch(com.sun.star.lang.IllegalArgumentException e) {
+ result = false;
+ e.printStackTrace(log);
+ }
+ catch(com.sun.star.lang.IllegalAccessException e) {
+ result = false;
+ e.printStackTrace(log);
+ }
+ _getSettings();
+ tRes.tested("replaceSettings()", result);
+ }
+
+ public void _removeSettings() {
+ requiredMethod("insertSettings()");
+ boolean result = true;
+ try {
+ oObj.removeSettings(msMyResourceUrl);
+ }
+ catch(com.sun.star.container.NoSuchElementException e) {
+ result = false;
+ e.printStackTrace(log);
+ }
+ catch(com.sun.star.lang.IllegalArgumentException e) {
+ result = false;
+ e.printStackTrace(log);
+ }
+ catch(com.sun.star.lang.IllegalAccessException e) {
+ e.printStackTrace(log);
+ result = false;
+ }
+ tRes.tested("removeSettings()", result);
+ }
+
+ public void _insertSettings() {
+ requiredMethod("createSettings()");
+ requiredMethod("replaceSettings()");
+ boolean result = true;
+ util.dbg.printInterfaces(mxSettings);
+ PropertyValue[] prop = createMenuBarEntry("A new entry", mxSettings, mxMSF, log);
+ if (prop == null) {
+ tRes.tested("replaceSettings()", false);
+ return;
+ }
+
+ createMenuBarItem("A new sub entry", (XIndexContainer)UnoRuntime.queryInterface(
+ XIndexContainer.class, prop[3].Value), log);
+
+ XIndexContainer x = (XIndexContainer)UnoRuntime.queryInterface(XIndexContainer.class,mxSettings);
+ try {
+ int count = x.getCount();
+ x.insertByIndex(count, prop);
+ }
+ catch(com.sun.star.lang.IllegalArgumentException e) {
+ result = false;
+ e.printStackTrace(log);
+ }
+ catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ result = false;
+ e.printStackTrace(log);
+ }
+ catch(com.sun.star.lang.WrappedTargetException e) {
+ result = false;
+ e.printStackTrace(log);
+ }
+
+ try {
+ oObj.insertSettings(msMyResourceUrl, mxSettings);
+ }
+ catch(com.sun.star.container.ElementExistException e) {
+ e.printStackTrace(log);
+ result = false;
+ }
+ catch(com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ result = false;
+ }
+ catch(com.sun.star.lang.IllegalAccessException e) {
+ e.printStackTrace(log);
+ result = false;
+ }
+ tRes.tested("insertSettings()", result);
+ }
+
+ /**
+ * Only a short test.
+ * See complex.imageManager.CheckImageManager for a more extensive test of
+ * this implementation.
+ */
+ public void _getImageManager() {
+ Object o = oObj.getImageManager();
+ log.println("###### ImageManager ");
+ XImageManager xImageManager = (XImageManager)UnoRuntime.queryInterface(XImageManager.class, o);
+ tRes.tested("getImageManager()", xImageManager != null);
+ }
+
+
+ /**
+ * get a shortcut manager
+ */
+ public void _getShortCutManager() {
+ Object o = oObj.getShortCutManager();
+ XServiceInfo xSI = (XServiceInfo)UnoRuntime.queryInterface(XServiceInfo.class,o);
+ String[] serviceNames = xSI.getSupportedServiceNames();
+ boolean bSupportedServiceFound = false;
+ for (int i=0; i<serviceNames.length; i++) {
+ log.println("SuppService: " + serviceNames[i]);
+ if (serviceNames[i].equals(sShortCutManagerServiceName)) {
+ bSupportedServiceFound = true;
+ }
+ }
+ tRes.tested("getShortCutManager()", bSupportedServiceFound);
+ }
+
+ public void _getEventsManager() {
+ Object o = oObj.getEventsManager();
+ tRes.tested("getEventsManager()", o == null);
+ }
+
+ /**
+ * Create a menu bar entry for adding to the menu bar of the Office.
+ * @param sLabelName The name of the new entry.
+ * @param xMenuBarSettings The existing menu bar settings, used for creating the new entry.
+ * @return An array of properties of the new entry.
+ */
+ public static PropertyValue[] createMenuBarEntry(String sLabelName, XIndexAccess xMenuBarSettings, XMultiServiceFactory xMSF, PrintWriter log) {
+ PropertyValue[] prop = new PropertyValue[4];
+ prop[0] = new PropertyValue();
+ prop[0].Name = "CommandURL";
+ prop[0].Value = "vnd.openoffice.org:MyMenu";
+ prop[1] = new PropertyValue();
+ prop[1].Name = "Label";
+ prop[1].Value = sLabelName;
+ prop[2] = new PropertyValue();
+ prop[2].Name = "Type";
+ prop[2].Value = new Short((short)0);
+ prop[3] = new PropertyValue();
+ prop[3].Name = "ItemDescriptorContainer";
+
+ XSingleComponentFactory xFactory = (XSingleComponentFactory)UnoRuntime.queryInterface(
+ XSingleComponentFactory.class, xMenuBarSettings);
+ try {
+ XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, xMSF);
+ XComponentContext xContext = (XComponentContext)UnoRuntime.queryInterface(
+ XComponentContext.class, xProp.getPropertyValue("DefaultContext"));
+ prop[3].Value = xFactory.createInstanceWithContext(xContext);
+ }
+ catch(com.sun.star.uno.Exception e) {
+ log.println("Could not create an instance for ItemDescriptorContainer property.");
+ e.printStackTrace(log);
+ return null;
+ }
+ return prop;
+ }
+
+ /**
+ * Create a sub entry to the menu bar.
+ * @param sLabelName The name of the entry in the UI.
+ * @param xDescriptionContainer The parent entry in the menu bar where
+ * this entry is added.
+ */
+ public static void createMenuBarItem(String sLabelName, XIndexContainer xDescriptionContainer, PrintWriter log) {
+ PropertyValue[]aMenuItem = new PropertyValue[3];
+ // create a menu item
+ aMenuItem[0] = new PropertyValue();
+ aMenuItem[0].Name = "CommandURL";
+ aMenuItem[0].Value = "macro:///Standard.Module1.Test()";
+ aMenuItem[1] = new PropertyValue();
+ aMenuItem[1].Name = "Label";
+ aMenuItem[1].Value = sLabelName;
+ aMenuItem[2] = new PropertyValue();
+ aMenuItem[2].Name = "Type";
+ aMenuItem[2].Value = new Short((short)0);
+
+ try {
+ xDescriptionContainer.insertByIndex(0, aMenuItem);
+ }
+ catch(com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ }
+ catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ }
+ catch(com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/ifc/ui/_XUIConfigurationPersistence.java b/qadevOOo/tests/java/ifc/ui/_XUIConfigurationPersistence.java
new file mode 100755
index 000000000000..96067661bb26
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/ui/_XUIConfigurationPersistence.java
@@ -0,0 +1,83 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package ifc.ui;
+
+import com.sun.star.embed.XStorage;
+import com.sun.star.ui.XUIConfigurationPersistence;
+import lib.MultiMethodTest;
+
+public class _XUIConfigurationPersistence extends MultiMethodTest {
+
+ public XUIConfigurationPersistence oObj;
+ private XStorage xStore = null;
+
+ public void before() {
+ xStore = (XStorage)tEnv.getObjRelation("XUIConfigurationStorage.Storage");
+ }
+
+ public void _reload() {
+ try {
+ oObj.reload();
+ }
+ catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ }
+ tRes.tested("reload()", true);
+ }
+
+ public void _store() {
+ try {
+ oObj.store();
+ }
+ catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ }
+ tRes.tested("store()", true);
+ }
+
+ public void _storeToStorage() {
+ boolean result = true;
+ try {
+ oObj.storeToStorage(xStore);
+ }
+ catch(com.sun.star.uno.Exception e) {
+ result = false;
+ e.printStackTrace(log);
+ }
+ tRes.tested("storeToStorage()", result);
+ }
+
+ public void _isModified() {
+ tRes.tested("isModified()", !oObj.isModified());
+ }
+
+ public void _isReadOnly() {
+ tRes.tested("isReadOnly()", !oObj.isReadOnly());
+ }
+
+}
diff --git a/qadevOOo/tests/java/ifc/ui/_XUIConfigurationStorage.java b/qadevOOo/tests/java/ifc/ui/_XUIConfigurationStorage.java
new file mode 100755
index 000000000000..8acdde914422
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/ui/_XUIConfigurationStorage.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.ui;
+
+import com.sun.star.embed.XStorage;
+import com.sun.star.ui.XUIConfigurationStorage;
+import lib.MultiMethodTest;
+/**
+* Testing <code>com.sun.star.ui.XUIConfigurationStorage</code>
+* interface methods :
+* <ul>
+* <li><code> setStorage()</code></li>
+* <li><code> hasStorage()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.ui.XUIConfigurationStorage
+*/
+
+public class _XUIConfigurationStorage extends MultiMethodTest {
+
+ public XUIConfigurationStorage oObj;
+ private XStorage xStore = null;
+
+ public void before() {
+ xStore = (XStorage)tEnv.getObjRelation("XUIConfigurationStorage.Storage");
+ }
+
+ /**
+ * Set the object relation <code>XUIConfigurationStorage.Storage</code>
+ * as storage.
+ * Has <b>OK</b> status if no exception is thrown.
+ */
+ public void _setStorage() {
+ if (!oObj.hasStorage())
+ oObj.setStorage(xStore);
+ else
+ log.println("For initializing this object, the setStorage() method was already called at the object.");
+ tRes.tested("setStorage()", true);
+ }
+
+ /**
+ * Queries object for a storage.
+ * Has <b>OK</b> status if <code>hasStorage</code> returns <code>OK</code>
+ */
+ public void _hasStorage() {
+ requiredMethod("setStorage()");
+ boolean has = oObj.hasStorage();
+ tRes.tested("hasStorage()", has);
+ }
+
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/ifc/ui/_XUIElementFactory.java b/qadevOOo/tests/java/ifc/ui/_XUIElementFactory.java
new file mode 100755
index 000000000000..5e590054e1f4
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/ui/_XUIElementFactory.java
@@ -0,0 +1,56 @@
+/*************************************************************************
+ *
+ * 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;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.ui.XUIElement;
+import com.sun.star.ui.XUIElementFactory;
+import lib.MultiMethodTest;
+
+public class _XUIElementFactory extends MultiMethodTest {
+
+ public XUIElementFactory oObj;
+
+ public void _createUIElement() {
+ boolean result = true;
+ PropertyValue[] prop = new PropertyValue[0];
+ try {
+ XUIElement element = oObj.createUIElement("private:resource/menubar/menubar", prop);
+ result = (element!= null);
+ }
+ catch(com.sun.star.container.NoSuchElementException e) {
+ result = false;
+ e.printStackTrace(log);
+ }
+ catch(com.sun.star.lang.IllegalArgumentException e) {
+ result = false;
+ e.printStackTrace(log);
+ }
+ tRes.tested("createUIElement()", result);
+ }
+}
diff --git a/qadevOOo/tests/java/ifc/ui/_XUIElementFactoryRegistration.java b/qadevOOo/tests/java/ifc/ui/_XUIElementFactoryRegistration.java
new file mode 100755
index 000000000000..089b42aef0c1
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/ui/_XUIElementFactoryRegistration.java
@@ -0,0 +1,83 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package ifc.ui;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.ui.XUIElementFactory;
+import com.sun.star.ui.XUIElementFactoryRegistration;
+import lib.MultiMethodTest;
+
+public class _XUIElementFactoryRegistration extends MultiMethodTest {
+
+ public XUIElementFactoryRegistration oObj;
+
+ public void _registerFactory() {
+ boolean result = true;
+ try {
+ oObj.registerFactory("private:resource/menubar/menubar", "MyOwnMenubar", "", "com.sun.star.comp.framework.MenuBarFactory");
+ }
+ catch(com.sun.star.container.ElementExistException e) {
+ result = false;
+ e.printStackTrace(log);
+ }
+ tRes.tested("registerFactory()", result);
+ }
+
+ public void _getRegisteredFactories() {
+ requiredMethod("registerFactory()");
+ PropertyValue[][]props = oObj.getRegisteredFactories();
+ if (props == null) {
+ log.println("Null was returned as PropertyValue[][]");
+ props = new PropertyValue[0][0];
+ }
+ for(int i=0; i<props.length; i++)
+ for(int j=0; j<props[i].length; j++)
+ log.println("Factory: " + props[i][j].Name + " - " + props[i][j].Value);
+ tRes.tested("getRegisteredFactories()", props.length != 0);
+ }
+
+ public void _getFactory() {
+ requiredMethod("registerFactory()");
+ XUIElementFactory xFactory = oObj.getFactory("private:resource/menubar/menubar", "");
+ tRes.tested("getFactory()", xFactory != null);
+ }
+
+ public void _deregisterFactory() {
+ executeMethod("getRegisteredFactory()");
+ executeMethod("getFactory()");
+ boolean result = true;
+ try {
+ oObj.deregisterFactory("private:resource/menubar/menubar", "MyOwnMenubar", "");
+ }
+ catch(com.sun.star.container.NoSuchElementException e) {
+ result = false;
+ e.printStackTrace(log);
+ }
+ tRes.tested("deregisterFactory()", true);
+ }
+}
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) ;
+ }
+
+}
+
+