diff options
Diffstat (limited to 'qadevOOo/tests/java/mod/_fwk')
31 files changed, 0 insertions, 3376 deletions
diff --git a/qadevOOo/tests/java/mod/_fwk/ControlMenuController.java b/qadevOOo/tests/java/mod/_fwk/ControlMenuController.java deleted file mode 100755 index db2a50b0e..000000000 --- a/qadevOOo/tests/java/mod/_fwk/ControlMenuController.java +++ /dev/null @@ -1,110 +0,0 @@ -/************************************************************************* - * - * 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 mod._fwk; - -import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.text.XTextDocument; -import com.sun.star.uno.XInterface; -import java.io.PrintWriter; -import lib.StatusException; -import lib.TestCase; -import lib.TestEnvironment; -import lib.TestParameters; -import util.utils; - - -/** - */ -public class ControlMenuController extends TestCase { - XInterface oObj = null; - XTextDocument xTextDoc; - - /** - * Cleanup: close the created document - * @param tParam The test parameters. - * @param The log writer. - * @return The test environment. - * - protected void cleanup(TestParameters tParam, PrintWriter log) { - log.println(" disposing xTextDoc "); - - try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( - XCloseable.class, xTextDoc); - closer.close(true); - } catch (com.sun.star.util.CloseVetoException e) { - log.println("couldn't close document"); - } catch (com.sun.star.lang.DisposedException e) { - log.println("couldn't close document"); - } - } - - /** - * Create test environment. - */ - protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) { - TestEnvironment tEnv = null; - XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF(); - try { - oObj = (XInterface)xMSF.createInstance("com.sun.star.comp.framework.ControlMenuController"); - } - catch(com.sun.star.uno.Exception e) { - e.printStackTrace(log); - throw new StatusException("Could not create object 'ControlMenuController'", e); - } - - -/* log.println("Creating instance..."); - - xTextDoc = WriterTools.createTextDoc(xMSF); - -/* XText xText = xTextDoc.getText(); - XTextCursor xTextCursor = xText.createTextCursor(); - - for (int i = 0; i < 11; i++) { - xText.insertString(xTextCursor, "A sample text and why not? ", false); - } - - XModel xModel = (XModel)UnoRuntime.queryInterface(XModel.class, xTextDoc); - - // the supplier is available from the model - XUIConfigurationManagerSupplier xSupplier = - (XUIConfigurationManagerSupplier)UnoRuntime.queryInterface( - XUIConfigurationManagerSupplier.class, xModel); - - xManager = xSupplier.getUIConfigurationManager(); - - // just to make sure, it's the right one. - log.println("TestObject: " + util.utils.getImplName(xManager)); - tEnv = new TestEnvironment(xManager); */ - log.println("TestObject: " + utils.getImplName(oObj)); - tEnv = new TestEnvironment(oObj); - return tEnv; - } - -} diff --git a/qadevOOo/tests/java/mod/_fwk/Desktop.java b/qadevOOo/tests/java/mod/_fwk/Desktop.java deleted file mode 100644 index c0ce8bd1f..000000000 --- a/qadevOOo/tests/java/mod/_fwk/Desktop.java +++ /dev/null @@ -1,137 +0,0 @@ -/************************************************************************* - * - * 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 mod._fwk; - -import java.io.PrintWriter; - -import lib.Status; -import lib.StatusException; -import lib.TestCase; -import lib.TestEnvironment; -import lib.TestParameters; -import util.SOfficeFactory; - -import com.sun.star.frame.XDesktop; -import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.text.XTextDocument; -import com.sun.star.uno.UnoRuntime; -import com.sun.star.uno.XInterface; - -/** -* Test for object which is represented by service -* <code>com.sun.star.frame.Desktop</code>. <p> -* Object implements the following interfaces : -* <ul> -* <li><code>com::sun::star::beans::XPropertySet</code></li> -* <li><code>com::sun::star::frame::XComponentLoader</code></li> -* <li><code>com::sun::star::frame::XDesktop</code></li> -* <li><code>com::sun::star::frame::XDispatchProvider</code></li> -* <li><code>com::sun::star::frame::XFrame</code></li> -* <li><code>com::sun::star::frame::XFramesSupplier</code></li> -* <li><code>com::sun::star::frame::XTasksSupplier</code></li> -* <li><code>com::sun::star::lang::XComponent</code></li> -* <li><code>com::sun::star::task::XStatusIndicatorFactory</code></li> -* </ul><p> -* @see com.sun.star.beans.XPropertySet -* @see com.sun.star.frame.XComponentLoader -* @see com.sun.star.frame.XDesktop -* @see com.sun.star.frame.XDispatchProvider -* @see com.sun.star.frame.XFrame -* @see com.sun.star.frame.XFramesSupplier -* @see com.sun.star.frame.XTasksSupplier -* @see com.sun.star.lang.XComponent -* @see com.sun.star.task.XStatusIndicatorFactory -* @see ifc.beans._XPropertySet -* @see ifc.frame._XComponentLoader -* @see ifc.frame._XDesktop -* @see ifc.frame._XDispatchProvider -* @see ifc.frame._XFrame -* @see ifc.frame._XFramesSupplier -* @see ifc.frame._XTasksSupplier -* @see ifc.lang._XComponent -* @see ifc.task._XStatusIndicatorFactory -*/ -public class Desktop extends TestCase { - - XTextDocument xTextDoc; - - /** - * Disposes the document, if exists, created in - * <code>createTestEnvironment</code> method. - */ - protected void cleanup( TestParameters Param, PrintWriter log) { - - log.println("disposing xTextDoc"); - - if (xTextDoc != null) { - try { - xTextDoc.dispose(); - } catch (com.sun.star.lang.DisposedException de) {} - } - } - - /** - * Creating a Testenvironment for the interfaces to be tested. - * Creates service <code>com.sun.star.frame.Desktop</code>. - */ - protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) { - - // get a soffice factory object - SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF()); - - try { - log.println( "creating a text document" ); - xTextDoc = SOF.createTextDoc(null); - } catch ( com.sun.star.uno.Exception e ) { - // Some exception occures.FAILED - e.printStackTrace( log ); - throw new StatusException( "Couldn't create document", e ); - } - - XInterface oObj = null; - - try { - oObj = (XInterface)((XMultiServiceFactory)Param.getMSF()).createInstance( - "com.sun.star.comp.framework.Desktop"); - } catch(com.sun.star.uno.Exception e) { - e.printStackTrace(log); - throw new StatusException( - Status.failed("Couldn't create instance")); - } - - TestEnvironment tEnv = new TestEnvironment( oObj ); - - tEnv.addObjRelation("XDispatchProvider.URL", ".uno:Open"); - - tEnv.addObjRelation("Desktop",(XDesktop) - UnoRuntime.queryInterface(XDesktop.class,oObj)); - - return tEnv; - } // finish method getTestEnvironment - -} diff --git a/qadevOOo/tests/java/mod/_fwk/DispatchRecorder.java b/qadevOOo/tests/java/mod/_fwk/DispatchRecorder.java deleted file mode 100644 index f552f185c..000000000 --- a/qadevOOo/tests/java/mod/_fwk/DispatchRecorder.java +++ /dev/null @@ -1,174 +0,0 @@ -/************************************************************************* - * - * 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 mod._fwk; - -import com.sun.star.beans.PropertyValue; -import com.sun.star.frame.XModel; -import java.io.PrintWriter; - -import lib.StatusException; -import lib.TestCase; -import lib.TestEnvironment; -import lib.TestParameters; -import util.SOfficeFactory; - -import com.sun.star.beans.XPropertySet; -import com.sun.star.frame.DispatchStatement; -import com.sun.star.frame.XDispatchRecorder; -import com.sun.star.frame.XDispatchRecorderSupplier; -import com.sun.star.frame.XFrame; -import com.sun.star.lang.XComponent; -import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.uno.UnoRuntime; -import com.sun.star.uno.XInterface; -import com.sun.star.uno.AnyConverter; -import com.sun.star.uno.Type; -import com.sun.star.util.URL; -import util.utils; - -/** -* Test for object that implements the following interfaces : -* <ul> -* <li><code>com::sun::star::container::XElementAccess</code></li> -* <li><code>com::sun::star::container::XIndexAccess</code></li> -* <li><code>com::sun::star::container::XIndexReplace</code></li> -* <li><code>com::sun::star::frame::XDispatchRecorder</code></li> -* </ul><p> -* @see com.sun.star.container.XElementAccess -* @see com.sun.star.container.XIndexAccess -* @see com.sun.star.container.XIndexReplace -* @see com.sun.star.frame.XDispatchRecorder -* @see ifc.container._XElementAccess -* @see ifc.container._XIndexAccess -* @see ifc.container._XIndexReplace -* @see ifc.frame._XDispatchRecorder -*/ -public class DispatchRecorder extends TestCase { - XComponent oDoc = null; - - /** - * Creating a Testenvironment for the interfaces to be tested. - * Creates service <code>com.sun.star.frame.Desktop</code>. - */ - public TestEnvironment createTestEnvironment( TestParameters Param, - PrintWriter log ) throws StatusException { - - XInterface oObj = null; - XFrame xFrame = null; - XDispatchRecorder xDR = null; - - try { - SOfficeFactory SOF = SOfficeFactory.getFactory((XMultiServiceFactory)Param.getMSF()); - oDoc = SOF.createTextDoc(null); - try { - Thread.sleep(1000); - } - catch (InterruptedException ex) { - } - - XModel model = (XModel) UnoRuntime.queryInterface(XModel.class, oDoc); - xFrame = model.getCurrentController().getFrame(); - - XPropertySet xFramePS = (XPropertySet) UnoRuntime.queryInterface - (XPropertySet.class, xFrame); - XDispatchRecorderSupplier xDRS = null; - xDRS = (XDispatchRecorderSupplier) AnyConverter.toObject( - new Type(XDispatchRecorderSupplier.class), - xFramePS.getPropertyValue("DispatchRecorderSupplier")); - if (xDRS == null) { - - Object oDRS = ((XMultiServiceFactory)Param.getMSF()).createInstance( - "com.sun.star.comp.framework.DispatchRecorderSupplier"); - xFramePS.setPropertyValue("DispatchRecorderSupplier", oDRS); - xDRS = (XDispatchRecorderSupplier) - UnoRuntime.queryInterface(XDispatchRecorderSupplier.class,oDRS); - } - - xDR = xDRS.getDispatchRecorder(); - if (xDR != null) { - oObj = xDR; - } else { - oObj = (XInterface)((XMultiServiceFactory)Param.getMSF()).createInstance( - "com.sun.star.comp.framework.DispatchRecorder"); - xDR = (XDispatchRecorder) UnoRuntime.queryInterface - (XDispatchRecorder.class, oObj); - xDRS.setDispatchRecorder(xDR); - } - } catch (com.sun.star.uno.Exception e) { - throw new StatusException("Can't create component", e); - } - - - // fill recorder with content. It's needed for XIndexReplace - URL dispURL = utils.parseURL((XMultiServiceFactory) Param.getMSF(), ".uno:InsertDateField"); - PropertyValue prop = new PropertyValue(); - prop.Name = "Text"; - prop.Value = "XDispatchRecorder.recordDispatch()"; - PropertyValue[] dispArgs = new PropertyValue[] {prop}; - xDR.recordDispatch(dispURL, dispArgs); - - - TestEnvironment tEnv = new TestEnvironment( oObj ); - - // INSTANCEn : _XIndexReplace - log.println("adding INSTANCEn as obj relation to environment"); - - int THRCNT = 1; - if (Param.get("THRCNT")!= null) { - THRCNT = Integer.parseInt((String) Param.get("THRCNT")); - } - - URL instanceURL = null; - DispatchStatement instance = new DispatchStatement(); - PropertyValue dispProp = new PropertyValue(); - - for (int n = 1; n < (THRCNT + 1); n++) { - log.println("adding INSTANCE" + n + - " as obj relation to environment"); - instanceURL = utils.parseURL((XMultiServiceFactory) Param.getMSF(), ".uno:InsertText"); - dispProp.Name = "Text"; - dispProp.Value = "Instance " + n; - dispArgs = new PropertyValue[] {dispProp}; - instance.aCommand = instanceURL.Complete; - instance.aArgs = dispArgs; - instance.aTarget = "_top"; - instance.nFlags = com.sun.star.frame.FrameSearchFlag.ALL; - - tEnv.addObjRelation("INSTANCE" + n, instance); - } - - tEnv.addObjRelation("XDispatchRecorder.Frame", xFrame); - log.println("Object created: TRUE"); - return tEnv; - } // finish method getTestEnvironment - - protected void cleanup( TestParameters Param, PrintWriter log) { - util.DesktopTools.closeDoc(oDoc); - } - -} diff --git a/qadevOOo/tests/java/mod/_fwk/DispatchRecorderSupplier.java b/qadevOOo/tests/java/mod/_fwk/DispatchRecorderSupplier.java deleted file mode 100644 index 50323a5b0..000000000 --- a/qadevOOo/tests/java/mod/_fwk/DispatchRecorderSupplier.java +++ /dev/null @@ -1,74 +0,0 @@ -/************************************************************************* - * - * 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 mod._fwk; - -import java.io.PrintWriter; - -import lib.Status; -import lib.StatusException; -import lib.TestCase; -import lib.TestEnvironment; -import lib.TestParameters; - -import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.uno.XInterface; - -/** -* Test for object that implements the following interfaces : -* <ul> -* <li><code>com::sun::star::frame::XDispatchRecorderSupplier</code></li> -* </ul><p> -* @see com.sun.star.frame.XDispatchRecorderSupplier -* @see ifc.frame._XDispatchRecorderSupplier -*/ -public class DispatchRecorderSupplier extends TestCase { - - /** - * Creating a Testenvironment for the interfaces to be tested. - * Creates instance of - * <code>com.sun.star.comp.framework.DispatchRecorderSupplier</code>. - */ - public TestEnvironment createTestEnvironment( TestParameters Param, - PrintWriter log ) throws StatusException { - - XInterface oObj = null; - - try { - oObj = (XInterface)((XMultiServiceFactory)Param.getMSF()).createInstance( - "com.sun.star.comp.framework.DispatchRecorderSupplier"); - } catch(com.sun.star.uno.Exception e) { - e.printStackTrace(log); - throw new StatusException( - Status.failed("Couldn't create instance")); - } - - TestEnvironment tEnv = new TestEnvironment( oObj ); - - return tEnv; - } // finish method getTestEnvironment -} diff --git a/qadevOOo/tests/java/mod/_fwk/DocumentProperties.java b/qadevOOo/tests/java/mod/_fwk/DocumentProperties.java deleted file mode 100644 index 59e760bad..000000000 --- a/qadevOOo/tests/java/mod/_fwk/DocumentProperties.java +++ /dev/null @@ -1,130 +0,0 @@ -/************************************************************************* - * - * 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 mod._fwk; - -import java.io.PrintWriter; - -import lib.StatusException; -import lib.TestCase; -import lib.TestEnvironment; -import lib.TestParameters; -import util.SOfficeFactory; - -import com.sun.star.document.XDocumentInfoSupplier; -import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.text.XTextDocument; -import com.sun.star.uno.UnoRuntime; -import com.sun.star.uno.XInterface; - -/** -* Test for object which is represented by service -* <code>com.sun.star.document.DocumentInfo</code>. <p> -* Object implements the following interfaces : -* <ul> -* <li><code>com::sun::star::beans::XFastPropertySet</code></li> -* <li><code>com::sun::star::beans::XPropertySet</code></li> -* <li><code>com::sun::star::document::XDocumentInfo</code></li> -* <li><code>com::sun::star::document::XStandaloneDocumentInfo</code></li> -* <li><code>com::sun::star::lang::XComponent</code></li> -* </ul><p> -* @see com.sun.star.beans.XFastPropertySet -* @see com.sun.star.beans.XPropertySet -* @see com.sun.star.document.XDocumentInfo -* @see com.sun.star.document.XStandaloneDocumentInfo -* @see com.sun.star.lang.XComponent -* @see ifc.beans._XFastPropertySet -* @see ifc.beans._XPropertySet -* @see ifc.document._XDocumentInfo -* @see ifc.document._XStandaloneDocumentInfo -* @see ifc.lang._XComponent -*/ -public class DocumentProperties extends TestCase { - - XTextDocument xTextDoc; - - /** - * Disposes the document, if exists, created in - * <code>createTestEnvironment</code> method. - */ - protected void cleanup( TestParameters Param, PrintWriter log) { - - log.println("disposing xTextDoc"); - - if (xTextDoc != null) { - xTextDoc.dispose(); - } - } - - /** - * Creates a text document. - * Obtains the property <code>'DocumentInfo'</code> of the created document. - */ - public TestEnvironment createTestEnvironment( TestParameters Param, - PrintWriter log ) throws StatusException { - - XInterface oObj = null; - - log.println( "creating a test environment" ); - - if (xTextDoc != null) xTextDoc.dispose(); - - // get a soffice factory object - SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF()); - - try { - log.println( "creating a text document" ); - xTextDoc = SOF.createTextDoc(null); - } catch ( com.sun.star.uno.Exception e ) { - // Some exception occures.FAILED - e.printStackTrace( log ); - throw new StatusException( "Couldn't create document", e ); - } - - shortWait(); - - XDocumentInfoSupplier xdis = (XDocumentInfoSupplier) - UnoRuntime.queryInterface(XDocumentInfoSupplier.class, xTextDoc); - //oObj = (XInterface)UnoRuntime.queryInterface(XInterface.class, docInfo); - oObj = xdis.getDocumentInfo(); - TestEnvironment tEnv = new TestEnvironment( oObj ); - - return tEnv; - } // finish method getTestEnvironment - - /** - * Sleeps for 0.5 sec. to allow StarOffice to react on <code> - * reset</code> call. - */ - private void shortWait() { - try { - Thread.sleep(500) ; - } catch (InterruptedException e) { - log.println("While waiting :" + e) ; - } - } -} diff --git a/qadevOOo/tests/java/mod/_fwk/FontMenuController.java b/qadevOOo/tests/java/mod/_fwk/FontMenuController.java deleted file mode 100755 index da86e8276..000000000 --- a/qadevOOo/tests/java/mod/_fwk/FontMenuController.java +++ /dev/null @@ -1,60 +0,0 @@ -/************************************************************************* - * - * 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 mod._fwk; - -import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.uno.XInterface; -import java.io.PrintWriter; -import lib.StatusException; -import lib.TestCase; -import lib.TestEnvironment; -import lib.TestParameters; -import util.utils; - -/** - */ -public class FontMenuController extends TestCase { - XInterface oObj = null; - - protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) { - TestEnvironment tEnv = null; - XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF(); - try { - oObj = (XInterface)xMSF.createInstance("com.sun.star.comp.framework.FontMenuController"); - } - catch(com.sun.star.uno.Exception e) { - e.printStackTrace(log); - throw new StatusException("Could not create object 'FontMenuController'", e); - } - - log.println("TestObject: " + utils.getImplName(oObj)); - tEnv = new TestEnvironment(oObj); - return tEnv; - } - -} diff --git a/qadevOOo/tests/java/mod/_fwk/FontSizeMenuController.java b/qadevOOo/tests/java/mod/_fwk/FontSizeMenuController.java deleted file mode 100755 index a27f0d60e..000000000 --- a/qadevOOo/tests/java/mod/_fwk/FontSizeMenuController.java +++ /dev/null @@ -1,60 +0,0 @@ -/************************************************************************* - * - * 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 mod._fwk; - -import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.uno.XInterface; -import java.io.PrintWriter; -import lib.StatusException; -import lib.TestCase; -import lib.TestEnvironment; -import lib.TestParameters; -import util.utils; - -/** - */ -public class FontSizeMenuController extends TestCase { - XInterface oObj = null; - - protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) { - TestEnvironment tEnv = null; - XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF(); - try { - oObj = (XInterface)xMSF.createInstance("com.sun.star.comp.framework.FontSizeMenuController"); - } - catch(com.sun.star.uno.Exception e) { - e.printStackTrace(log); - throw new StatusException("Could not create object 'FontSizeMenuController'", e); - } - - log.println("TestObject: " + utils.getImplName(oObj)); - tEnv = new TestEnvironment(oObj); - return tEnv; - } - -} diff --git a/qadevOOo/tests/java/mod/_fwk/FooterMenuController.java b/qadevOOo/tests/java/mod/_fwk/FooterMenuController.java deleted file mode 100755 index c84a6c1f8..000000000 --- a/qadevOOo/tests/java/mod/_fwk/FooterMenuController.java +++ /dev/null @@ -1,60 +0,0 @@ -/************************************************************************* - * - * 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 mod._fwk; - -import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.uno.XInterface; -import java.io.PrintWriter; -import lib.StatusException; -import lib.TestCase; -import lib.TestEnvironment; -import lib.TestParameters; -import util.utils; - -/** - */ -public class FooterMenuController extends TestCase { - XInterface oObj = null; - - protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) { - TestEnvironment tEnv = null; - XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF(); - try { - oObj = (XInterface)xMSF.createInstance("com.sun.star.comp.framework.FooterMenuController"); - } - catch(com.sun.star.uno.Exception e) { - e.printStackTrace(log); - throw new StatusException("Could not create object 'FooterMenuController'", e); - } - - log.println("TestObject: " + utils.getImplName(oObj)); - tEnv = new TestEnvironment(oObj); - return tEnv; - } - -} diff --git a/qadevOOo/tests/java/mod/_fwk/FormatMenuController.java b/qadevOOo/tests/java/mod/_fwk/FormatMenuController.java deleted file mode 100755 index bce501515..000000000 --- a/qadevOOo/tests/java/mod/_fwk/FormatMenuController.java +++ /dev/null @@ -1,60 +0,0 @@ -/************************************************************************* - * - * 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 mod._fwk; - -import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.uno.XInterface; -import java.io.PrintWriter; -import lib.StatusException; -import lib.TestCase; -import lib.TestEnvironment; -import lib.TestParameters; -import util.utils; - -/** - */ -public class FormatMenuController extends TestCase { - XInterface oObj = null; - - protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) { - TestEnvironment tEnv = null; - XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF(); - try { - oObj = (XInterface)xMSF.createInstance("com.sun.star.comp.framework.FormatMenuController"); - } - catch(com.sun.star.uno.Exception e) { - e.printStackTrace(log); - throw new StatusException("Could not create object 'FormatMenuController'", e); - } - - log.println("TestObject: " + utils.getImplName(oObj)); - tEnv = new TestEnvironment(oObj); - return tEnv; - } - -} diff --git a/qadevOOo/tests/java/mod/_fwk/Frame.java b/qadevOOo/tests/java/mod/_fwk/Frame.java deleted file mode 100644 index 6e9b3d8ad..000000000 --- a/qadevOOo/tests/java/mod/_fwk/Frame.java +++ /dev/null @@ -1,119 +0,0 @@ -/************************************************************************* - * - * 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 mod._fwk; - -import java.io.PrintWriter; - -import lib.StatusException; -import lib.TestCase; -import lib.TestEnvironment; -import lib.TestParameters; -import util.SOfficeFactory; - -import com.sun.star.frame.XFrame; -import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.text.XTextDocument; -import com.sun.star.uno.UnoRuntime; -import com.sun.star.uno.XInterface; -import com.sun.star.util.XCloseable; - -/** -* Test for object that implements the following interfaces : -* <ul> -* <li><code>com::sun::star::frame::XDispatchProvider</code></li> -* <li><code>com::sun::star::frame::XFrame</code></li> -* <li><code>com::sun::star::frame::XFramesSupplier</code></li> -* <li><code>com::sun::star::task::XStatusIndicatorFactory</code></li> -* <li><code>com::sun::star::lang::XComponent</code></li> -* </ul><p> -* @see com.sun.star.frame.XDispatchProvider -* @see com.sun.star.frame.XFrame -* @see com.sun.star.frame.XFramesSupplier -* @see com.sun.star.task.XStatusIndicatorFactory -* @see com.sun.star.lang.XComponent -* @see ifc.frame._XDispatchProvider -* @see ifc.frame._XFrame -* @see ifc.frame._XFramesSupplier -* @see ifc.task._XStatusIndicatorFactory -* @see ifc.lang._XComponent -*/ -public class Frame extends TestCase { - - XTextDocument xTextDoc; - XFrame frame = null; - - - /** - * Creates a text document and obtains a frame of current controller. - */ - public TestEnvironment createTestEnvironment( TestParameters Param, - PrintWriter log ) throws StatusException { - - XInterface oObj = null; - - log.println( "creating a test environment" ); - - // get a soffice factory object - SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF()); - - try { - log.println( "creating a text document" ); - xTextDoc = SOF.createTextDoc(null); - } catch ( com.sun.star.uno.Exception e ) { - // Some exception occures.FAILED - e.printStackTrace( log ); - throw new StatusException( "Couldn't create document", e ); - } - - frame = xTextDoc.getCurrentController().getFrame(); - oObj = (XInterface)UnoRuntime.queryInterface(XInterface.class, frame); - - log.println(util.utils.getImplName(oObj)); - - TestEnvironment tEnv = new TestEnvironment( oObj ); - - tEnv.addObjRelation("XDispatchProvider.URL", - ".uno:SwitchControlDesignMode"); - - return tEnv; - } // finish method getTestEnvironment - - - /** - * Disposes the document created and finally disposes - * the frame containing the document (for case when the frame - * contains no model after some interafce manipulations). - */ - protected void cleanup( TestParameters Param, PrintWriter log) { - try { - XCloseable xTextClose = (XCloseable) UnoRuntime.queryInterface(XCloseable.class, xTextDoc); - xTextClose.close(true); - } catch(Exception e){} - - } -} diff --git a/qadevOOo/tests/java/mod/_fwk/HeaderMenuController.java b/qadevOOo/tests/java/mod/_fwk/HeaderMenuController.java deleted file mode 100755 index d4baffdc4..000000000 --- a/qadevOOo/tests/java/mod/_fwk/HeaderMenuController.java +++ /dev/null @@ -1,60 +0,0 @@ -/************************************************************************* - * - * 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 mod._fwk; - -import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.uno.XInterface; -import java.io.PrintWriter; -import lib.StatusException; -import lib.TestCase; -import lib.TestEnvironment; -import lib.TestParameters; -import util.utils; - -/** - */ -public class HeaderMenuController extends TestCase { - XInterface oObj = null; - - protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) { - TestEnvironment tEnv = null; - XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF(); - try { - oObj = (XInterface)xMSF.createInstance("com.sun.star.comp.framework.HeaderMenuController"); - } - catch(com.sun.star.uno.Exception e) { - e.printStackTrace(log); - throw new StatusException("Could not create object 'HeaderMenuController'", e); - } - - log.println("TestObject: " + utils.getImplName(oObj)); - tEnv = new TestEnvironment(oObj); - return tEnv; - } - -} diff --git a/qadevOOo/tests/java/mod/_fwk/JobExecutor.java b/qadevOOo/tests/java/mod/_fwk/JobExecutor.java deleted file mode 100644 index 2f16d9922..000000000 --- a/qadevOOo/tests/java/mod/_fwk/JobExecutor.java +++ /dev/null @@ -1,317 +0,0 @@ -/************************************************************************* - * - * 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 mod._fwk; - -import java.io.PrintWriter; - -import lib.Status; -import lib.StatusException; -import lib.TestCase; -import lib.TestEnvironment; -import lib.TestParameters; -import util.utils; - -import com.sun.star.beans.NamedValue; -import com.sun.star.beans.PropertyValue; -import com.sun.star.container.XHierarchicalNameAccess; -import com.sun.star.container.XNameAccess; -import com.sun.star.container.XNameContainer; -import com.sun.star.container.XNameReplace; -import com.sun.star.container.XNamed; -import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.lang.XServiceInfo; -import com.sun.star.lang.XSingleServiceFactory; -import com.sun.star.lang.XTypeProvider; -import com.sun.star.task.XJob; -import com.sun.star.uno.Type; -import com.sun.star.uno.UnoRuntime; -import com.sun.star.uno.XInterface; -import com.sun.star.util.XChangesBatch; -import com.sun.star.uno.AnyConverter; - -/** - * Test for object that implements the following interfaces : - * <ul> - * <li><code>com::sun::star::task::XJobExecutor</code></li> - * </ul><p> - * The following files are needed for testcase creation : - * <ul> - * <li> <code>qadevlibs/JobExecutor.jar</code> : - * this is java component <code>test.Job</code> which - * should be registered before or during this testcase - * creation. This component must implement - * <code>com.sun.star.task.XJob</code> interface and count - * <code>execute</code> method calls. It also should - * implement <code>container.XNamed</code> interface and - * <code>getName</code> method must return string with number - * of calls.</li> - * <ul> <p> - * - * Also <b>important prerequicity</b>: if Job and Event is not yet - * added to configuration or <code>test.Job</code> component is - * not yet registered, the SOffice <b>must be destroyed</b> during - * testcase initialization. <p> - * - * @see com.sun.star.task.XJobExecutor - * @see ifc.task._XJobExecutor - */ -public class JobExecutor extends TestCase { - - static Job job = new Job(); - XNamed xNamed = null; - Object oRootCfg = null; - - /** - * For testcase initializing : - * <ol> - * <li> Implementation <code>test.Job</code> must be registered in - * SOffice registry. </li> - * <li> Configuration in package <code>org.OpenOffice.Office.Jobs</code> - * must be updated. <code>TestJob</code> must be registered for - * service <code>test.Job</code> and event for this job named - * <code>TextEvent</code> must be registered. </li> - * </ol>. <p> - * - * First these two conditions are checked. If job and event are not - * registered they are inserted into configuration and commited. - * After what SOffice must be destroyed for proper initialization - * of <code>JobExecutor</code> after startup. <p> - * - * Then if the implementation was not registered before it is - * registered in soffice <code>applicat.rbd</code> file (registering - * the component in currently running Java environment has no effect - * for <code>JobExecutor</code> in some reasons). <p> - * - * Note: SOffice is started again while the next - * <code>(XMultiServiceFactory)SOLink.getMSF()</code> call. - */ - protected void initialize(TestParameters Param, PrintWriter log) { - boolean serviceRegistered = false; - boolean configured = false; - - try { - Object obj = ((XMultiServiceFactory)Param.getMSF()).createInstance("test.Job"); - serviceRegistered = obj != null; - } catch(com.sun.star.uno.Exception e) {} - - log.println("Service test.Job is " - + (serviceRegistered ? "already" : "not yet") + " registered."); - if (! serviceRegistered){ - String message = "You have to register 'test.Job' before office is stared.\n"; - message += "Please run '$OFFICEPATH/program/pkgchk $DOCPTH/qadevlibs/JobExecutor.jar'"; - throw new StatusException(message, new Exception()); - } - - - XNameAccess jobs = null; - XNameAccess events = null; - try { - Object obj = ((XMultiServiceFactory)Param.getMSF()).createInstance - ("com.sun.star.configuration.ConfigurationProvider"); - XMultiServiceFactory xConfigMSF = (XMultiServiceFactory) - UnoRuntime.queryInterface(XMultiServiceFactory.class, obj); - PropertyValue[] args = new PropertyValue[1]; - args[0] = new PropertyValue(); - args[0].Name = "nodepath"; - args[0].Value = "org.openoffice.Office.Jobs"; - oRootCfg = xConfigMSF.createInstanceWithArguments( - "com.sun.star.configuration.ConfigurationUpdateAccess", args); - XHierarchicalNameAccess xHNA = (XHierarchicalNameAccess) - UnoRuntime.queryInterface(XHierarchicalNameAccess.class, oRootCfg); - obj = xHNA.getByHierarchicalName("Jobs"); - jobs = (XNameAccess) UnoRuntime.queryInterface - (XNameAccess.class, obj); - obj = xHNA.getByHierarchicalName("Events"); - events = (XNameAccess) UnoRuntime.queryInterface - (XNameAccess.class, obj); - } catch (Exception e) { - throw new StatusException("Couldn't get configuration", e); - } - - configured = jobs.hasByName("TestJob") && events.hasByName("TestEvent"); - - log.println("Test job and event is " - + (configured ? "already" : "not yet") + " configured."); - - if (!configured) { - try { - log.println("Adding configuration to Jobs ..."); - XSingleServiceFactory jobsFac = (XSingleServiceFactory) - UnoRuntime.queryInterface(XSingleServiceFactory.class, jobs); - Object oNewJob = jobsFac.createInstance(); - XNameReplace xNewJobNR = (XNameReplace) - UnoRuntime.queryInterface(XNameReplace.class, oNewJob); - xNewJobNR.replaceByName("Service", "test.Job"); - XNameContainer xJobsNC = (XNameContainer) - UnoRuntime.queryInterface(XNameContainer.class, jobs); - xJobsNC.insertByName("TestJob", oNewJob); - - log.println("Adding configuration to Events ..."); - XSingleServiceFactory eventsFac = (XSingleServiceFactory) - UnoRuntime.queryInterface(XSingleServiceFactory.class, events); - Object oNewEvent = eventsFac.createInstance(); - - XNameAccess xNewEventNA = (XNameAccess) - UnoRuntime.queryInterface(XNameAccess.class, oNewEvent); - Object oJobList = xNewEventNA.getByName("JobList"); - XSingleServiceFactory jobListFac = (XSingleServiceFactory) - AnyConverter.toObject(new Type(XSingleServiceFactory.class), - oJobList); - XNameContainer jobListNC = (XNameContainer) - AnyConverter.toObject(new Type(XNameContainer.class), - oJobList); - log.println("\tAdding TimeStamps to Events ..."); - Object oNewJobTimeStamps = jobListFac.createInstance(); - - jobListNC.insertByName("TestJob", oNewJobTimeStamps); - - - XNameContainer xEventsNC = (XNameContainer) - UnoRuntime.queryInterface(XNameContainer.class, events); - xEventsNC.insertByName("TestEvent", oNewEvent); - - XChangesBatch xCB = (XChangesBatch) - UnoRuntime.queryInterface(XChangesBatch.class, oRootCfg); - xCB.commitChanges(); - - try { - Thread.sleep(1000); - } catch (InterruptedException ex) {} - - } catch (com.sun.star.uno.Exception e) { - e.printStackTrace(log); - throw new StatusException("Couldn't change config", e); - } - } - - } - - /** - * Creating a Testenvironment for the interfaces to be tested. - * - * Service <code>com.sun.star.comp.framework.JobExecutor</code> - * is created. - */ - protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) { - - XInterface oObj = null; - - Object job = null; - try { - oObj = (XInterface)((XMultiServiceFactory)Param.getMSF()).createInstance( - "com.sun.star.comp.framework.JobExecutor"); - job = (XInterface)((XMultiServiceFactory)Param.getMSF()).createInstance("test.Job"); - } catch(com.sun.star.uno.Exception e) { - e.printStackTrace(log); - throw new StatusException( - Status.failed("Couldn't create instance")); - } - - xNamed = (XNamed) UnoRuntime.queryInterface(XNamed.class, job); - log.println("Count = " + xNamed.getName()); - - TestEnvironment tEnv = new TestEnvironment( oObj ); - - tEnv.addObjRelation("CallCounter", xNamed); - - return tEnv; - } // finish method getTestEnvironment - - protected void cleanup( TestParameters Param, PrintWriter log) { - } -} - -/** - * Currently not used. - */ -class Job implements - XServiceInfo, XSingleServiceFactory { - - private static class Impl implements XServiceInfo, XTypeProvider, XJob, XNamed { - int callCount = 0; - - public byte[] getImplementationId() { - return toString().getBytes(); - } - - public Type[] getTypes() { - Class interfaces[] = getClass().getInterfaces(); - Type types[] = new Type[interfaces.length]; - for(int i = 0; i < interfaces.length; ++ i) - types[i] = new Type(interfaces[i]); - return types; - } - - public Object execute(NamedValue[] param) { - callCount++; - - return null; - } - - public String getName() { - return String.valueOf(callCount); - } - - public void setName(String n) {} - - public boolean supportsService(String name) { - return __serviceName.equals(name); - } - - public String[] getSupportedServiceNames() { - return new String[] {__serviceName}; - } - - public String getImplementationName() { - return getClass().getName(); - } - } - - public static final String __serviceName = "test.Job"; - static Impl impl = new Impl(); - - public Object createInstanceWithArguments(Object[] args) { - return impl; - } - - public Object createInstance() { - return createInstanceWithArguments(null); - } - - public boolean supportsService(String name) { - return __serviceName.equals(name); - } - - public String[] getSupportedServiceNames() { - return new String[] {__serviceName}; - } - - public String getImplementationName() { - return getClass().getName(); - } -} diff --git a/qadevOOo/tests/java/mod/_fwk/JobHandler.java b/qadevOOo/tests/java/mod/_fwk/JobHandler.java deleted file mode 100644 index abfaf198f..000000000 --- a/qadevOOo/tests/java/mod/_fwk/JobHandler.java +++ /dev/null @@ -1,91 +0,0 @@ -/************************************************************************* - * - * 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 mod._fwk; - -import java.io.PrintWriter; - -import lib.Status; -import lib.StatusException; -import lib.TestCase; -import lib.TestEnvironment; -import lib.TestParameters; - -import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.uno.XInterface; - -/** -* Test for object that implements the following interfaces : -* <ul> -* <li><code>com::sun::star::frame::XDispatchProvider</code></li> -* <li><code>com::sun::star::lang::XInitialization</code></li> -* </ul><p> -* @see com.sun.star.frame.XDispatchProvider -* @see com.sun.star.lang.XInitialization -* @see ifc.frame._XDispatchProvider -* @see ifc.lang._XInitialization -*/ -public class JobHandler extends TestCase { - - /** - * Creating a Testenvironment for the interfaces to be tested. - */ - public TestEnvironment createTestEnvironment( TestParameters Param, - PrintWriter log ) throws StatusException { - boolean serviceRegistered = false; - - try { - Object obj = ((XMultiServiceFactory)Param.getMSF()).createInstance("test.Job"); - serviceRegistered = obj != null; - } catch(com.sun.star.uno.Exception e) {} - - log.println("Service test.Job is " - + (serviceRegistered ? "already" : "not yet") + " registered."); - if (! serviceRegistered){ - String message = "You have to register 'test.Job' before office is stared.\n"; - message += "Please run '$OFFICEPATH/program/pkgchk $DOCPTH/qadevlibs/JobExecutor.jar'"; - throw new StatusException(message, new Exception()); - } - - XInterface oObj = null; - - try { - oObj = (XInterface)((XMultiServiceFactory)Param.getMSF()).createInstance( - "com.sun.star.comp.framework.jobs.JobDispatch"); - } catch(com.sun.star.uno.Exception e) { - e.printStackTrace(log); - throw new StatusException( - Status.failed("Couldn't create instance")); - } - - TestEnvironment tEnv = new TestEnvironment( oObj ); - - tEnv.addObjRelation("XDispatchProvider.URL", "vnd.sun.star.job:alias=TestJob"); - return tEnv; - } // finish method getTestEnvironment - -} diff --git a/qadevOOo/tests/java/mod/_fwk/LayoutManager.java b/qadevOOo/tests/java/mod/_fwk/LayoutManager.java deleted file mode 100755 index 6ba1b97fc..000000000 --- a/qadevOOo/tests/java/mod/_fwk/LayoutManager.java +++ /dev/null @@ -1,124 +0,0 @@ -/************************************************************************* - * - * 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 mod._fwk; - -import com.sun.star.beans.XPropertySet; -import com.sun.star.frame.XFrame; -import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.uno.UnoRuntime; -import com.sun.star.uno.XInterface; -import java.io.PrintWriter; -import com.sun.star.text.XText; -import com.sun.star.text.XTextCursor; -import com.sun.star.text.XTextDocument; -import com.sun.star.util.XCloseable; -import lib.StatusException; -import lib.TestCase; -import lib.TestEnvironment; -import lib.TestParameters; -import util.WriterTools; - -/** - */ -public class LayoutManager extends TestCase { - XInterface xManager = null; - XTextDocument xTextDoc; - - /** - * Cleanup: close the created document - * @param tParam The test parameters. - * @param The log writer. - * @return The test environment. - */ - protected void cleanup(TestParameters tParam, PrintWriter log) { - log.println(" disposing xTextDoc "); - - try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( - XCloseable.class, xTextDoc); - closer.close(true); - } catch (com.sun.star.util.CloseVetoException e) { - log.println("couldn't close document"); - } catch (com.sun.star.lang.DisposedException e) { - log.println("couldn't close document"); - } - } - - /** - * Create test environment: - * <ul> - * <li>Create test doc</li> - * <li>Get the frame</li> - * <li>Get the LayoutManager from the frame</li> - * </ul> - * @param tParam The test parameters. - * @param The log writer. - * @return The test environment. - */ - protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) { - TestEnvironment tEnv = null; - XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF(); - - log.println("Creating instance..."); - - xTextDoc = WriterTools.createTextDoc(xMSF); - - XText xText = xTextDoc.getText(); - XTextCursor xTextCursor = xText.createTextCursor(); - - for (int i = 0; i < 11; i++) { - xText.insertString(xTextCursor, "A sample text and why not? ", false); - } - - XFrame xFrame = xTextDoc.getCurrentController().getFrame(); - XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, xFrame); - try { - Object any = xProp.getPropertyValue("LayoutManager"); - xManager = (XInterface)UnoRuntime.queryInterface(XInterface.class, any); - } - catch(com.sun.star.beans.UnknownPropertyException e) { - e.printStackTrace(log); - throw new StatusException("Could not get property 'LayoutManager' from the current frame.", e); - } - catch(com.sun.star.lang.WrappedTargetException e) { - e.printStackTrace(log); - throw new StatusException("Could not get property 'LayoutManager' from the current frame.", e); - } - - // just to make sure, it's the right one. - log.println("TestObject: " + util.utils.getImplName(xManager)); - tEnv = new TestEnvironment(xManager); - - tEnv.addObjRelation("XLayoutManager.TextDoc", xTextDoc); - tEnv.addObjRelation("XLayoutManager.Frame",xFrame); - - return tEnv; - } -} - - diff --git a/qadevOOo/tests/java/mod/_fwk/MacrosMenuController.java b/qadevOOo/tests/java/mod/_fwk/MacrosMenuController.java deleted file mode 100755 index 22f3fcb26..000000000 --- a/qadevOOo/tests/java/mod/_fwk/MacrosMenuController.java +++ /dev/null @@ -1,60 +0,0 @@ -/************************************************************************* - * - * 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 mod._fwk; - -import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.uno.XInterface; -import java.io.PrintWriter; -import lib.StatusException; -import lib.TestCase; -import lib.TestEnvironment; -import lib.TestParameters; -import util.utils; - -/** - * - */ -public class MacrosMenuController extends TestCase{ - XInterface oObj = null; - - protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) { - TestEnvironment tEnv = null; - XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF(); - try { - oObj = (XInterface)xMSF.createInstance("com.sun.star.comp.framework.MacrosMenuController"); - } - catch(com.sun.star.uno.Exception e) { - e.printStackTrace(log); - throw new StatusException("Could not create object 'MacrosMenuController'", e); - } - - log.println("TestObject: " + utils.getImplName(oObj)); - tEnv = new TestEnvironment(oObj); - return tEnv; - } - -} diff --git a/qadevOOo/tests/java/mod/_fwk/MailToDispatcher.java b/qadevOOo/tests/java/mod/_fwk/MailToDispatcher.java deleted file mode 100644 index fc5e84c05..000000000 --- a/qadevOOo/tests/java/mod/_fwk/MailToDispatcher.java +++ /dev/null @@ -1,80 +0,0 @@ -/************************************************************************* - * - * 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 mod._fwk; - -import java.io.PrintWriter; - -import lib.Status; -import lib.StatusException; -import lib.TestCase; -import lib.TestEnvironment; -import lib.TestParameters; - -import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.uno.XInterface; - -/** -* Test for object that implements the following interfaces : -* <ul> -* <li><code>com::sun::star::lang::XInitialization</code></li> -* <li><code>com::sun::star::frame::XDispatchProvider</code></li> -* </ul><p> -* @see com.sun.star.lang.XInitialization -* @see com.sun.star.frame.XDispatchProvider -* @see ifc.lang._XInitialization -* @see ifc.frame._XDispatchProvider -*/ -public class MailToDispatcher extends TestCase { - - /** - * Creating a Testenvironment for the interfaces to be tested. - * Creates service <code>com.sun.star.framework.MailToDispatcher</code>. - */ - public TestEnvironment createTestEnvironment( TestParameters Param, - PrintWriter log ) throws StatusException { - - XInterface oObj = null; - - try { - oObj = (XInterface)((XMultiServiceFactory)Param.getMSF()).createInstance( - "com.sun.star.comp.framework.MailToDispatcher"); - } catch(com.sun.star.uno.Exception e) { - e.printStackTrace(log); - throw new StatusException( - Status.failed("Couldn't create instance")); - } - - TestEnvironment tEnv = new TestEnvironment( oObj ); - - tEnv.addObjRelation("XDispatchProvider.URL", - "mailto:soffice@sparc.spb.su"); - - return tEnv; - } // finish method getTestEnvironment - -} diff --git a/qadevOOo/tests/java/mod/_fwk/MenuBarFactory.java b/qadevOOo/tests/java/mod/_fwk/MenuBarFactory.java deleted file mode 100755 index d8ca9a58a..000000000 --- a/qadevOOo/tests/java/mod/_fwk/MenuBarFactory.java +++ /dev/null @@ -1,58 +0,0 @@ -/************************************************************************* - * - * 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 mod._fwk; - -import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.uno.XInterface; -import java.io.PrintWriter; -import lib.StatusException; -import lib.TestCase; -import lib.TestEnvironment; -import lib.TestParameters; - -/** - */ -public class MenuBarFactory extends TestCase { - XInterface oObj = null; - - protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) { - TestEnvironment tEnv = null; - try { - XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF(); - oObj = (XInterface)xMSF.createInstance("com.sun.star.comp.framework.MenuBarFactory"); - - tEnv = new TestEnvironment(oObj); - } - catch(com.sun.star.uno.Exception e) { - throw new StatusException("Cannot create test object 'MenuBarFactory'", e); - } - return tEnv; - } -} - - diff --git a/qadevOOo/tests/java/mod/_fwk/ModuleManager.java b/qadevOOo/tests/java/mod/_fwk/ModuleManager.java deleted file mode 100755 index 026faf8c1..000000000 --- a/qadevOOo/tests/java/mod/_fwk/ModuleManager.java +++ /dev/null @@ -1,281 +0,0 @@ -/************************************************************************* - * - * 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 mod._fwk; - -import com.sun.star.beans.PropertyValue; -import com.sun.star.frame.XController; -import com.sun.star.frame.XFrame; -import com.sun.star.frame.XModel; -import com.sun.star.lang.XComponent; -import com.sun.star.lang.XMultiServiceFactory; -import lib.*; -import util.DesktopTools; -import util.SOfficeFactory; - - -import com.sun.star.uno.Exception; -import com.sun.star.uno.UnoRuntime; -import com.sun.star.uno.XInterface; -import java.io.PrintWriter; -import com.sun.star.sheet.XSpreadsheetDocument; -import com.sun.star.text.XTextDocument; - -/** Test for object that implements the following interfaces : - * <ul> - * <li><code>com::sun::star::frame::XModuleManager</code></li> - * <li><code>com::sun::star::container::XNameAccess</code></li> - * <li><code>com::sun::star::container::XElementAccess</code></li> - * </ul><p> - * @see com.sun.star.frame.XModuleManager - * @see com.sun.star.container.XNameAccess - * @see com.sun.star.container.XElementAccess - * @see ifc.frame._XModuleManager - * @see ifc.container._XNameAccess - * @see ifc.container._XElementAccess - */ -public class ModuleManager extends TestCase { - - XTextDocument xTextDoc = null; - XComponent xWebDoc = null; - XComponent xGlobalDoc = null; - XSpreadsheetDocument xSheetDoc = null; - XComponent xDrawDoc = null; - XComponent xImpressDoc = null; - XComponent xMathDoc = null; - - /** Creating a Testenvironment for the interfaces to be tested. - * @param Param test parameters - * @param log simple logger - * @throws StatusException was thrwon on error - * @return the test environement - */ - public TestEnvironment createTestEnvironment( TestParameters Param, - PrintWriter log ) throws StatusException { - - XInterface oObj = null; - - try { - oObj = (XInterface)((XMultiServiceFactory)Param.getMSF()).createInstance( - "com.sun.star.comp.framework.ModuleManager"); - } catch(Exception e) { - e.printStackTrace(log); - throw new StatusException( - Status.failed("Couldn't create instance")); - } - // get a soffice factory object - SOfficeFactory SOF = SOfficeFactory.getFactory( - (XMultiServiceFactory) Param.getMSF()); - - // get text document interfaces - try { - log.println("creating a text document"); - xTextDoc = SOF.createTextDoc(null); - - } catch (Exception e) { - e.printStackTrace(log); - throw new StatusException("Couldn't create document ", e); - } - XModel xTextMode1 = (XModel) UnoRuntime.queryInterface(XModel.class, - xTextDoc); - XController xTextController = xTextMode1.getCurrentController(); - XFrame xTextFrame = xTextController.getFrame(); - - - // get webdoc interfaces - try { - log.println("creating a web document"); - xWebDoc = SOF.loadDocument("private:factory/swriter/web"); - - } catch (Exception e) { - e.printStackTrace(log); - throw new StatusException("Couldn't create document ", e); - } - XModel xWebMode1 = (XModel) UnoRuntime.queryInterface(XModel.class, - xWebDoc); - XController xWebController = xWebMode1.getCurrentController(); - XFrame xWebFrame = xWebController.getFrame(); - - // get global document interfaces - try { - log.println("creating a global document"); - xGlobalDoc = SOF.loadDocument("private:factory/swriter/GlobalDocument"); - - } catch (Exception e) { - e.printStackTrace(log); - throw new StatusException("Couldn't create document ", e); - } - XModel xGlobalMode1 = (XModel) UnoRuntime.queryInterface(XModel.class, - xGlobalDoc); - XController xGlobalController = xGlobalMode1.getCurrentController(); - XFrame xGlobalFrame = xGlobalController.getFrame(); - - // get clac interfaces - try { - log.println("creating a spreadsheetdocument"); - xSheetDoc = SOF.createCalcDoc(null); - } catch (Exception e) { - e.printStackTrace(log); - throw new StatusException("Couldn't create document ", e); - } - XModel xSheetMode1 = (XModel) UnoRuntime.queryInterface(XModel.class, - xSheetDoc); - - XController xSheetController = xSheetMode1.getCurrentController(); - XFrame xSheetFrame = xSheetController.getFrame(); - // get draw interfaces - try { - log.println("creating a draw document"); - xDrawDoc = SOF.createDrawDoc(null); - } catch (Exception e) { - e.printStackTrace(log); - throw new StatusException("Couldn't create document ", e); - } - XModel xDrawMode1 = (XModel) UnoRuntime.queryInterface(XModel.class, - xDrawDoc); - XController xDrawController = xDrawMode1.getCurrentController(); - XFrame xDrawFrame = xDrawController.getFrame(); - - // get impress interfaces - try { - log.println("creating a impress document"); - xImpressDoc = SOF.createImpressDoc(null); - } catch (Exception e) { - e.printStackTrace(log); - throw new StatusException("Couldn't create document ", e); - } - XModel xImpressMode1 = (XModel) UnoRuntime.queryInterface(XModel.class, - xImpressDoc); - XController xImpressController = xImpressMode1.getCurrentController(); - XFrame xImpressFrame = xImpressController.getFrame(); - - // get math interfaces - try { - log.println("creating a math document"); - xMathDoc = SOF.createMathDoc(null); - } catch (Exception e) { - e.printStackTrace(log); - throw new StatusException("Couldn't create document ", e); - } - XModel xMathMode1 = (XModel) UnoRuntime.queryInterface(XModel.class, - xMathDoc); - XController xMathController = xMathMode1.getCurrentController(); - XFrame xMathFrame = xMathController.getFrame(); - - PropertyValue[] xFrameSeq = new PropertyValue[7]; - xFrameSeq[0] = new PropertyValue(); - xFrameSeq[0].Name = "com.sun.star.text.TextDocument"; - xFrameSeq[0].Value = xTextFrame; - xFrameSeq[1] = new PropertyValue(); - xFrameSeq[1].Name = "com.sun.star.text.WebDocument"; - xFrameSeq[1].Value = xWebFrame; - xFrameSeq[2] = new PropertyValue(); - xFrameSeq[2].Name = "com.sun.star.text.GlobalDocument"; - xFrameSeq[2].Value = xGlobalFrame; - xFrameSeq[3] = new PropertyValue(); - xFrameSeq[3].Name = "com.sun.star.sheet.SpreadsheetDocument"; - xFrameSeq[3].Value = xSheetFrame; - xFrameSeq[4] = new PropertyValue(); - xFrameSeq[4].Name = "com.sun.star.drawing.DrawingDocument"; - xFrameSeq[4].Value = xDrawFrame; - xFrameSeq[5] = new PropertyValue(); - xFrameSeq[5].Name = "com.sun.star.formula.FormulaProperties"; - xFrameSeq[5].Value = xMathFrame; - xFrameSeq[6] = new PropertyValue(); - xFrameSeq[6].Name = "com.sun.star.presentation.PresentationDocument"; - xFrameSeq[6].Value = xImpressFrame; - - PropertyValue[] xControllerSeq = new PropertyValue[7]; - xControllerSeq[0] = new PropertyValue(); - xControllerSeq[0].Name = "com.sun.star.text.TextDocument"; - xControllerSeq[0].Value = xTextController; - xControllerSeq[1] = new PropertyValue(); - xControllerSeq[1].Name = "com.sun.star.text.WebDocument"; - xControllerSeq[1].Value = xWebController; - xControllerSeq[2] = new PropertyValue(); - xControllerSeq[2].Name = "com.sun.star.text.GlobalDocument"; - xControllerSeq[2].Value = xGlobalController; - xControllerSeq[3] = new PropertyValue(); - xControllerSeq[3].Name = "com.sun.star.sheet.SpreadsheetDocument"; - xControllerSeq[3].Value = xSheetController; - xControllerSeq[4] = new PropertyValue(); - xControllerSeq[4].Name = "com.sun.star.drawing.DrawingDocument"; - xControllerSeq[4].Value = xDrawController; - xControllerSeq[5] = new PropertyValue(); - xControllerSeq[5].Name = "com.sun.star.formula.FormulaProperties"; - xControllerSeq[5].Value = xMathController; - xControllerSeq[6] = new PropertyValue(); - xControllerSeq[6].Name = "com.sun.star.presentation.PresentationDocument"; - xControllerSeq[6].Value = xImpressController; - - PropertyValue[] xModelSeq = new PropertyValue[7]; - xModelSeq[0] = new PropertyValue(); - xModelSeq[0].Name = "com.sun.star.text.TextDocument"; - xModelSeq[0].Value = xTextMode1; - xModelSeq[1] = new PropertyValue(); - xModelSeq[1].Name = "com.sun.star.text.WebDocument"; - xModelSeq[1].Value = xWebMode1; - xModelSeq[2] = new PropertyValue(); - xModelSeq[2].Name = "com.sun.star.text.GlobalDocument"; - xModelSeq[2].Value = xGlobalMode1; - xModelSeq[3] = new PropertyValue(); - xModelSeq[3].Name = "com.sun.star.sheet.SpreadsheetDocument"; - xModelSeq[3].Value = xSheetMode1; - xModelSeq[4] = new PropertyValue(); - xModelSeq[4].Name = "com.sun.star.drawing.DrawingDocument"; - xModelSeq[4].Value = xDrawMode1; - xModelSeq[5] = new PropertyValue(); - xModelSeq[5].Name = "com.sun.star.presentation.PresentationDocument"; - xModelSeq[5].Value = xImpressMode1; - xModelSeq[6] = new PropertyValue(); - xModelSeq[6].Name = "com.sun.star.formula.FormulaProperties"; - xModelSeq[6].Value = xMathMode1; - - TestEnvironment tEnv = new TestEnvironment( oObj ); - - - tEnv.addObjRelation("XModuleManager.XFrame", xFrameSeq); - tEnv.addObjRelation("XModuleManager.XController", xControllerSeq); - tEnv.addObjRelation("XModuleManager.XModel", xModelSeq); - return tEnv; - } // finish method getTestEnvironment - - /** Disposes text document. - * @param tParam test parameters - * @param log simple logger - */ - protected void cleanup( TestParameters tParam, PrintWriter log ) { - log.println( " closing all documents " ); - DesktopTools.closeDoc(xTextDoc); - DesktopTools.closeDoc(xWebDoc); - DesktopTools.closeDoc(xGlobalDoc); - DesktopTools.closeDoc(xSheetDoc); - DesktopTools.closeDoc(xDrawDoc); - DesktopTools.closeDoc(xImpressDoc); - DesktopTools.closeDoc(xMathDoc); - } -} diff --git a/qadevOOo/tests/java/mod/_fwk/ModuleUIConfigurationManager.java b/qadevOOo/tests/java/mod/_fwk/ModuleUIConfigurationManager.java deleted file mode 100755 index 4f4f950e0..000000000 --- a/qadevOOo/tests/java/mod/_fwk/ModuleUIConfigurationManager.java +++ /dev/null @@ -1,245 +0,0 @@ -/************************************************************************* - * - * 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 mod._fwk; - -import com.sun.star.beans.PropertyValue; -import com.sun.star.container.XIndexAccess; -import com.sun.star.container.XIndexContainer; -import com.sun.star.container.XNameAccess; -import com.sun.star.embed.ElementModes; -import com.sun.star.embed.XStorage; -import com.sun.star.embed.XTransactedObject; -import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.lang.XSingleServiceFactory; -import com.sun.star.uno.UnoRuntime; -import com.sun.star.uno.XInterface; -import com.sun.star.ui.XModuleUIConfigurationManagerSupplier; -import ifc.ui._XUIConfiguration; -import java.io.PrintWriter; -import com.sun.star.lang.EventObject; -import com.sun.star.text.XTextDocument; -import com.sun.star.util.XCloseable; -import com.sun.star.ui.ConfigurationEvent; -import com.sun.star.ui.XUIConfigurationManager; -import ifc.ui._XUIConfigurationManager; -import lib.StatusException; -import lib.TestCase; -import lib.TestEnvironment; -import lib.TestParameters; -import util.WriterTools; -import util.utils; - -/** - */ -public class ModuleUIConfigurationManager extends TestCase { - XInterface oObj = null; - XMultiServiceFactory xMSF = null; - XTextDocument xTextDoc = null; - XStorage xStore = null; - - /** - * Cleanup: close the created document - * @param tParam The test parameters. - * @param The log writer. - * @return The test environment. - */ - protected void cleanup(TestParameters tParam, PrintWriter log) { - log.println(" disposing xTextDoc "); - if (xTextDoc != null) { - try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( - XCloseable.class, xTextDoc); - closer.close(true); - } catch (com.sun.star.util.CloseVetoException e) { - log.println("couldn't close document"); - } catch (com.sun.star.lang.DisposedException e) { - log.println("couldn't close document"); - } - } - log.println(" disposing storage"); - if (xStore != null) { - xStore.dispose(); - } - } - - /** - * Create environment. - */ - protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) { - TestEnvironment tEnv = null; - - try { - xMSF = (XMultiServiceFactory)tParam.getMSF(); - - log.println("Creating instance..."); - xTextDoc = WriterTools.createTextDoc(xMSF); - - Object o = (XInterface)xMSF.createInstance("com.sun.star.ui.ModuleUIConfigurationManagerSupplier"); - XModuleUIConfigurationManagerSupplier xMUICMS = (XModuleUIConfigurationManagerSupplier) - UnoRuntime.queryInterface(XModuleUIConfigurationManagerSupplier.class, o); - - util.dbg.printInterfaces(xMUICMS); - oObj = xMUICMS.getUIConfigurationManager("com.sun.star.text.TextDocument"); - - log.println("TestObject: " + utils.getImplName(oObj)); - tEnv = new TestEnvironment(oObj); - - XNameAccess xMM = (XNameAccess)UnoRuntime.queryInterface(XNameAccess.class, xMSF.createInstance("com.sun.star.comp.framework.ModuleManager")); - String[] names = xMM.getElementNames(); - - o = xMSF.createInstance("com.sun.star.embed.StorageFactory"); - XSingleServiceFactory xStorageService = (XSingleServiceFactory) - UnoRuntime.queryInterface(XSingleServiceFactory.class, o); - Object[]props = new Object[2]; - - String aFile = util.utils.getOfficeTempDir(xMSF) + "dummyFile.dat"; - log.println("storage file : '"+ aFile + "'"); - - props[0] = aFile; - props[1] = new Integer(ElementModes.READWRITE); - xStore = (XStorage)UnoRuntime.queryInterface(XStorage.class, xStorageService.createInstanceWithArguments(props)); - - PropertyValue[] initProps = new PropertyValue[4]; - PropertyValue propVal = new PropertyValue(); - propVal.Name = "DefaultConfigStorage"; - propVal.Value = xStore; - initProps[0] = propVal; - propVal = new PropertyValue(); - propVal.Name = "UserConfigStorage"; - propVal.Value = xStore; - initProps[1] = propVal; - propVal = new PropertyValue(); - propVal.Name = "ModuleIdentifier"; - propVal.Value = "swriter"; - initProps[2] = propVal; - propVal = new PropertyValue(); - propVal.Name = "UserRootCommit"; - propVal.Value = (XTransactedObject)UnoRuntime.queryInterface(XTransactedObject.class, xStore); - initProps[3] = propVal; - - - tEnv.addObjRelation("XInitialization.args", initProps); - - // the short cut manager service name - // 2do: correct the service name when it's no longer in - tEnv.addObjRelation("XConfigurationManager.ShortCutManager", - "com.sun.star.ui.ModuleAcceleratorConfiguration"); - - // the resourceURL - tEnv.addObjRelation("XModuleUIConfigurationManager.ResourceURL", - "private:resource/menubar/menubar"); - tEnv.addObjRelation("XUIConfiguration.XUIConfigurationListenerImpl", - new ConfigurationListener(log, - (XUIConfigurationManager)UnoRuntime.queryInterface( - XUIConfigurationManager.class, oObj), xMSF)); - tEnv.addObjRelation("XModuleUIConfigurationManagerSupplier.ConfigManagerImplementationName", - "com.sun.star.comp.framework.ModuleUIConfigurationManager"); - } - catch(com.sun.star.uno.Exception e) { - e.printStackTrace(log); - throw new StatusException("Cannot create test object", e); - } - return tEnv; - } - - /** - * An implementation of the _XUIConfiguration.XUIConfigurationListenerImpl - * interface to trigger the event for a listener call. - * @see ifc.ui._XUIConfiguration - */ - public static class ConfigurationListener implements _XUIConfiguration.XUIConfigurationListenerImpl { - private boolean triggered = false; - private PrintWriter log = null; - private XUIConfigurationManager xUIManager = null; - private XMultiServiceFactory xMSF = null; - - public ConfigurationListener(PrintWriter _log, XUIConfigurationManager xUIManager, XMultiServiceFactory xMSF) { - log = _log; - this.xUIManager = xUIManager; - this.xMSF = xMSF; - } - public void reset(){ - triggered = false; - } - public void fireEvent() { - try { - XIndexAccess xMenuBarSettings = xUIManager.getSettings( - "private:resource/menubar/menubar", true); - - PropertyValue[]prop = _XUIConfigurationManager.createMenuBarEntry( - "Trigger Event", xMenuBarSettings, xMSF, log); - _XUIConfigurationManager.createMenuBarItem("Click for Macro", - (XIndexContainer)UnoRuntime.queryInterface( - XIndexContainer.class, prop[3].Value), log); - XIndexContainer x = (XIndexContainer)UnoRuntime.queryInterface(XIndexContainer.class, xMenuBarSettings); - x.insertByIndex(x.getCount(), prop); - xUIManager.replaceSettings("private:resource/menubar/menubar", xMenuBarSettings); - xUIManager.reset(); - } - catch(com.sun.star.container.NoSuchElementException e) { - log.println("_XUIConfiguration.XUIConfigurationListenerImpl: Exception."); - e.printStackTrace(log); - } - catch(com.sun.star.lang.IllegalArgumentException e) { - log.println("_XUIConfiguration.XUIConfigurationListenerImpl: Exception."); - e.printStackTrace(log); - } - catch(com.sun.star.lang.IllegalAccessException e) { - log.println("_XUIConfiguration.XUIConfigurationListenerImpl: Exception."); - e.printStackTrace(log); - } - catch(com.sun.star.lang.IndexOutOfBoundsException e) { - log.println("_XUIConfiguration.XUIConfigurationListenerImpl: Exception."); - e.printStackTrace(log); - } - catch(com.sun.star.lang.WrappedTargetException e) { - log.println("_XUIConfiguration.XUIConfigurationListenerImpl: Exception."); - e.printStackTrace(log); - } - } - public boolean actionWasTriggered(){ - return triggered; - } - public void disposing(EventObject e) { - log.println("_XUIConfiguration.XUIConfigurationListenerImpl.disposing the listener."); - } - public void elementInserted(ConfigurationEvent configEvent) { - triggered = true; - log.println("_XUIConfiguration.XUIConfigurationListenerImpl.elementInserted."); - } - public void elementRemoved(ConfigurationEvent configEvent) { - triggered = true; - log.println("_XUIConfiguration.XUIConfigurationListenerImpl.elementRemoved."); - } - public void elementReplaced(ConfigurationEvent configEvent) { - triggered = true; - log.println("_XUIConfiguration.XUIConfigurationListenerImpl.elementReplaced."); - } - } - -} diff --git a/qadevOOo/tests/java/mod/_fwk/ModuleUIConfigurationManagerSupplier.java b/qadevOOo/tests/java/mod/_fwk/ModuleUIConfigurationManagerSupplier.java deleted file mode 100755 index 9da4e7fa8..000000000 --- a/qadevOOo/tests/java/mod/_fwk/ModuleUIConfigurationManagerSupplier.java +++ /dev/null @@ -1,60 +0,0 @@ -/************************************************************************* - * - * 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 mod._fwk; - -import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.uno.XInterface; -import java.io.PrintWriter; -import lib.StatusException; -import lib.TestCase; -import lib.TestEnvironment; -import lib.TestParameters; - -/** - * - */ -public class ModuleUIConfigurationManagerSupplier extends TestCase{ - XInterface oObj = null; - - protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) { - TestEnvironment tEnv = null; - try { - XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF(); - oObj = (XInterface)xMSF.createInstance("com.sun.star.ui.ModuleUIConfigurationManagerSupplier"); - tEnv = new TestEnvironment(oObj); - tEnv.addObjRelation("XModuleUIConfigurationManagerSupplier.ConfigurationManager", - "com.sun.star.frame.StartModule"); - tEnv.addObjRelation("XModuleUIConfigurationManagerSupplier.ConfigManagerImplementationName", "com.sun.star.comp.framework.ModuleUIConfigurationManager"); - } - catch(com.sun.star.uno.Exception e) { - throw new StatusException("Cannot create test object", e); - } - return tEnv; - } - -} diff --git a/qadevOOo/tests/java/mod/_fwk/ObjectMenuController.java b/qadevOOo/tests/java/mod/_fwk/ObjectMenuController.java deleted file mode 100755 index 2b1da80a8..000000000 --- a/qadevOOo/tests/java/mod/_fwk/ObjectMenuController.java +++ /dev/null @@ -1,97 +0,0 @@ -/************************************************************************* - * - * 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 mod._fwk; - -import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.uno.UnoRuntime; -import com.sun.star.uno.XInterface; -import java.io.PrintWriter; -import com.sun.star.text.XTextDocument; -import com.sun.star.util.XCloseable; -import lib.StatusException; -import lib.TestCase; -import lib.TestEnvironment; -import lib.TestParameters; -import util.utils; - -/** - */ -public class ObjectMenuController extends TestCase { - XInterface oObj = null; - XTextDocument xTextDoc; - - /** - * Cleanup: close the created document - * @param tParam The test parameters. - * @param The log writer. - * @return The test environment. - */ - protected void cleanup(TestParameters tParam, PrintWriter log) { - log.println(" disposing xTextDoc "); - - try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( - XCloseable.class, xTextDoc); - closer.close(true); - } catch (com.sun.star.util.CloseVetoException e) { - log.println("couldn't close document"); - } catch (com.sun.star.lang.DisposedException e) { - log.println("couldn't close document"); - } - } - - /** - * Create test environment: - * <ul> - * <li>create a text doc</li> - * <li>get the model from the text doc</li> - * <li>query model for XUIConfigurationManagerSupplier interface</li> - * <li>get the manager from the supplier</li> - * </ul> - * @param tParam The test parameters. - * @param The log writer. - * @return The test environment. - */ - protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) { - TestEnvironment tEnv = null; - XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF(); - - try { - oObj = (XInterface)xMSF.createInstance("com.sun.star.comp.framework.ObjectMenuController"); - } - catch(com.sun.star.uno.Exception e) { - e.printStackTrace(log); - throw new StatusException("Could not create object 'ControlMenuController'", e); - } - log.println("TestObject: " + utils.getImplName(oObj)); - tEnv = new TestEnvironment(oObj); - return tEnv; - } -} - - diff --git a/qadevOOo/tests/java/mod/_fwk/PopupMenuControllerFactory.java b/qadevOOo/tests/java/mod/_fwk/PopupMenuControllerFactory.java deleted file mode 100755 index 91ac2fbd8..000000000 --- a/qadevOOo/tests/java/mod/_fwk/PopupMenuControllerFactory.java +++ /dev/null @@ -1,124 +0,0 @@ -/************************************************************************* - * - * 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 mod._fwk; - -import com.sun.star.beans.XPropertySet; -import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.uno.UnoRuntime; -import com.sun.star.uno.XInterface; -import java.io.PrintWriter; -import com.sun.star.text.XTextDocument; -import com.sun.star.uno.XComponentContext; -import com.sun.star.util.XCloseable; -import com.sun.star.frame.XUIControllerRegistration; -import lib.StatusException; -import lib.TestCase; -import lib.TestEnvironment; -import lib.TestParameters; -import util.WriterTools; - -/** - */ -public class PopupMenuControllerFactory extends TestCase { - XTextDocument xTextDoc; - - /** - * Cleanup: close the created document - * @param tParam The test parameters. - * @param The log writer. - * @return The test environment. - */ - protected void cleanup(TestParameters tParam, PrintWriter log) { - log.println(" disposing xTextDoc "); - - try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( - XCloseable.class, xTextDoc); - closer.close(true); - } catch (com.sun.star.util.CloseVetoException e) { - log.println("couldn't close document"); - } catch (com.sun.star.lang.DisposedException e) { - log.println("couldn't close document"); - } - } - - - /** - * Create test environment: - * @param tParam The test parameters. - * @param The log writer. - * @return The test environment. - */ - protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) { - TestEnvironment tEnv = null; - XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF(); - XInterface xInst = null; - - log.println("Creating instance..."); - - xTextDoc = WriterTools.createTextDoc(xMSF); - util.dbg.printInterfaces(xTextDoc); - - try { - xInst = (XInterface)xMSF.createInstance( - "com.sun.star.comp.framework.PopupMenuControllerFactory"); - } - catch(com.sun.star.uno.Exception e) { - throw new StatusException("Couldn't create test object", e); - } - - log.println("TestObject: " + util.utils.getImplName(xInst)); - tEnv = new TestEnvironment(xInst); - XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, xMSF); - try { - Object o = xProp.getPropertyValue("DefaultContext"); - XComponentContext xContext = (XComponentContext)UnoRuntime.queryInterface(XComponentContext.class, o); - tEnv.addObjRelation("DC", xContext); - } - catch(com.sun.star.beans.UnknownPropertyException e) { - log.println("Cannot get the 'DefaultContext' for XMultiComponentFactory test."); - e.printStackTrace(log); - } - catch(com.sun.star.lang.WrappedTargetException e) { - log.println("Cannot get the 'DefaultContext' for XMultiComponentFactory test."); - e.printStackTrace(log); - } - - // register one controller, so it can be instantiated - XUIControllerRegistration xReg = (XUIControllerRegistration) - UnoRuntime.queryInterface(XUIControllerRegistration.class, xInst); - - xReg.registerController(".uno:MyCommandUrl", "", "com.sun.star.comp.framework.FooterMenuController"); - tEnv.addObjRelation("XUIControllerRegistration.RegisteredController", ".uno:MyCommandUrl"); - tEnv.addObjRelation("XMultiComponentFactory.ServiceNames", new String[]{".uno:MyCommandUrl"}); - - return tEnv; - } -} - - diff --git a/qadevOOo/tests/java/mod/_fwk/ServiceHandler.java b/qadevOOo/tests/java/mod/_fwk/ServiceHandler.java deleted file mode 100644 index 9caa75de4..000000000 --- a/qadevOOo/tests/java/mod/_fwk/ServiceHandler.java +++ /dev/null @@ -1,80 +0,0 @@ -/************************************************************************* - * - * 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 mod._fwk; - -import java.io.PrintWriter; - -import lib.Status; -import lib.StatusException; -import lib.TestCase; -import lib.TestEnvironment; -import lib.TestParameters; - -import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.uno.XInterface; - -/** -* Test for object that implements the following interfaces : -* <ul> -* <li><code>com::sun::star::lang::XInitialization</code></li> -* <li><code>com::sun::star::frame::XDispatchProvider</code></li> -* </ul><p> -* @see com.sun.star.lang.XInitialization -* @see com.sun.star.frame.XDispatchProvider -* @see ifc.lang._XInitialization -* @see ifc.frame._XDispatchProvider -*/ -public class ServiceHandler extends TestCase { - - /** - * Creating a Testenvironment for the interfaces to be tested. - * Creates service <code>com.sun.star.framework.ServiceHandler</code>. - */ - public TestEnvironment createTestEnvironment( TestParameters Param, - PrintWriter log ) throws StatusException { - - XInterface oObj = null; - - try { - oObj = (XInterface)((XMultiServiceFactory)Param.getMSF()).createInstance( - "com.sun.star.comp.framework.ServiceHandler"); - } catch(com.sun.star.uno.Exception e) { - e.printStackTrace(log); - throw new StatusException( - Status.failed("Couldn't create instance")); - } - - TestEnvironment tEnv = new TestEnvironment( oObj ); - - tEnv.addObjRelation("XDispatchProvider.URL", - "service:com.sun.star.io.Pipe"); - - return tEnv; - } // finish method getTestEnvironment - -} diff --git a/qadevOOo/tests/java/mod/_fwk/SoundHandler.java b/qadevOOo/tests/java/mod/_fwk/SoundHandler.java deleted file mode 100644 index d94c3d57a..000000000 --- a/qadevOOo/tests/java/mod/_fwk/SoundHandler.java +++ /dev/null @@ -1,81 +0,0 @@ -/************************************************************************* - * - * 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 mod._fwk; - -import java.io.PrintWriter; - -import lib.Status; -import lib.StatusException; -import lib.TestCase; -import lib.TestEnvironment; -import lib.TestParameters; - -import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.uno.XInterface; -import com.sun.star.util.URL; -import util.utils; -/** -* Test for object that implements the following interfaces : -* <ul> -* <li><code>com::sun::star::frame::XDispatch</code></li> -* <li><code>com::sun::star::frame::XNotifyingDispatch</code></li> -* </ul><p> -* @see com.sun.star.frame.XDispatch -* @see com.sun.star.frame.XNotifyingDispatch -* @see ifc.frame._XDispatch -* @see ifc.frame._XNotifyingDispatch -*/ -public class SoundHandler extends TestCase { - - /** - * Creating a Testenvironment for the interfaces to be tested. - */ - public TestEnvironment createTestEnvironment( TestParameters Param, - PrintWriter log ) throws StatusException { - - XInterface oObj = null; - - try { - oObj = (XInterface)((XMultiServiceFactory)Param.getMSF()).createInstance( - "com.sun.star.frame.ContentHandler"); - } catch(com.sun.star.uno.Exception e) { - e.printStackTrace(log); - throw new StatusException( - Status.failed("Couldn't create instance")); - } - - TestEnvironment tEnv = new TestEnvironment( oObj ); - URL dispURL = utils.parseURL((XMultiServiceFactory)Param.getMSF(), - utils.getFullTestURL("ok.wav")); - System.out.println("DISPATCHURL: "+ dispURL.Complete); - - tEnv.addObjRelation("XDispatch.URL", dispURL); - return tEnv; - } // finish method getTestEnvironment - -} diff --git a/qadevOOo/tests/java/mod/_fwk/StatusBarControllerFactory.java b/qadevOOo/tests/java/mod/_fwk/StatusBarControllerFactory.java deleted file mode 100644 index a7d09a818..000000000 --- a/qadevOOo/tests/java/mod/_fwk/StatusBarControllerFactory.java +++ /dev/null @@ -1,74 +0,0 @@ -/************************************************************************* - * - * 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 mod._fwk; -import com.sun.star.beans.XPropertySet; -import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.uno.UnoRuntime; -import com.sun.star.uno.XComponentContext; -import com.sun.star.uno.XInterface; -import java.io.PrintWriter; -import lib.StatusException; -import lib.TestCase; -import lib.TestEnvironment; -import lib.TestParameters; - -/** - */ -public class StatusBarControllerFactory extends TestCase { - XInterface oObj = null; - - protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) { - TestEnvironment tEnv = null; - XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF(); - try { - oObj = (XInterface)xMSF.createInstance("com.sun.star.comp.framework.StatusBarControllerFactory"); - - tEnv = new TestEnvironment(oObj); - } - catch(com.sun.star.uno.Exception e) { - throw new StatusException("Cannot create test object 'StatusBarControllerFactory'", e); - } - XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, xMSF); - try { - Object o = xProp.getPropertyValue("DefaultContext"); - XComponentContext xContext = (XComponentContext)UnoRuntime.queryInterface(XComponentContext.class, o); - tEnv.addObjRelation("DC", xContext); - } - catch(com.sun.star.beans.UnknownPropertyException e) { - log.println("Cannot get the 'DefaultContext' for XMultiComponentFactory test."); - e.printStackTrace(log); - } - catch(com.sun.star.lang.WrappedTargetException e) { - log.println("Cannot get the 'DefaultContext' for XMultiComponentFactory test."); - e.printStackTrace(log); - } - return tEnv; - } -} - - diff --git a/qadevOOo/tests/java/mod/_fwk/ToolBarsMenuController.java b/qadevOOo/tests/java/mod/_fwk/ToolBarsMenuController.java deleted file mode 100644 index a27761f03..000000000 --- a/qadevOOo/tests/java/mod/_fwk/ToolBarsMenuController.java +++ /dev/null @@ -1,60 +0,0 @@ -/************************************************************************* - * - * 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 mod._fwk; - -import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.uno.XInterface; -import java.io.PrintWriter; -import lib.StatusException; -import lib.TestCase; -import lib.TestEnvironment; -import lib.TestParameters; -import util.utils; - -/** - */ -public class ToolBarsMenuController extends TestCase { - XInterface oObj = null; - - protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) { - TestEnvironment tEnv = null; - XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF(); - try { - oObj = (XInterface)xMSF.createInstance("com.sun.star.comp.framework.ToolBarsMenuController"); - } - catch(com.sun.star.uno.Exception e) { - e.printStackTrace(log); - throw new StatusException("Could not create object 'ToolBarsMenuController'", e); - } - - log.println("TestObject: " + utils.getImplName(oObj)); - tEnv = new TestEnvironment(oObj); - return tEnv; - } - -} diff --git a/qadevOOo/tests/java/mod/_fwk/UICategoryDescription.java b/qadevOOo/tests/java/mod/_fwk/UICategoryDescription.java deleted file mode 100644 index 2adf240b8..000000000 --- a/qadevOOo/tests/java/mod/_fwk/UICategoryDescription.java +++ /dev/null @@ -1,60 +0,0 @@ -/************************************************************************* - * - * 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 mod._fwk; - -import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.uno.XInterface; -import java.io.PrintWriter; -import lib.StatusException; -import lib.TestCase; -import lib.TestEnvironment; -import lib.TestParameters; -import util.utils; - -/** - */ -public class UICategoryDescription extends TestCase { - XInterface oObj = null; - - protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) { - TestEnvironment tEnv = null; - XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF(); - try { - oObj = (XInterface)xMSF.createInstance("com.sun.star.comp.framework.UICategoryDescription"); - } - catch(com.sun.star.uno.Exception e) { - e.printStackTrace(log); - throw new StatusException("Could not create object 'UICategoryDescription'", e); - } - - log.println("TestObject: " + utils.getImplName(oObj)); - tEnv = new TestEnvironment(oObj); - return tEnv; - } - -} diff --git a/qadevOOo/tests/java/mod/_fwk/UICommandDescription.java b/qadevOOo/tests/java/mod/_fwk/UICommandDescription.java deleted file mode 100755 index 7b506972e..000000000 --- a/qadevOOo/tests/java/mod/_fwk/UICommandDescription.java +++ /dev/null @@ -1,61 +0,0 @@ -/************************************************************************* - * - * 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 mod._fwk; - -import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.uno.XInterface; -import java.io.PrintWriter; -import lib.StatusException; -import lib.TestCase; -import lib.TestEnvironment; -import lib.TestParameters; -import util.utils; - -/** - * - * @author sg128468 - */ -public class UICommandDescription extends TestCase { - XInterface oObj = null; - - protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) { - TestEnvironment tEnv = null; - XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF(); - try { - oObj = (XInterface)xMSF.createInstance("com.sun.star.frame.UICommandDescription"); - } - catch(com.sun.star.uno.Exception e) { - e.printStackTrace(log); - throw new StatusException("Could not create object 'UICommandDescription'", e); - } - - log.println("TestObject: " + utils.getImplName(oObj)); - tEnv = new TestEnvironment(oObj); - return tEnv; - } - -} diff --git a/qadevOOo/tests/java/mod/_fwk/UIConfigurationManager.java b/qadevOOo/tests/java/mod/_fwk/UIConfigurationManager.java deleted file mode 100755 index 235e8a4be..000000000 --- a/qadevOOo/tests/java/mod/_fwk/UIConfigurationManager.java +++ /dev/null @@ -1,205 +0,0 @@ -/************************************************************************* - * - * 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 mod._fwk; - -import com.sun.star.beans.PropertyValue; -import com.sun.star.container.XIndexAccess; -import com.sun.star.container.XIndexContainer; -import com.sun.star.embed.ElementModes; -import com.sun.star.embed.XStorage; -import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.lang.XSingleServiceFactory; -import com.sun.star.uno.UnoRuntime; -import com.sun.star.uno.XInterface; -import ifc.ui._XUIConfiguration; -import java.io.PrintWriter; -import com.sun.star.lang.EventObject; -import com.sun.star.ui.ConfigurationEvent; -import com.sun.star.ui.UIElementType; -import com.sun.star.ui.XUIConfigurationManager; -import com.sun.star.ui.XUIConfigurationStorage; -import ifc.ui._XUIConfigurationManager; -import lib.TestCase; -import lib.TestEnvironment; -import lib.TestParameters; -import util.utils; - -/** - */ -public class UIConfigurationManager extends TestCase { - XUIConfigurationManager xManager = null; - - - /** - * Create test environment: - * <ul> - * <li>create a text doc</li> - * <li>get the model from the text doc</li> - * <li>query model for XUIConfigurationManagerSupplier interface</li> - * <li>get the manager from the supplier</li> - * </ul> - * @param tParam The test parameters. - * @param The log writer. - * @return The test environment. - */ - protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) { - TestEnvironment tEnv = null; - XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF(); - - log.println("Creating instance..."); - - try { - xManager = (XUIConfigurationManager)UnoRuntime.queryInterface( - XUIConfigurationManager.class, xMSF.createInstance( - "com.sun.star.comp.framework.UIConfigurationManager")); - } - catch(com.sun.star.uno.Exception e) { - } - // just to make sure, it's the right one. - log.println("TestObject: " + utils.getImplName(xManager)); - tEnv = new TestEnvironment(xManager); - - // create a configuration storage - try { - String sourceDeleteCfg = util.utils.getFullTestURL("delete.cfg"); - String deleteCfg = util.utils.getFullURL(util.utils.getOfficeTemp(xMSF) + "delete.cfg"); - util.utils.copyFile(xMSF, sourceDeleteCfg, deleteCfg); - XStorage xSubStorage = null; - Object o = (XInterface)xMSF.createInstance("com.sun.star.embed.StorageFactory"); - XSingleServiceFactory xSSF = (XSingleServiceFactory)UnoRuntime.queryInterface( - XSingleServiceFactory.class, o); - Object[] props = new Object[2]; - props[0] = deleteCfg; - props[1] = new Integer(ElementModes.READWRITE); - XStorage xRootStorage = (XStorage)UnoRuntime.queryInterface(XStorage.class, xSSF.createInstanceWithArguments(props)); - xSubStorage = xRootStorage.openStorageElement("Configurations2", ElementModes.READWRITE); - - XUIConfigurationStorage xConfigStorage =(XUIConfigurationStorage)UnoRuntime.queryInterface(XUIConfigurationStorage.class, xManager); - xConfigStorage.setStorage(xSubStorage); - tEnv.addObjRelation("XUIConfigurationStorage.Storage", xSubStorage); - } - catch(com.sun.star.uno.Exception e) { - log.println("Could not create storage: " + e.toString()); - } - util.dbg.printInterfaces(xManager); - - tEnv.addObjRelation("XUIConfiguration.XUIConfigurationListenerImpl", - new ConfigurationListener(log, xManager, xMSF)); - - // the short cut manager service name - // 2do: correct the service name when it's no longer in - tEnv.addObjRelation("XConfigurationManager.ShortCutManager", - "com.sun.star.ui.DocumentAcceleratorConfiguration"); - return tEnv; - } - - /** - * An implementation of the _XUIConfiguration.XUIConfigurationListenerImpl - * interface to trigger the event for a listener call. - * @see ifc.ui._XUIConfiguration - */ - public static class ConfigurationListener implements _XUIConfiguration.XUIConfigurationListenerImpl { - private boolean triggered = false; - private PrintWriter log = null; - private XUIConfigurationManager xUIManager = null; - private XMultiServiceFactory xMSF = null; - private static int iUniqueCounter; - - public ConfigurationListener(PrintWriter _log, XUIConfigurationManager xUIManager, XMultiServiceFactory xMSF) { - log = _log; - this.xUIManager = xUIManager; - this.xMSF = xMSF; - iUniqueCounter = 0; - } - public void reset(){ - triggered = false; - } - public void fireEvent() { - try { - if (iUniqueCounter == 0) { - iUniqueCounter++; - PropertyValue[][]props = xUIManager.getUIElementsInfo(UIElementType.UNKNOWN); - XIndexAccess xMenuBarSettings = xUIManager.getSettings( - "private:resource/menubar/menubar", true); - - PropertyValue[]prop = _XUIConfigurationManager.createMenuBarEntry( - "Trigger Event", xMenuBarSettings, xMSF, log); - _XUIConfigurationManager.createMenuBarItem("Click for Macro", - (XIndexContainer)UnoRuntime.queryInterface( - XIndexContainer.class, prop[3].Value), log); - XIndexContainer x = (XIndexContainer)UnoRuntime.queryInterface(XIndexContainer.class, xMenuBarSettings); - x.insertByIndex(x.getCount(), prop); - xUIManager.replaceSettings("private:resource/menubar/menubar", xMenuBarSettings); - xUIManager.reset(); - } - } - catch(com.sun.star.container.NoSuchElementException e) { - log.println("_XUIConfiguration.XUIConfigurationListenerImpl: Exception."); - e.printStackTrace(log); - } - catch(com.sun.star.lang.IllegalArgumentException e) { - log.println("_XUIConfiguration.XUIConfigurationListenerImpl: Exception."); - e.printStackTrace(log); - } - catch(com.sun.star.lang.IllegalAccessException e) { - log.println("_XUIConfiguration.XUIConfigurationListenerImpl: Exception."); - e.printStackTrace(log); - } - catch(com.sun.star.lang.IndexOutOfBoundsException e) { - log.println("_XUIConfiguration.XUIConfigurationListenerImpl: Exception."); - e.printStackTrace(log); - } - catch(com.sun.star.lang.WrappedTargetException e) { - log.println("_XUIConfiguration.XUIConfigurationListenerImpl: Exception."); - e.printStackTrace(log); - } - } - public boolean actionWasTriggered(){ - return triggered; - } - public void disposing(EventObject e) { - triggered = true; - log.println("_XUIConfiguration.XUIConfigurationListenerImpl.disposing the listener."); - } - public void elementInserted(ConfigurationEvent configEvent) { - triggered = true; - log.println("_XUIConfiguration.XUIConfigurationListenerImpl.elementInserted."); - } - public void elementRemoved(ConfigurationEvent configEvent) { - triggered = true; - log.println("_XUIConfiguration.XUIConfigurationListenerImpl.elementRemoved."); - } - public void elementReplaced(ConfigurationEvent configEvent) { - triggered = true; - log.println("_XUIConfiguration.XUIConfigurationListenerImpl.elementReplaced."); - } - } - -} - - diff --git a/qadevOOo/tests/java/mod/_fwk/UIElementFactoryManager.java b/qadevOOo/tests/java/mod/_fwk/UIElementFactoryManager.java deleted file mode 100755 index 7c26c3b18..000000000 --- a/qadevOOo/tests/java/mod/_fwk/UIElementFactoryManager.java +++ /dev/null @@ -1,101 +0,0 @@ -/************************************************************************* - * - * 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 mod._fwk; - -import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.uno.UnoRuntime; -import com.sun.star.uno.XInterface; -import java.io.PrintWriter; -import com.sun.star.text.XTextDocument; -import com.sun.star.util.XCloseable; -import lib.StatusException; -import lib.TestCase; -import lib.TestEnvironment; -import lib.TestParameters; -import util.WriterTools; - -/** - */ -public class UIElementFactoryManager extends TestCase { - Object oObj = null; - XTextDocument xTextDoc; - - /** - * Cleanup: close the created document - * @param tParam The test parameters. - * @param The log writer. - * @return The test environment. - */ - protected void cleanup(TestParameters tParam, PrintWriter log) { - log.println(" disposing xTextDoc "); - - try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( - XCloseable.class, xTextDoc); - closer.close(true); - } catch (com.sun.star.util.CloseVetoException e) { - log.println("couldn't close document"); - } catch (com.sun.star.lang.DisposedException e) { - log.println("couldn't close document"); - } - } - - /** - * Create test environment: - * <ul> - * <li>create a text doc</li> - * <li>get the model from the text doc</li> - * <li>query model for XUIConfigurationManagerSupplier interface</li> - * <li>get the manager from the supplier</li> - * </ul> - * @param tParam The test parameters. - * @param The log writer. - * @return The test environment. - */ - protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) { - TestEnvironment tEnv = null; - XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF(); - - log.println("Creating instance..."); - xTextDoc = WriterTools.createTextDoc(xMSF); - try { - oObj = xMSF.createInstance("com.sun.star.ui.UIElementFactoryManager"); - } - catch(com.sun.star.uno.Exception e) { - throw new StatusException("Cannot create test object.", e); - } - log.println("TestObject: " + util.utils.getImplName(oObj)); - - tEnv = new TestEnvironment((XInterface)oObj); - - - return tEnv; - } -} - - diff --git a/qadevOOo/tests/java/mod/_fwk/URLTransformer.java b/qadevOOo/tests/java/mod/_fwk/URLTransformer.java deleted file mode 100644 index f9984b933..000000000 --- a/qadevOOo/tests/java/mod/_fwk/URLTransformer.java +++ /dev/null @@ -1,73 +0,0 @@ -/************************************************************************* - * - * 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 mod._fwk; - -import java.io.PrintWriter; - -import lib.Status; -import lib.StatusException; -import lib.TestCase; -import lib.TestEnvironment; -import lib.TestParameters; - -import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.uno.XInterface; - -/** -* Test for object that implements the following interfaces : -* <ul> -* <li><code>com::sun::star::util::XURLTransformer</code></li> -* </ul><p> -* @see com.sun.star.util.XURLTransformer -* @see ifc.util._XURLTransformer -*/ -public class URLTransformer extends TestCase { - - /** - * Creating a Testenvironment for the interfaces to be tested. - */ - public TestEnvironment createTestEnvironment( TestParameters Param, - PrintWriter log ) throws StatusException { - - XInterface oObj = null; - - try { - oObj = (XInterface)((XMultiServiceFactory)Param.getMSF()).createInstance( - "com.sun.star.comp.framework.URLTransformer"); - } catch(com.sun.star.uno.Exception e) { - e.printStackTrace(log); - throw new StatusException( - Status.failed("Couldn't create instance")); - } - - TestEnvironment tEnv = new TestEnvironment( oObj ); - - return tEnv; - } // finish method getTestEnvironment - -} |