From ed5640d8b587fbcfed7dd7967f3de04b37a76f26 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:06:44 +0200 Subject: Adding upstream version 4:7.4.7. Signed-off-by: Daniel Baumann --- .../tests/java/mod/_fwk/ControlMenuController.java | 47 ++++ qadevOOo/tests/java/mod/_fwk/Desktop.java | 112 +++++++++ qadevOOo/tests/java/mod/_fwk/DispatchRecorder.java | 156 ++++++++++++ .../java/mod/_fwk/DispatchRecorderSupplier.java | 55 +++++ .../tests/java/mod/_fwk/FontMenuController.java | 44 ++++ .../java/mod/_fwk/FontSizeMenuController.java | 42 ++++ .../tests/java/mod/_fwk/FooterMenuController.java | 42 ++++ .../tests/java/mod/_fwk/FormatMenuController.java | 42 ++++ qadevOOo/tests/java/mod/_fwk/Frame.java | 104 ++++++++ .../tests/java/mod/_fwk/HeaderMenuController.java | 42 ++++ qadevOOo/tests/java/mod/_fwk/JobExecutor.java | 273 +++++++++++++++++++++ qadevOOo/tests/java/mod/_fwk/JobHandler.java | 73 ++++++ qadevOOo/tests/java/mod/_fwk/LayoutManager.java | 105 ++++++++ .../tests/java/mod/_fwk/MacrosMenuController.java | 41 ++++ qadevOOo/tests/java/mod/_fwk/MailToDispatcher.java | 61 +++++ qadevOOo/tests/java/mod/_fwk/MenuBarFactory.java | 41 ++++ qadevOOo/tests/java/mod/_fwk/ModuleManager.java | 227 +++++++++++++++++ .../mod/_fwk/ModuleUIConfigurationManager.java | 188 ++++++++++++++ .../_fwk/ModuleUIConfigurationManagerSupplier.java | 42 ++++ .../java/mod/_fwk/PopupMenuControllerFactory.java | 99 ++++++++ qadevOOo/tests/java/mod/_fwk/ServiceHandler.java | 61 +++++ qadevOOo/tests/java/mod/_fwk/SoundHandler.java | 62 +++++ .../java/mod/_fwk/StatusBarControllerFactory.java | 47 ++++ .../java/mod/_fwk/ToolBarsMenuController.java | 42 ++++ .../tests/java/mod/_fwk/UICategoryDescription.java | 42 ++++ .../tests/java/mod/_fwk/UICommandDescription.java | 41 ++++ .../java/mod/_fwk/UIConfigurationManager.java | 196 +++++++++++++++ .../java/mod/_fwk/UIElementFactoryManager.java | 84 +++++++ qadevOOo/tests/java/mod/_fwk/URLTransformer.java | 53 ++++ 29 files changed, 2464 insertions(+) create mode 100644 qadevOOo/tests/java/mod/_fwk/ControlMenuController.java create mode 100644 qadevOOo/tests/java/mod/_fwk/Desktop.java create mode 100644 qadevOOo/tests/java/mod/_fwk/DispatchRecorder.java create mode 100644 qadevOOo/tests/java/mod/_fwk/DispatchRecorderSupplier.java create mode 100644 qadevOOo/tests/java/mod/_fwk/FontMenuController.java create mode 100644 qadevOOo/tests/java/mod/_fwk/FontSizeMenuController.java create mode 100644 qadevOOo/tests/java/mod/_fwk/FooterMenuController.java create mode 100644 qadevOOo/tests/java/mod/_fwk/FormatMenuController.java create mode 100644 qadevOOo/tests/java/mod/_fwk/Frame.java create mode 100644 qadevOOo/tests/java/mod/_fwk/HeaderMenuController.java create mode 100644 qadevOOo/tests/java/mod/_fwk/JobExecutor.java create mode 100644 qadevOOo/tests/java/mod/_fwk/JobHandler.java create mode 100644 qadevOOo/tests/java/mod/_fwk/LayoutManager.java create mode 100644 qadevOOo/tests/java/mod/_fwk/MacrosMenuController.java create mode 100644 qadevOOo/tests/java/mod/_fwk/MailToDispatcher.java create mode 100644 qadevOOo/tests/java/mod/_fwk/MenuBarFactory.java create mode 100644 qadevOOo/tests/java/mod/_fwk/ModuleManager.java create mode 100644 qadevOOo/tests/java/mod/_fwk/ModuleUIConfigurationManager.java create mode 100644 qadevOOo/tests/java/mod/_fwk/ModuleUIConfigurationManagerSupplier.java create mode 100644 qadevOOo/tests/java/mod/_fwk/PopupMenuControllerFactory.java create mode 100644 qadevOOo/tests/java/mod/_fwk/ServiceHandler.java create mode 100644 qadevOOo/tests/java/mod/_fwk/SoundHandler.java create mode 100644 qadevOOo/tests/java/mod/_fwk/StatusBarControllerFactory.java create mode 100644 qadevOOo/tests/java/mod/_fwk/ToolBarsMenuController.java create mode 100644 qadevOOo/tests/java/mod/_fwk/UICategoryDescription.java create mode 100644 qadevOOo/tests/java/mod/_fwk/UICommandDescription.java create mode 100644 qadevOOo/tests/java/mod/_fwk/UIConfigurationManager.java create mode 100644 qadevOOo/tests/java/mod/_fwk/UIElementFactoryManager.java create mode 100644 qadevOOo/tests/java/mod/_fwk/URLTransformer.java (limited to 'qadevOOo/tests/java/mod/_fwk') diff --git a/qadevOOo/tests/java/mod/_fwk/ControlMenuController.java b/qadevOOo/tests/java/mod/_fwk/ControlMenuController.java new file mode 100644 index 000000000..9863c4cc3 --- /dev/null +++ b/qadevOOo/tests/java/mod/_fwk/ControlMenuController.java @@ -0,0 +1,47 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +package mod._fwk; + +import com.sun.star.lang.XMultiServiceFactory; +import com.sun.star.uno.XInterface; +import java.io.PrintWriter; +import lib.TestCase; +import lib.TestEnvironment; +import lib.TestParameters; +import util.utils; + + +/** + */ +public class ControlMenuController extends TestCase { + XInterface oObj = null; + + /** + * Create test environment. + */ + @Override + protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) throws Exception { + XMultiServiceFactory xMSF = tParam.getMSF(); + oObj = (XInterface)xMSF.createInstance("com.sun.star.comp.framework.ControlMenuController"); + log.println("TestObject: " + utils.getImplName(oObj)); + TestEnvironment tEnv = new TestEnvironment(oObj); + return tEnv; + } + +} diff --git a/qadevOOo/tests/java/mod/_fwk/Desktop.java b/qadevOOo/tests/java/mod/_fwk/Desktop.java new file mode 100644 index 000000000..89a2ab451 --- /dev/null +++ b/qadevOOo/tests/java/mod/_fwk/Desktop.java @@ -0,0 +1,112 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +package mod._fwk; + +import java.io.PrintWriter; + +import lib.TestCase; +import lib.TestEnvironment; +import lib.TestParameters; +import util.SOfficeFactory; + +import com.sun.star.frame.XDesktop; +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 +* com.sun.star.frame.Desktop.

+* Object implements the following interfaces : +*

+* @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 + * createTestEnvironment method. + */ + @Override + 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 com.sun.star.frame.Desktop. + */ + @Override + protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) throws Exception { + + // get a soffice factory object + SOfficeFactory SOF = SOfficeFactory.getFactory( Param.getMSF()); + + log.println( "creating a text document" ); + xTextDoc = SOF.createTextDoc(null); + + XInterface oObj = (XInterface)Param.getMSF().createInstance( + "com.sun.star.comp.framework.Desktop"); + + TestEnvironment tEnv = new TestEnvironment( oObj ); + + tEnv.addObjRelation("XDispatchProvider.URL", ".uno:Open"); + + tEnv.addObjRelation("Desktop",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 new file mode 100644 index 000000000..25c31fdff --- /dev/null +++ b/qadevOOo/tests/java/mod/_fwk/DispatchRecorder.java @@ -0,0 +1,156 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +package mod._fwk; + +import com.sun.star.beans.PropertyValue; +import com.sun.star.frame.XModel; +import java.io.PrintWriter; + +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.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 : +*

+* @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 com.sun.star.frame.Desktop. + */ + @Override + public TestEnvironment createTestEnvironment( TestParameters Param, + PrintWriter log ) throws Exception { + + XInterface oObj = null; + XFrame xFrame = null; + XDispatchRecorder xDR = null; + + SOfficeFactory SOF = SOfficeFactory.getFactory(Param.getMSF()); + oDoc = SOF.createTextDoc(null); + util.utils.waitForEventIdle(Param.getMSF()); + + XModel model = UnoRuntime.queryInterface(XModel.class, oDoc); + xFrame = model.getCurrentController().getFrame(); + + XPropertySet xFramePS = UnoRuntime.queryInterface + (XPropertySet.class, xFrame); + XDispatchRecorderSupplier xDRS = null; + xDRS = (XDispatchRecorderSupplier) AnyConverter.toObject( + new Type(XDispatchRecorderSupplier.class), + xFramePS.getPropertyValue("DispatchRecorderSupplier")); + if (xDRS == null) { + + Object oDRS = Param.getMSF().createInstance( + "com.sun.star.comp.framework.DispatchRecorderSupplier"); + xFramePS.setPropertyValue("DispatchRecorderSupplier", oDRS); + xDRS = UnoRuntime.queryInterface(XDispatchRecorderSupplier.class,oDRS); + } + + xDR = xDRS.getDispatchRecorder(); + if (xDR != null) { + oObj = xDR; + } else { + oObj = (XInterface)Param.getMSF().createInstance( + "com.sun.star.comp.framework.DispatchRecorder"); + xDR = UnoRuntime.queryInterface + (XDispatchRecorder.class, oObj); + xDRS.setDispatchRecorder(xDR); + } + + + // fill recorder with content. It's needed for XIndexReplace + URL dispURL = utils.parseURL(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(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 + + @Override + 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 new file mode 100644 index 000000000..0d2b2d0b4 --- /dev/null +++ b/qadevOOo/tests/java/mod/_fwk/DispatchRecorderSupplier.java @@ -0,0 +1,55 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +package mod._fwk; + +import java.io.PrintWriter; + +import lib.TestCase; +import lib.TestEnvironment; +import lib.TestParameters; + +import com.sun.star.uno.XInterface; + +/** +* Test for object that implements the following interfaces : +*

+* @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 + * com.sun.star.comp.framework.DispatchRecorderSupplier. + */ + @Override + public TestEnvironment createTestEnvironment( TestParameters Param, + PrintWriter log ) throws Exception { + + XInterface oObj = (XInterface)Param.getMSF().createInstance( + "com.sun.star.comp.framework.DispatchRecorderSupplier"); + + TestEnvironment tEnv = new TestEnvironment( oObj ); + + return tEnv; + } // finish method getTestEnvironment +} diff --git a/qadevOOo/tests/java/mod/_fwk/FontMenuController.java b/qadevOOo/tests/java/mod/_fwk/FontMenuController.java new file mode 100644 index 000000000..3f8d1a687 --- /dev/null +++ b/qadevOOo/tests/java/mod/_fwk/FontMenuController.java @@ -0,0 +1,44 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +package mod._fwk; + +import com.sun.star.lang.XMultiServiceFactory; +import com.sun.star.uno.XInterface; +import java.io.PrintWriter; +import lib.TestCase; +import lib.TestEnvironment; +import lib.TestParameters; +import util.utils; + +/** + */ +public class FontMenuController extends TestCase { + XInterface oObj = null; + + @Override + protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) throws Exception { + XMultiServiceFactory xMSF = tParam.getMSF(); + oObj = (XInterface)xMSF.createInstance("com.sun.star.comp.framework.FontMenuController"); + + log.println("TestObject: " + utils.getImplName(oObj)); + TestEnvironment tEnv = new TestEnvironment(oObj); + return tEnv; + } + +} diff --git a/qadevOOo/tests/java/mod/_fwk/FontSizeMenuController.java b/qadevOOo/tests/java/mod/_fwk/FontSizeMenuController.java new file mode 100644 index 000000000..b662b5f07 --- /dev/null +++ b/qadevOOo/tests/java/mod/_fwk/FontSizeMenuController.java @@ -0,0 +1,42 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +package mod._fwk; + +import com.sun.star.lang.XMultiServiceFactory; +import com.sun.star.uno.XInterface; +import java.io.PrintWriter; +import lib.TestCase; +import lib.TestEnvironment; +import lib.TestParameters; +import util.utils; + +public class FontSizeMenuController extends TestCase { + XInterface oObj = null; + + @Override + protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) throws Exception { + XMultiServiceFactory xMSF = tParam.getMSF(); + oObj = (XInterface)xMSF.createInstance("com.sun.star.comp.framework.FontSizeMenuController"); + + log.println("TestObject: " + utils.getImplName(oObj)); + TestEnvironment tEnv = new TestEnvironment(oObj); + return tEnv; + } + +} diff --git a/qadevOOo/tests/java/mod/_fwk/FooterMenuController.java b/qadevOOo/tests/java/mod/_fwk/FooterMenuController.java new file mode 100644 index 000000000..99e9207bd --- /dev/null +++ b/qadevOOo/tests/java/mod/_fwk/FooterMenuController.java @@ -0,0 +1,42 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +package mod._fwk; + +import com.sun.star.lang.XMultiServiceFactory; +import com.sun.star.uno.XInterface; +import java.io.PrintWriter; +import lib.TestCase; +import lib.TestEnvironment; +import lib.TestParameters; +import util.utils; + +public class FooterMenuController extends TestCase { + XInterface oObj = null; + + @Override + protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) throws Exception { + XMultiServiceFactory xMSF = tParam.getMSF(); + oObj = (XInterface)xMSF.createInstance("com.sun.star.comp.framework.FooterMenuController"); + + log.println("TestObject: " + utils.getImplName(oObj)); + TestEnvironment tEnv = new TestEnvironment(oObj); + return tEnv; + } + +} diff --git a/qadevOOo/tests/java/mod/_fwk/FormatMenuController.java b/qadevOOo/tests/java/mod/_fwk/FormatMenuController.java new file mode 100644 index 000000000..be3cb17d4 --- /dev/null +++ b/qadevOOo/tests/java/mod/_fwk/FormatMenuController.java @@ -0,0 +1,42 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +package mod._fwk; + +import com.sun.star.lang.XMultiServiceFactory; +import com.sun.star.uno.XInterface; +import java.io.PrintWriter; +import lib.TestCase; +import lib.TestEnvironment; +import lib.TestParameters; +import util.utils; + +public class FormatMenuController extends TestCase { + XInterface oObj = null; + + @Override + protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) throws Exception { + XMultiServiceFactory xMSF = tParam.getMSF(); + oObj = (XInterface)xMSF.createInstance("com.sun.star.comp.framework.FormatMenuController"); + + log.println("TestObject: " + utils.getImplName(oObj)); + TestEnvironment tEnv = new TestEnvironment(oObj); + return tEnv; + } + +} diff --git a/qadevOOo/tests/java/mod/_fwk/Frame.java b/qadevOOo/tests/java/mod/_fwk/Frame.java new file mode 100644 index 000000000..cb18c9659 --- /dev/null +++ b/qadevOOo/tests/java/mod/_fwk/Frame.java @@ -0,0 +1,104 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +package mod._fwk; + +import java.io.PrintWriter; + +import lib.TestCase; +import lib.TestEnvironment; +import lib.TestParameters; +import util.SOfficeFactory; + +import com.sun.star.frame.XFrame; +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 : +*

+* @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. + */ + @Override + public TestEnvironment createTestEnvironment( TestParameters Param, + PrintWriter log ) throws Exception { + + XInterface oObj = null; + + log.println( "creating a test environment" ); + + // get a soffice factory object + SOfficeFactory SOF = SOfficeFactory.getFactory( Param.getMSF()); + + log.println( "creating a text document" ); + xTextDoc = SOF.createTextDoc(null); + + frame = xTextDoc.getCurrentController().getFrame(); + oObj = 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 interface manipulations). + */ + @Override + protected void cleanup( TestParameters Param, PrintWriter log) { + try { + XCloseable xTextClose = 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 new file mode 100644 index 000000000..16342de71 --- /dev/null +++ b/qadevOOo/tests/java/mod/_fwk/HeaderMenuController.java @@ -0,0 +1,42 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +package mod._fwk; + +import com.sun.star.lang.XMultiServiceFactory; +import com.sun.star.uno.XInterface; +import java.io.PrintWriter; +import lib.TestCase; +import lib.TestEnvironment; +import lib.TestParameters; +import util.utils; + +public class HeaderMenuController extends TestCase { + XInterface oObj = null; + + @Override + protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) throws Exception { + XMultiServiceFactory xMSF = tParam.getMSF(); + oObj = (XInterface)xMSF.createInstance("com.sun.star.comp.framework.HeaderMenuController"); + + log.println("TestObject: " + utils.getImplName(oObj)); + TestEnvironment tEnv = new TestEnvironment(oObj); + return tEnv; + } + +} diff --git a/qadevOOo/tests/java/mod/_fwk/JobExecutor.java b/qadevOOo/tests/java/mod/_fwk/JobExecutor.java new file mode 100644 index 000000000..61dee42e9 --- /dev/null +++ b/qadevOOo/tests/java/mod/_fwk/JobExecutor.java @@ -0,0 +1,273 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +package mod._fwk; + +import java.io.PrintWriter; + +import lib.StatusException; +import lib.TestCase; +import lib.TestEnvironment; +import lib.TestParameters; +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 : + *

+ * The following files are needed for testcase creation : + *