diff options
Diffstat (limited to 'qadevOOo')
41 files changed, 308 insertions, 508 deletions
diff --git a/qadevOOo/prj/build.lst b/qadevOOo/prj/build.lst index 73092cae2a5f..1594d5c59f57 100644 --- a/qadevOOo/prj/build.lst +++ b/qadevOOo/prj/build.lst @@ -2,3 +2,4 @@ qa qadevOOo : javaunohelper jurt ridljar unoil NULL qa qadevOOo usr1 - all qa_mkout NULL qa qadevOOo nmake - all qa_runner_ant_build NULL qa qadevOOo\runner nmake - all qa_make_package qa_runner_ant_build NULL +qa qadevOOo\qa\unoapi nmake - all qa_qa_unoapi NULL diff --git a/qadevOOo/qa/unoapi/Test.java b/qadevOOo/qa/unoapi/Test.java new file mode 100644 index 000000000000..e7921911d937 --- /dev/null +++ b/qadevOOo/qa/unoapi/Test.java @@ -0,0 +1,51 @@ +/************************************************************************* +* 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 org.openoffice.qadevOOo.qa.unoapi; + +import org.openoffice.Runner; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; + +public final class Test { + @org.junit.Before public void setUp() throws Exception { + connection.setUp(); + } + + @org.junit.After public void tearDown() + throws InterruptedException, com.sun.star.uno.Exception + { + connection.tearDown(); + } + + @org.junit.Test public void test() { + assertTrue( + Runner.run( + "-sce", "qadevOOo.sce", "-xcl", "knownissues.xcl", "-cs", + connection.getDescription())); + } + + private final OfficeConnection connection = new OfficeConnection(); +} diff --git a/qadevOOo/qa/unoapi/makefile.mk b/qadevOOo/qa/unoapi/makefile.mk index 61a2b81d60bf..d8d308c47d3b 100755 --- a/qadevOOo/qa/unoapi/makefile.mk +++ b/qadevOOo/qa/unoapi/makefile.mk @@ -1,7 +1,6 @@ #************************************************************************* -# # 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 @@ -22,19 +21,28 @@ # version 3 along with OpenOffice.org. If not, see # <http://www.openoffice.org/license.html> # for a copy of the LGPLv3 License. -# -#************************************************************************* +#***********************************************************************/ -PRJ=..$/.. +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE -PRJNAME=qadevOOo -TARGET=qa_unoapi +PRJ = ../.. +PRJNAME = qadevOOo +TARGET = qa_unoapi -.INCLUDE: settings.mk +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = org/openoffice/qadevOOo/qa/unoapi +JAVATESTFILES = Test.java +JAVAFILES = $(JAVATESTFILES) +JARFILES = OOoRunner.jar ridl.jar test.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) +.END +.INCLUDE: settings.mk .INCLUDE: target.mk +.INCLUDE: installationtest.mk -ALLTAR : UNOAPI_TEST +ALLTAR : javatest -UNOAPI_TEST: - +$(SOLARENV)$/bin$/checkapi -sce qadevOOo.sce -xcl knownissues.xcl -tdoc $(PWD)$/testdocuments +.END diff --git a/qadevOOo/runner/base/java_fat.java b/qadevOOo/runner/base/java_fat.java index 1d75c48ed43e..4dd3ad51a817 100644 --- a/qadevOOo/runner/base/java_fat.java +++ b/qadevOOo/runner/base/java_fat.java @@ -219,6 +219,7 @@ public class java_fat implements TestBase { closeExistingOffice(); tEnv = getEnv(entry, m_aParams); + tCase = tEnv.getTestCase(); } // MultiMethodTest ifc = null; @@ -251,6 +252,7 @@ public class java_fat implements TestBase { closeExistingOffice(); tEnv = getEnv(entry, m_aParams); + tCase = tEnv.getTestCase(); if (countInterfaceTestRun < 2) { finished = false; @@ -313,6 +315,9 @@ public class java_fat implements TestBase } System.out.println(counter + " of " + entries.length + " tests failed"); + if (counter != 0) { + retValue = false; + } } closeExistingOffice(); @@ -455,17 +460,16 @@ public class java_fat implements TestBase log.initialize(entry, logging); tCase.setLogWriter((PrintWriter) log); - TestEnvironment tEnv = null; - try { tCase.initializeTestCase(param); - tEnv = tCase.getTestEnvironment(param); + return tCase.getTestEnvironment(param); } catch (com.sun.star.lang.DisposedException de) { System.out.println("Office disposed"); closeExistingOffice(); + throw de; } catch (lib.StatusException e) { @@ -475,9 +479,8 @@ public class java_fat implements TestBase entry.ErrorMsg = e.getMessage(); entry.hasErrorMsg = true; + throw e; } - - return tEnv; } private void closeExistingOffice() diff --git a/qadevOOo/runner/basicrunner/BasicTestCase.java b/qadevOOo/runner/basicrunner/BasicTestCase.java index a84e996cc09e..1356badc12d7 100644 --- a/qadevOOo/runner/basicrunner/BasicTestCase.java +++ b/qadevOOo/runner/basicrunner/BasicTestCase.java @@ -159,11 +159,6 @@ public class BasicTestCase extends TestCase { return tEnv; } - - protected void cleanupTestEnvironment(TestParameters tParam, - TestEnvironment tEnv, LogWriter log) { - } - /** * BASIC is told to dispose the test object. * @param tParam The test parameters. diff --git a/qadevOOo/runner/helper/ClParser.java b/qadevOOo/runner/helper/ClParser.java index 7e54bccb174e..583aea56f977 100644 --- a/qadevOOo/runner/helper/ClParser.java +++ b/qadevOOo/runner/helper/ClParser.java @@ -26,6 +26,7 @@ ************************************************************************/ package helper; +import java.io.File; import java.util.Properties; import lib.TestParameters; @@ -94,7 +95,8 @@ public class ClParser if (pName.equals("TestDocumentPath")) { - System.setProperty("DOCPTH", pValue); + System.setProperty( + "DOCPTH", new File(pValue).getAbsolutePath()); } else if (pName.equals(PropertyName.SRC_ROOT)) { diff --git a/qadevOOo/runner/lib/TestCase.java b/qadevOOo/runner/lib/TestCase.java index e5214f2edb40..6b8b960c3014 100644 --- a/qadevOOo/runner/lib/TestCase.java +++ b/qadevOOo/runner/lib/TestCase.java @@ -140,18 +140,16 @@ public abstract class TestCase { message = e.toString(); System.out.println("Exception while getting Environment "+message); e.printStackTrace(); + cleanup(tParam, log); } return tEnv; } /** * Disposes the <code>TestEnvironment</code> when it is not needed anymore. - * The method calls <code>cleanupTestEnvironment()</code>. * * @param tEnv the environment to dispose * @param tParam test parameters - * - * @see #cleanupTestEnvironment() */ public synchronized void disposeTestEnvironment( TestEnvironment tEnv, TestParameters tParam ) { @@ -174,22 +172,6 @@ public abstract class TestCase { TestParameters tParam, PrintWriter log ); /** - * Called while disposing a <code>TestEnvironment</code>. In the - * implementation does nothing. Subclasses can override to clean up - * the environments created by them. - * - * @param tParam test parameters - * @param tEnv the environment to cleanup - * @param log writer to log information while testing - * - * @see TestEnvironment - * @see #disposeTestEnvironment() - */ - protected void cleanupTestEnvironment( TestParameters Param, - TestEnvironment tEnv, PrintWriter log ) { - } - - /** * @return the name of the object */ public String getObjectName() { diff --git a/qadevOOo/runner/lib/TestEnvironment.java b/qadevOOo/runner/lib/TestEnvironment.java index 877f681e3b3c..9848a5b2b633 100644 --- a/qadevOOo/runner/lib/TestEnvironment.java +++ b/qadevOOo/runner/lib/TestEnvironment.java @@ -38,23 +38,23 @@ import java.util.Hashtable; * @see TestCase */ -public class TestEnvironment { +public final class TestEnvironment { /** * Contains object relations - auxiliary objects associated with the * tested object and required for testing. */ - protected Hashtable relations = new Hashtable(10); + private final Hashtable relations = new Hashtable(10); /** * An instance of the tested implementation object. */ - protected XInterface testObject; + private final XInterface testObject; /** * Indicates that the testObject is in invalid state and should notbe * used for testing anymore. */ - protected boolean disposed = false; + private boolean disposed = false; /** * A reference to TestCase which has created the test environment. diff --git a/qadevOOo/runner/org/openoffice/Runner.java b/qadevOOo/runner/org/openoffice/Runner.java index 979fc527f775..63486ca9d3f3 100644 --- a/qadevOOo/runner/org/openoffice/Runner.java +++ b/qadevOOo/runner/org/openoffice/Runner.java @@ -182,8 +182,7 @@ public class Runner } } - public static void main(String[] args) - { + public static boolean run(String... args) { System.out.println("OOoRunner Main() version from 20100125 (yyyymmdd)"); setStartTime(getTime()); @@ -246,12 +245,16 @@ public class Runner if (!worked) { System.out.println("Job " + param.get("TestJob") + " failed"); - System.exit(-1); } else { System.out.println("Job " + param.get("TestJob") + " done"); - System.exit(0); } + return worked; + } + + public static void main(String[] args) + { + System.exit(run(args) ? 0 : -1); } } diff --git a/qadevOOo/runner/util/AccessibilityTools.java b/qadevOOo/runner/util/AccessibilityTools.java index c698839f3149..3fb964a2362b 100644 --- a/qadevOOo/runner/util/AccessibilityTools.java +++ b/qadevOOo/runner/util/AccessibilityTools.java @@ -51,18 +51,7 @@ public class AccessibilityTools { } public static XAccessible getAccessibleObject(XInterface xObject) { - XAccessible xAccessible = null; - - try { - xAccessible = (XAccessible) UnoRuntime.queryInterface( - XAccessible.class, xObject); - } catch (Exception e) { - System.out.println( - "caught exception while getting accessible object" + e); - e.printStackTrace(); - } - - return xAccessible; + return UnoRuntime.queryInterface(XAccessible.class, xObject); } public static XWindow getCurrentContainerWindow(XMultiServiceFactory msf, diff --git a/qadevOOo/runner/util/UITools.java b/qadevOOo/runner/util/UITools.java index 1a639d18b252..c9562949632f 100644 --- a/qadevOOo/runner/util/UITools.java +++ b/qadevOOo/runner/util/UITools.java @@ -674,26 +674,6 @@ public class UITools { } } - - /** - * fetch the active window which is on the top of the X-desktop - * @return the active window - * @throws java.lang.Exception if something fail - */ - public XWindow getActiveTopWindow() throws java.lang.Exception - { - XInterface xToolKit = null; - try { - xToolKit = (XInterface) mMSF.createInstance("com.sun.star.awt.Toolkit") ; - } catch (com.sun.star.uno.Exception e) { - throw new Exception("Could not toolkit: " + e.toString()); - } - XExtendedToolkit tk = (XExtendedToolkit) - UnoRuntime.queryInterface(XExtendedToolkit.class, xToolKit); - Object atw = tk.getActiveTopWindow(); - return (XWindow) UnoRuntime.queryInterface(XWindow.class, atw); - } - /** * fetch the window which is equal to the given <CODE>WindowName</CODE> * @return the named window diff --git a/qadevOOo/runner/util/utils.java b/qadevOOo/runner/util/utils.java index 1467edf05375..1091824480a6 100644 --- a/qadevOOo/runner/util/utils.java +++ b/qadevOOo/runner/util/utils.java @@ -38,6 +38,8 @@ import java.util.ArrayList; import java.io.RandomAccessFile; import java.net.Socket; import java.net.ServerSocket; +import java.net.URI; +import java.net.URISyntaxException; import com.sun.star.beans.XPropertySet; import com.sun.star.beans.Property; @@ -364,18 +366,13 @@ public class utils { * */ public static String getOfficeTemp(XMultiServiceFactory msf) { - String tmpDir = util.utils.getUsersTempDir(); + String url = getOfficeUserPath(msf) + "/test-temp/"; try { - String tmp = (String) getOfficeSettingsValue(msf, "Temp"); - if (!tmp.endsWith(System.getProperty("file.separator"))) { - tmp += System.getProperty("file.separator"); - } - tmpDir = getFullURL(tmp); - } catch (Exception e) { - System.out.println("Couldn't get Office TEMP"); - e.printStackTrace(); + new File(new URI(url)).mkdir(); + } catch (URISyntaxException e) { + throw new RuntimeException(e); } - return tmpDir; + return url; } /** diff --git a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleComponent.java b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleComponent.java index 5279ed5b79d9..c5e302451c21 100644 --- a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleComponent.java +++ b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleComponent.java @@ -167,34 +167,53 @@ public class _XAccessibleComponent extends MultiMethodTest { boolean locRes = true; for (int x = -1; x <= bounds.Width; x++) { - locRes &= !oObj.containsPoint(new Point(x, -1)); - locRes &= !oObj.containsPoint( - new Point(x, bounds.Height + bounds.Y)); + if (oObj.containsPoint(new Point(x, -1))) { + log.println( + "Outer upper and lower bounds CONTAIN some component point" + + " (" + x + ", -1) - FAILED"); + locRes = false; + break; + } + if (oObj.containsPoint(new Point(x, bounds.Height + bounds.Y))) { + log.println( + "Outer upper and lower bounds CONTAIN some component point" + + " (" + x + ", " + bounds.Height + bounds.Y + + ") - FAILED"); + locRes = false; + break; + } } if (locRes) { log.println("Outer upper and lower bounds contain no component " + "points - OK"); } else { - log.println("Outer upper and lower bounds CONTAIN some component " + - "points - FAILED"); result = false; } locRes = true; for (int y = -1; y <= bounds.Height; y++) { - locRes &= !oObj.containsPoint(new Point(-1, y)); - locRes &= !oObj.containsPoint( - new Point(bounds.X + bounds.Width, y)); + if (oObj.containsPoint(new Point(-1, y))) { + log.println( + "Outer left and right bounds CONTAIN some component point" + + " (-1, " + y + ") - FAILED"); + locRes = false; + break; + } + if (oObj.containsPoint(new Point(bounds.X + bounds.Width, y))) { + log.println( + "Outer left and right bounds CONTAIN some component point" + + " (" + bounds.X + bounds.Width + ", " + y + ") - FAILED"); + locRes = false; + break; + } } if (locRes) { log.println("Outer left and right bounds contain no component " + "points - OK"); } else { - log.println("Outer left and right bounds CONTAIN some component " + - "points - FAILED"); result = false; } diff --git a/qadevOOo/tests/java/ifc/awt/_XMessageBoxFactory.java b/qadevOOo/tests/java/ifc/awt/_XMessageBoxFactory.java index c96d42e91215..c4e80ee8a1d7 100644 --- a/qadevOOo/tests/java/ifc/awt/_XMessageBoxFactory.java +++ b/qadevOOo/tests/java/ifc/awt/_XMessageBoxFactory.java @@ -27,17 +27,18 @@ package ifc.awt; +import com.sun.star.awt.AsyncCallback; import com.sun.star.awt.Rectangle; +import com.sun.star.awt.XCallback; +import com.sun.star.awt.XMessageBox; +import com.sun.star.awt.XMessageBoxFactory; +import com.sun.star.awt.XRequestCallback; +import com.sun.star.awt.XWindow; import com.sun.star.awt.XWindowPeer; import com.sun.star.lang.XMultiServiceFactory; +import com.sun.star.uno.Any; +import com.sun.star.uno.UnoRuntime; import lib.MultiMethodTest; - -import com.sun.star.awt.XMessageBoxFactory; -import com.sun.star.awt.XWindow; -import com.sun.star.frame.XModel; -import java.io.PrintWriter; -import lib.Status; -import lib.StatusException; import util.UITools; /** @@ -50,81 +51,58 @@ import util.UITools; * @see com.sun.star.awt.XMessageBoxFactory */ public class _XMessageBoxFactory extends MultiMethodTest { - public XMessageBoxFactory oObj = null; - private XWindowPeer the_win = null; - private XModel xModel = null; - - /** - * Retrieves object relation. - * @throws StatusException If the relation not found. - */ - public void before() { - the_win = (XWindowPeer) tEnv.getObjRelation("WINPEER"); - if (the_win == null) - throw new StatusException(Status.failed("Relation 'WINPEER' not found")) ; - xModel = (XModel) tEnv.getObjRelation("XModel"); - if (xModel == null) - throw new StatusException(Status.failed("Relation 'xModel' not found")) ; - - } - - - /** - * As <code>execute()</code> method is a blocking call, - * then it must be executed in a separate thread. This - * thread class just call <code>execute</code> method - * of tested object. - */ - protected Thread execThread = new Thread( - new Runnable() { - public void run() { - Rectangle rect = new Rectangle(0,0,100,100); - oObj.createMessageBox(the_win, rect, "errorbox", 1, "The Title", "The Message") ; - } - }) ; - - /** - * Starts the execution of MessageBox in a separate thread. - * As this call is blocking then the thread execution - * must not be finished. <p> - * Has <b>OK</b> status if thread wasn't finished and - * no exceptions occured. - */ public void _createMessageBox() { - boolean result = true ; - - log.println("Starting createMessageBox() thread ...") ; - execThread.start() ; - - try { - execThread.join(200) ; - } catch (InterruptedException e) { - log.println("createMessageBox() thread was interrupted") ; - result = false ; - } - result &= execThread.isAlive() ; - - UITools oUITools = new UITools((XMultiServiceFactory) tParam.getMSF(), xModel); - - XWindow xWindow = null; - try{ - xWindow = oUITools.getActiveTopWindow(); - - oUITools.printAccessibleTree(log, tParam.getBool("DebugIsActive")); - - oUITools.clickButton("OK"); - - } catch (java.lang.Exception e) { - e.printStackTrace((PrintWriter) log); - log.println("Could not cklick 'OK' on messagebox: " + e.toString()); - result = false; + final XMessageBox mb = oObj.createMessageBox( + (XWindowPeer) tEnv.getObjRelation("WINPEER"), + new Rectangle(0, 0, 100, 100), "errorbox", 1, "The Title", + "The Message"); + final UITools tools = new UITools( + (XMultiServiceFactory) tParam.getMSF(), + UnoRuntime.queryInterface(XWindow.class, mb)); + final State[] state = new State[] { State.NONE }; + XRequestCallback async = AsyncCallback.create( + tParam.getComponentContext()); + async.addCallback( + new XCallback() { + public void notify(Object aData) { + mb.execute(); + } + }, + Any.VOID); + async.addCallback( + new XCallback() { + public void notify(Object aData) { + boolean ok = true; + try { + tools.clickButton("OK"); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + e.printStackTrace(); + ok = false; + } + synchronized (state) { + state[0] = ok ? State.GOOD : State.BAD; + state.notifyAll(); + } + } + }, + Any.VOID); + boolean ok; + synchronized (state) { + while (state[0] == State.NONE) { + try { + state.wait(); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + } + ok = state[0] == State.GOOD; } - - tRes.tested("createMessageBox()", result) ; + tRes.tested("createMessageBox()", ok); } + private enum State { NONE, GOOD, BAD }; } - - diff --git a/qadevOOo/tests/java/ifc/awt/_XSystemChildFactory.java b/qadevOOo/tests/java/ifc/awt/_XSystemChildFactory.java new file mode 100644 index 000000000000..fec9281871eb --- /dev/null +++ b/qadevOOo/tests/java/ifc/awt/_XSystemChildFactory.java @@ -0,0 +1,40 @@ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +************************************************************************/ + +package ifc.awt; + +import com.sun.star.awt.XSystemChildFactory; +import lib.MultiMethodTest; + +public final class _XSystemChildFactory extends MultiMethodTest { + public XSystemChildFactory oObj; + + public void _createSystemChild() { + //TODO + tRes.tested("createSystemChild()", true); + } +} diff --git a/qadevOOo/tests/java/ifc/awt/_XToolkit.java b/qadevOOo/tests/java/ifc/awt/_XToolkit.java index 20b89b88ace5..8824c3bba9ac 100644 --- a/qadevOOo/tests/java/ifc/awt/_XToolkit.java +++ b/qadevOOo/tests/java/ifc/awt/_XToolkit.java @@ -35,6 +35,8 @@ import com.sun.star.awt.XDevice; import com.sun.star.awt.XRegion; import com.sun.star.awt.XToolkit; import com.sun.star.awt.XWindowPeer; +import com.sun.star.lang.XComponent; +import com.sun.star.uno.UnoRuntime; /** * Testing <code>com.sun.star.awt.XToolkit</code> @@ -87,6 +89,7 @@ public class _XToolkit extends MultiMethodTest { if (cWin == null) { log.println("createWindow() create a NULL Object"); } else { + UnoRuntime.queryInterface(XComponent.class, cWin).dispose(); res = true; } } catch (com.sun.star.lang.IllegalArgumentException ex) { @@ -111,6 +114,8 @@ public class _XToolkit extends MultiMethodTest { if ( (cWins[0] == null) || (cWins[1] == null) ) { log.println("createWindows() creates NULL Windows"); } else { + UnoRuntime.queryInterface(XComponent.class, cWins[0]).dispose(); + UnoRuntime.queryInterface(XComponent.class, cWins[1]).dispose(); res = true; } } catch (com.sun.star.lang.IllegalArgumentException ex) { diff --git a/qadevOOo/tests/java/ifc/beans/_XMultiPropertyStates.java b/qadevOOo/tests/java/ifc/beans/_XMultiPropertyStates.java index 0d1f43b8e0c5..552a012f1161 100644 --- a/qadevOOo/tests/java/ifc/beans/_XMultiPropertyStates.java +++ b/qadevOOo/tests/java/ifc/beans/_XMultiPropertyStates.java @@ -55,9 +55,8 @@ public class _XMultiPropertyStates extends MultiMethodTest { public XMultiPropertyStates oObj = null; - Object[] defaults = null; - PropertyState[] states = null; - String[] names = null; + private PropertyState[] states = null; + private String[] names = null; public void before() { names = (String[]) tEnv.getObjRelation("PropertyNames"); @@ -83,7 +82,7 @@ public class _XMultiPropertyStates extends MultiMethodTest { public void _getPropertyDefaults() { boolean result = false; try { - defaults = oObj.getPropertyDefaults(names); + Object[] defaults = oObj.getPropertyDefaults(names); result = (defaults != null) && defaults.length == names.length; log.println("Number of default values: " + defaults.length); } catch (com.sun.star.beans.UnknownPropertyException e) { diff --git a/qadevOOo/tests/java/ifc/beans/_XPropertySet.java b/qadevOOo/tests/java/ifc/beans/_XPropertySet.java index 0690dd3713cc..54c1f3431bbf 100644 --- a/qadevOOo/tests/java/ifc/beans/_XPropertySet.java +++ b/qadevOOo/tests/java/ifc/beans/_XPropertySet.java @@ -64,7 +64,7 @@ public class _XPropertySet extends MultiMethodTest { /** * Flag that indicates change listener was called. */ - boolean propertyChanged = false; + private boolean propertyChanged = false; /** * Listener that must be called on bound property changing. @@ -79,12 +79,12 @@ public class _XPropertySet extends MultiMethodTest { public void disposing (EventObject obj) {} }; - XPropertyChangeListener PClistener = new MyChangeListener(); + private final XPropertyChangeListener PClistener = new MyChangeListener(); /** * Flag that indicates veto listener was called. */ - boolean vetoableChanged = false; + private boolean vetoableChanged = false; /** * Listener that must be called on constrained property changing. @@ -99,19 +99,19 @@ public class _XPropertySet extends MultiMethodTest { public void disposing (EventObject obj) {} }; - XVetoableChangeListener VClistener = new MyVetoListener(); + private final XVetoableChangeListener VClistener = new MyVetoListener(); /** * Structure that collects three properties of each type to test : * Constrained, Bound and Normal. */ - public class PropsToTest { + private final class PropsToTest { String constrained = null; String bound = null; String normal = null; } - PropsToTest PTT = new PropsToTest(); + private final PropsToTest PTT = new PropsToTest(); /** * Tests method <code>getPropertySetInfo</code>. After test completed @@ -470,7 +470,7 @@ public class _XPropertySet extends MultiMethodTest { * Gets the properties being tested. Searches and stores by one * property of each kind (Bound, Vetoable, Normal). */ - public PropsToTest getPropsToTest(XPropertySetInfo xPSI) { + public void getPropsToTest(XPropertySetInfo xPSI) { Property[] properties = xPSI.getProperties(); String bound = ""; @@ -544,9 +544,6 @@ public class _XPropertySet extends MultiMethodTest { //get a random normal property PTT.normal=getRandomString(normal); - - return PTT; - } /** diff --git a/qadevOOo/tests/java/ifc/sheet/_XRangeSelection.java b/qadevOOo/tests/java/ifc/sheet/_XRangeSelection.java index 8df7366842fd..bb61dbe55049 100644 --- a/qadevOOo/tests/java/ifc/sheet/_XRangeSelection.java +++ b/qadevOOo/tests/java/ifc/sheet/_XRangeSelection.java @@ -250,10 +250,6 @@ public class _XRangeSelection extends MultiMethodTest { throw new StatusException("Could not create 'com.sun.star.awt.Toolkit'.", e); } XExtendedToolkit xExtendedToolkit = (XExtendedToolkit)UnoRuntime.queryInterface(XExtendedToolkit.class, aToolkit); - AccessibilityTools accTools = new AccessibilityTools(); - XWindow xWindow = (XWindow)UnoRuntime.queryInterface(XWindow.class, xExtendedToolkit.getActiveTopWindow()); - XAccessible xRoot = accTools.getAccessibleObject(xWindow); - XTopWindow tw = null; XAccessibleComponent xAccessibleComponent = null; @@ -286,7 +282,7 @@ public class _XRangeSelection extends MultiMethodTest { return null; } - xWindow = (XWindow)UnoRuntime.queryInterface(XWindow.class, tw); + XWindow xWindow = (XWindow)UnoRuntime.queryInterface(XWindow.class, tw); Rectangle posSize = xWindow.getPosSize(); // compare the center point with the dimensions of the current top window diff --git a/qadevOOo/tests/java/mod/_basctl/AccessibleShape.java b/qadevOOo/tests/java/mod/_basctl/AccessibleShape.java index 39833520920f..1dd3feb3e4ec 100644 --- a/qadevOOo/tests/java/mod/_basctl/AccessibleShape.java +++ b/qadevOOo/tests/java/mod/_basctl/AccessibleShape.java @@ -32,7 +32,6 @@ import com.sun.star.accessibility.AccessibleRole; import com.sun.star.accessibility.XAccessible; import com.sun.star.awt.PosSize; import com.sun.star.awt.Rectangle; -import com.sun.star.awt.XExtendedToolkit; import com.sun.star.awt.XWindow; import com.sun.star.beans.PropertyValue; import com.sun.star.frame.XDesktop; @@ -58,7 +57,6 @@ public class AccessibleShape extends TestCase { XTextDocument xTextDoc = null; XInterface oObj = null; - XWindow basicIDE = null; protected void cleanup(TestParameters Param, PrintWriter log) { log.println("Cleaning up"); @@ -115,15 +113,9 @@ public class AccessibleShape extends TestCase { throw new StatusException("Couldn't get toolkit", e ); } - - XExtendedToolkit tk = (XExtendedToolkit) - UnoRuntime.queryInterface(XExtendedToolkit.class,oObj); - - AccessibilityTools at = new AccessibilityTools(); - basicIDE = (XWindow) - UnoRuntime.queryInterface(XWindow.class,tk.getActiveTopWindow()); + final XWindow basicIDE = xFrame.getContainerWindow(); XAccessible xRoot = at.getAccessibleObject(basicIDE); @@ -138,23 +130,19 @@ public class AccessibleShape extends TestCase { tEnv.addObjRelation("Destroy", Boolean.TRUE); - final XExtendedToolkit subtk = tk; - tEnv.addObjRelation("EventProducer", new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() { public void fireEvent() { - XWindow xWin = (XWindow) UnoRuntime.queryInterface( - XWindow.class, subtk.getActiveTopWindow()); - Rectangle oldPosSize = xWin.getPosSize(); + Rectangle oldPosSize = basicIDE.getPosSize(); Rectangle newPosSize = new Rectangle(); newPosSize.Width = oldPosSize.Width/2; newPosSize.Height = oldPosSize.Height/2; newPosSize.X = oldPosSize.X + 20; newPosSize.Y = oldPosSize.Y + 20; - xWin.setPosSize(newPosSize.X, newPosSize.Y, newPosSize.Width, + basicIDE.setPosSize(newPosSize.X, newPosSize.Y, newPosSize.Width, newPosSize.Height, PosSize.POSSIZE); utils.shortWait(1000); - xWin.setPosSize(oldPosSize.X, oldPosSize.Y, oldPosSize.Width, + basicIDE.setPosSize(oldPosSize.X, oldPosSize.Y, oldPosSize.Width, oldPosSize.Height, PosSize.POSSIZE); } }); diff --git a/qadevOOo/tests/java/mod/_dbaccess/ConnectionLineAccessibility.java b/qadevOOo/tests/java/mod/_dbaccess/ConnectionLineAccessibility.java index 27efe8cf0447..c515ffaf8c01 100644 --- a/qadevOOo/tests/java/mod/_dbaccess/ConnectionLineAccessibility.java +++ b/qadevOOo/tests/java/mod/_dbaccess/ConnectionLineAccessibility.java @@ -39,12 +39,12 @@ import com.sun.star.accessibility.AccessibleRole; import com.sun.star.accessibility.XAccessible; import com.sun.star.awt.PosSize; import com.sun.star.awt.Rectangle; -import com.sun.star.awt.XExtendedToolkit; import com.sun.star.awt.XWindow; import com.sun.star.beans.PropertyValue; import com.sun.star.beans.XPropertySet; import com.sun.star.container.XNameAccess; import com.sun.star.container.XNameContainer; +import com.sun.star.frame.XModel; import com.sun.star.frame.XStorable; import com.sun.star.lang.XComponent; import com.sun.star.lang.XMultiServiceFactory; @@ -347,12 +347,8 @@ public class ConnectionLineAccessibility extends TestCase util.utils.shortWait(1000); - XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface( - XExtendedToolkit.class, toolkit); - - Object atw = tk.getActiveTopWindow(); - - xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, atw); + xWindow = UnoRuntime.queryInterface(XModel.class, QueryComponent). + getCurrentController().getFrame().getContainerWindow(); XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow); diff --git a/qadevOOo/tests/java/mod/_dbaccess/JoinViewAccessibility.java b/qadevOOo/tests/java/mod/_dbaccess/JoinViewAccessibility.java index 5644fd3e995e..8ec0c0db1bfa 100644 --- a/qadevOOo/tests/java/mod/_dbaccess/JoinViewAccessibility.java +++ b/qadevOOo/tests/java/mod/_dbaccess/JoinViewAccessibility.java @@ -39,12 +39,12 @@ import com.sun.star.accessibility.AccessibleRole; import com.sun.star.accessibility.XAccessible; import com.sun.star.awt.PosSize; import com.sun.star.awt.Rectangle; -import com.sun.star.awt.XExtendedToolkit; import com.sun.star.awt.XWindow; import com.sun.star.beans.PropertyValue; import com.sun.star.beans.XPropertySet; import com.sun.star.container.XNameAccess; import com.sun.star.container.XNameContainer; +import com.sun.star.frame.XModel; import com.sun.star.frame.XStorable; import com.sun.star.lang.XComponent; import com.sun.star.lang.XMultiServiceFactory; @@ -326,12 +326,8 @@ public class JoinViewAccessibility extends TestCase { QueryComponent = DesktopTools.loadDoc ((XMultiServiceFactory) Param.getMSF (),".component:DB/QueryDesign",loadProps); - XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface ( - XExtendedToolkit.class, toolkit); - - Object atw = tk.getActiveTopWindow (); - - xWindow = (XWindow) UnoRuntime.queryInterface (XWindow.class, atw); + xWindow = UnoRuntime.queryInterface(XModel.class, QueryComponent). + getCurrentController().getFrame().getContainerWindow(); XAccessible xRoot = AccessibilityTools.getAccessibleObject (xWindow); diff --git a/qadevOOo/tests/java/mod/_dbaccess/TableWindowAccessibility.java b/qadevOOo/tests/java/mod/_dbaccess/TableWindowAccessibility.java index 1617f34cbbef..4c39c1590890 100644 --- a/qadevOOo/tests/java/mod/_dbaccess/TableWindowAccessibility.java +++ b/qadevOOo/tests/java/mod/_dbaccess/TableWindowAccessibility.java @@ -39,12 +39,12 @@ import com.sun.star.accessibility.AccessibleRole; import com.sun.star.accessibility.XAccessible; import com.sun.star.accessibility.XAccessibleComponent; import com.sun.star.awt.Point; -import com.sun.star.awt.XExtendedToolkit; import com.sun.star.awt.XWindow; import com.sun.star.beans.PropertyValue; import com.sun.star.beans.XPropertySet; import com.sun.star.container.XNameAccess; import com.sun.star.container.XNameContainer; +import com.sun.star.frame.XModel; import com.sun.star.frame.XStorable; import com.sun.star.lang.XComponent; import com.sun.star.lang.XMultiServiceFactory; @@ -300,12 +300,8 @@ public class TableWindowAccessibility extends TestCase { QueryComponent = DesktopTools.loadDoc((XMultiServiceFactory) Param.getMSF (),".component:DB/QueryDesign",loadProps); - XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface( - XExtendedToolkit.class, toolkit); - - Object atw = tk.getActiveTopWindow(); - - xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, atw); + xWindow = UnoRuntime.queryInterface(XModel.class, QueryComponent). + getCurrentController().getFrame().getContainerWindow(); XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow); diff --git a/qadevOOo/tests/java/mod/_fwk/ModuleUIConfigurationManager.java b/qadevOOo/tests/java/mod/_fwk/ModuleUIConfigurationManager.java index c4a81bb06d8d..7b30a94b3293 100755 --- a/qadevOOo/tests/java/mod/_fwk/ModuleUIConfigurationManager.java +++ b/qadevOOo/tests/java/mod/_fwk/ModuleUIConfigurationManager.java @@ -70,18 +70,21 @@ public class ModuleUIConfigurationManager extends TestCase { */ 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"); + 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"); - xStore.dispose(); + if (xStore != null) { + xStore.dispose(); + } } /** diff --git a/qadevOOo/tests/java/mod/_sd/DrawController_DrawView.java b/qadevOOo/tests/java/mod/_sd/DrawController_DrawView.java index 3243ec48e3c5..be510ff1f98c 100644 --- a/qadevOOo/tests/java/mod/_sd/DrawController_DrawView.java +++ b/qadevOOo/tests/java/mod/_sd/DrawController_DrawView.java @@ -47,7 +47,6 @@ import com.sun.star.drawing.XDrawPagesSupplier; import com.sun.star.drawing.XShape; import com.sun.star.drawing.XShapes; import com.sun.star.frame.XController; -import com.sun.star.frame.XDesktop; import com.sun.star.frame.XFrame; import com.sun.star.frame.XModel; import com.sun.star.lang.XComponent; @@ -87,23 +86,10 @@ import com.sun.star.util.XModifiable; * @see ifc.drawing._XDrawView */ public class DrawController_DrawView extends TestCase { - static XDesktop the_Desk; static XComponent xDrawDoc; static XComponent xSecondDrawDoc; /** - * Creates the instance of the service - * <code>com.sun.star.frame.Desktop</code>. - * @see com.sun.star.frame.Desktop - */ - protected void initialize(TestParameters Param, PrintWriter log) { - the_Desk = (XDesktop) - UnoRuntime.queryInterface( - XDesktop.class, DesktopTools.createDesktop( - (XMultiServiceFactory)Param.getMSF()) ); - } - - /** * Called while disposing a <code>TestEnvironment</code>. * Disposes Impress documents. * @param tParam test parameters @@ -216,9 +202,10 @@ public class DrawController_DrawView extends TestCase { XModel aModel2 = (XModel) UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc); + XController aController2 = aModel2.getCurrentController(); XWindow anotherWindow = (XWindow) UnoRuntime.queryInterface( - XWindow.class,aModel2.getCurrentController()); + XWindow.class, aController2); log.println( "creating a new environment for impress view object" ); TestEnvironment tEnv = new TestEnvironment( oObj ); @@ -276,16 +263,13 @@ public class DrawController_DrawView extends TestCase { tEnv.addObjRelation("XUserInputInterception.XModel", aModel); - XFrame the_frame = the_Desk.getCurrentFrame(); + XFrame the_frame = aController2.getFrame(); tEnv.addObjRelation("Frame", the_frame); - aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc); //Adding ObjRelations for XController - tEnv.addObjRelation("SecondModel", aModel); + tEnv.addObjRelation("SecondModel", aModel2); - XController secondController = aModel.getCurrentController(); - tEnv.addObjRelation("SecondController", secondController); + tEnv.addObjRelation("SecondController", aController2); tEnv.addObjRelation("XDispatchProvider.URL", "slot:27009"); diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBox.java b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBox.java index 4f6d849844d4..358819ee733d 100644 --- a/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBox.java +++ b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBox.java @@ -38,7 +38,6 @@ import util.SOfficeFactory; import com.sun.star.accessibility.AccessibleRole; import com.sun.star.accessibility.XAccessible; -import com.sun.star.awt.XExtendedToolkit; import com.sun.star.awt.XWindow; import com.sun.star.beans.PropertyValue; import com.sun.star.frame.XController; @@ -158,21 +157,9 @@ public class AccessibleBrowseBox extends TestCase { shortWait(); - try { - oObj = (XInterface) ((XMultiServiceFactory) tParam.getMSF()).createInstance("com.sun.star.awt.Toolkit"); - } catch (com.sun.star.uno.Exception e) { - log.println("Couldn't get toolkit"); - e.printStackTrace(log); - throw new StatusException("Couldn't get toolkit", e); - } - - - XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface(XExtendedToolkit.class, oObj); - - AccessibilityTools at = new AccessibilityTools(); - XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, tk.getActiveTopWindow()); + XWindow xWindow = secondController.getFrame().getContainerWindow(); XAccessible xRoot = at.getAccessibleObject(xWindow); diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxHeaderBar.java b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxHeaderBar.java index 45b9d3ed19d3..b953abde994e 100644 --- a/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxHeaderBar.java +++ b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxHeaderBar.java @@ -43,7 +43,6 @@ import com.sun.star.accessibility.AccessibleRole; import com.sun.star.accessibility.XAccessible; import com.sun.star.accessibility.XAccessibleComponent; import com.sun.star.awt.Point; -import com.sun.star.awt.XExtendedToolkit; import com.sun.star.awt.XWindow; import com.sun.star.beans.PropertyValue; import com.sun.star.frame.XController; @@ -204,20 +203,9 @@ public class AccessibleBrowseBoxHeaderBar extends TestCase { XInterface oObj = null; - try { - oObj = (XInterface) ( (XMultiServiceFactory) tParam.getMSF()) - .createInstance("com.sun.star.awt.Toolkit"); - } catch (com.sun.star.uno.Exception e) { - throw new StatusException("Couldn't get toolkit", e); - } - - XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface( - XExtendedToolkit.class, oObj); - AccessibilityTools at = new AccessibilityTools(); - XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, - tk.getActiveTopWindow()); + XWindow xWindow = secondController.getFrame().getContainerWindow(); XAccessible xRoot = at.getAccessibleObject(xWindow); diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxHeaderCell.java b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxHeaderCell.java index be46f92503ee..2e7cb013e2ee 100644 --- a/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxHeaderCell.java +++ b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxHeaderCell.java @@ -40,7 +40,6 @@ import util.SOfficeFactory; import com.sun.star.accessibility.AccessibleRole; import com.sun.star.accessibility.XAccessible; -import com.sun.star.awt.XExtendedToolkit; import com.sun.star.awt.XWindow; import com.sun.star.beans.PropertyValue; import com.sun.star.frame.XController; @@ -202,21 +201,9 @@ public class AccessibleBrowseBoxHeaderCell extends TestCase { throw new StatusException("Could not select Biblio-Database", ex); } - - try { - oObj = (XInterface) ((XMultiServiceFactory)tParam.getMSF()).createInstance - ("com.sun.star.awt.Toolkit"); - } catch (com.sun.star.uno.Exception e) { - throw new StatusException("Couldn't get toolkit", e ); - } - - XExtendedToolkit tk = (XExtendedToolkit) - UnoRuntime.queryInterface(XExtendedToolkit.class, oObj); - AccessibilityTools at = new AccessibilityTools(); - XWindow xWindow = (XWindow) - UnoRuntime.queryInterface(XWindow.class, tk.getActiveTopWindow()); + XWindow xWindow = secondController.getFrame().getContainerWindow(); XAccessible xRoot = at.getAccessibleObject(xWindow); diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxTable.java b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxTable.java index 5c0b40a2c944..6842fd6da8e2 100644 --- a/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxTable.java +++ b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxTable.java @@ -39,7 +39,6 @@ import util.SOfficeFactory; import com.sun.star.accessibility.AccessibleRole; import com.sun.star.accessibility.XAccessible; -import com.sun.star.awt.XExtendedToolkit; import com.sun.star.awt.XWindow; import com.sun.star.beans.PropertyValue; import com.sun.star.frame.XController; @@ -199,22 +198,9 @@ public class AccessibleBrowseBoxTable extends TestCase { XInterface oObj = null; - try { - oObj = (XInterface)((XMultiServiceFactory)tParam.getMSF()) - .createInstance("com.sun.star.awt.Toolkit"); - } catch (com.sun.star.uno.Exception e) { - log.println("Couldn't get toolkit"); - e.printStackTrace(log); - throw new StatusException("Couldn't get toolkit", e); - } - - XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface( - XExtendedToolkit.class, oObj); - AccessibilityTools at = new AccessibilityTools(); - XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, - tk.getActiveTopWindow()); + XWindow xWindow = secondController.getFrame().getContainerWindow(); XAccessible xRoot = at.getAccessibleObject(xWindow); diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxTableCell.java b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxTableCell.java index 83d74f295f4c..973f0bf9c324 100644 --- a/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxTableCell.java +++ b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxTableCell.java @@ -39,7 +39,6 @@ import util.SOfficeFactory; import com.sun.star.accessibility.AccessibleRole; import com.sun.star.accessibility.XAccessible; -import com.sun.star.awt.XExtendedToolkit; import com.sun.star.awt.XWindow; import com.sun.star.beans.PropertyValue; import com.sun.star.frame.XController; @@ -191,26 +190,9 @@ public class AccessibleBrowseBoxTableCell extends TestCase { shortWait(); - try { - oObj = (XInterface) ((XMultiServiceFactory)tParam.getMSF()).createInstance - ("com.sun.star.awt.Toolkit") ; - xInit.initialize(params); - } catch (com.sun.star.uno.Exception e) { - log.println("Couldn't get toolkit"); - e.printStackTrace(log); - throw new StatusException("Couldn't get toolkit", e ); - } - - shortWait(); - - XExtendedToolkit tk = (XExtendedToolkit) - UnoRuntime.queryInterface(XExtendedToolkit.class,oObj); - - AccessibilityTools at = new AccessibilityTools(); - XWindow xWindow = (XWindow) - UnoRuntime.queryInterface(XWindow.class,tk.getActiveTopWindow()); + XWindow xWindow = secondController.getFrame().getContainerWindow(); XAccessible xRoot = at.getAccessibleObject(xWindow); diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleTabBar.java b/qadevOOo/tests/java/mod/_svtools/AccessibleTabBar.java index 903b9341eb2a..c646aa1eaf25 100644 --- a/qadevOOo/tests/java/mod/_svtools/AccessibleTabBar.java +++ b/qadevOOo/tests/java/mod/_svtools/AccessibleTabBar.java @@ -38,8 +38,8 @@ import util.SOfficeFactory; import com.sun.star.accessibility.AccessibleRole; import com.sun.star.accessibility.XAccessible; import com.sun.star.awt.PosSize; -import com.sun.star.awt.XExtendedToolkit; import com.sun.star.awt.XWindow; +import com.sun.star.frame.XModel; import com.sun.star.lang.XComponent; import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.uno.UnoRuntime; @@ -108,23 +108,12 @@ public class AccessibleTabBar extends TestCase { XInterface oObj = null; - try { - oObj = (XInterface) msf.createInstance("com.sun.star.awt.Toolkit"); - } catch (com.sun.star.uno.Exception e) { - log.println("Couldn't get toolkit"); - e.printStackTrace(log); - throw new StatusException("Couldn't get toolkit", e); - } - - XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface( - XExtendedToolkit.class, oObj); - AccessibilityTools at = new AccessibilityTools(); shortWait(); - XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, - tk.getActiveTopWindow()); + XWindow xWindow = UnoRuntime.queryInterface(XModel.class, xDoc). + getCurrentController().getFrame().getContainerWindow(); XAccessible xRoot = at.getAccessibleObject(xWindow); at.printAccessibleTree(log, xRoot, tParam.getBool(util.PropertyName.DEBUG_IS_ACTIVE)); diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleTreeListBox.java b/qadevOOo/tests/java/mod/_svtools/AccessibleTreeListBox.java index 2dfaa15448ad..6134bd1a3aef 100644 --- a/qadevOOo/tests/java/mod/_svtools/AccessibleTreeListBox.java +++ b/qadevOOo/tests/java/mod/_svtools/AccessibleTreeListBox.java @@ -39,7 +39,6 @@ import util.SOfficeFactory; import com.sun.star.accessibility.AccessibleRole; import com.sun.star.accessibility.XAccessible; -import com.sun.star.awt.XExtendedToolkit; import com.sun.star.awt.XWindow; import com.sun.star.beans.PropertyValue; import com.sun.star.frame.XController; @@ -179,22 +178,9 @@ public class AccessibleTreeListBox extends TestCase { XInterface oObj = null; - try { - oObj = (XInterface) ((XMultiServiceFactory)tParam.getMSF()).createInstance - ("com.sun.star.awt.Toolkit") ; - } catch (com.sun.star.uno.Exception e) { - log.println("Couldn't get toolkit"); - e.printStackTrace(log); - throw new StatusException("Couldn't get toolkit", e ); - } - - XExtendedToolkit tk = (XExtendedToolkit) - UnoRuntime.queryInterface(XExtendedToolkit.class, oObj); - AccessibilityTools at = new AccessibilityTools(); - XWindow xWindow = (XWindow) - UnoRuntime.queryInterface(XWindow.class, tk.getActiveTopWindow()); + XWindow xWindow = secondController.getFrame().getContainerWindow(); XAccessible xRoot = at.getAccessibleObject(xWindow); diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleTreeListBoxEntry.java b/qadevOOo/tests/java/mod/_svtools/AccessibleTreeListBoxEntry.java index 7d1014d7ec4d..c4ee3562d720 100644 --- a/qadevOOo/tests/java/mod/_svtools/AccessibleTreeListBoxEntry.java +++ b/qadevOOo/tests/java/mod/_svtools/AccessibleTreeListBoxEntry.java @@ -39,7 +39,6 @@ import util.SOfficeFactory; import com.sun.star.accessibility.AccessibleRole; import com.sun.star.accessibility.XAccessible; -import com.sun.star.awt.XExtendedToolkit; import com.sun.star.awt.XWindow; import com.sun.star.beans.PropertyValue; import com.sun.star.frame.XController; @@ -231,24 +230,11 @@ public class AccessibleTreeListBoxEntry extends TestCase { throw new StatusException("Could not select Biblio-Database", ex); } - - try { - shortWait(); - oObj = (XInterface) ( (XMultiServiceFactory) tParam.getMSF()) - .createInstance("com.sun.star.awt.Toolkit"); - } catch (com.sun.star.uno.Exception e) { - throw new StatusException("Couldn't get toolkit", e); - } - shortWait(); - XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface( - XExtendedToolkit.class, oObj); - AccessibilityTools at = new AccessibilityTools(); - XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, - tk.getActiveTopWindow()); + XWindow xWindow = secondController.getFrame().getContainerWindow(); XAccessible xRoot = at.getAccessibleObject(xWindow); diff --git a/qadevOOo/tests/java/mod/_sw/CharacterStyle.java b/qadevOOo/tests/java/mod/_sw/CharacterStyle.java index d1f9c6018436..4c91540d52c2 100755 --- a/qadevOOo/tests/java/mod/_sw/CharacterStyle.java +++ b/qadevOOo/tests/java/mod/_sw/CharacterStyle.java @@ -55,15 +55,13 @@ import util.utils; * @see com.sun.star.style.CharacterStyle */ public class CharacterStyle extends TestCase { - - XTextDocument xTextDoc; - SOfficeFactory SOF = null; + private XTextDocument xTextDoc; /** * Creates text document. */ protected void initialize( TestParameters tParam, PrintWriter log ) { - SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() ); + SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() ); try { log.println( "creating a textdocument" ); xTextDoc = SOF.createTextDoc( null ); diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleFixedText.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleFixedText.java index e0ad77dfa753..3bc7e81885c3 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleFixedText.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleFixedText.java @@ -34,7 +34,6 @@ import com.sun.star.awt.PosSize; import com.sun.star.awt.XControl; import com.sun.star.awt.XControlContainer; import com.sun.star.awt.XControlModel; -import com.sun.star.awt.XExtendedToolkit; import com.sun.star.awt.XFixedText; import com.sun.star.awt.XWindow; import com.sun.star.lang.XMultiServiceFactory; @@ -150,17 +149,11 @@ public class AccessibleFixedText extends TestCase { throw new StatusException("Couldn't get toolkit", e); } - XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface( - XExtendedToolkit.class, oObj); - shortWait(); AccessibilityTools at = new AccessibilityTools(); - XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, - tk.getActiveTopWindow()); - - XAccessible xRoot = at.getAccessibleObject(xWindow); + XAccessible xRoot = at.getAccessibleObject(xWinDlg); at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE)); diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleMenu.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleMenu.java index d309f8cd969d..4eaec80dcd81 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleMenu.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleMenu.java @@ -31,8 +31,8 @@ import com.sun.star.accessibility.XAccessible; import com.sun.star.accessibility.XAccessibleAction; import com.sun.star.accessibility.XAccessibleContext; import com.sun.star.accessibility.XAccessibleText; -import com.sun.star.awt.XExtendedToolkit; import com.sun.star.awt.XWindow; +import com.sun.star.frame.XModel; import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.text.XTextDocument; import com.sun.star.uno.UnoRuntime; @@ -102,23 +102,10 @@ public class AccessibleMenu extends TestCase { throw new StatusException("Can't create document", e); } - XInterface oObj = null; - - try { - oObj = (XInterface) msf.createInstance("com.sun.star.awt.Toolkit"); - } catch (com.sun.star.uno.Exception e) { - log.println("Couldn't get toolkit"); - e.printStackTrace(log); - throw new StatusException("Couldn't get toolkit", e); - } - - XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface( - XExtendedToolkit.class, oObj); - shortWait(); - XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, - tk.getActiveTopWindow()); + XWindow xWindow = UnoRuntime.queryInterface(XModel.class, xTextDoc). + getCurrentController().getFrame().getContainerWindow(); AccessibilityTools at = new AccessibilityTools(); @@ -127,6 +114,7 @@ public class AccessibleMenu extends TestCase { at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE)); XAccessibleContext menubar = at.getAccessibleObjectForRole(xRoot, AccessibleRole.MENU_BAR); + XInterface oObj = null; Object menu2 = null; try { diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuBar.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuBar.java index 86929c463167..2441bdaa7075 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuBar.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuBar.java @@ -30,8 +30,8 @@ import com.sun.star.accessibility.AccessibleRole; import com.sun.star.accessibility.XAccessible; import com.sun.star.accessibility.XAccessibleAction; import com.sun.star.accessibility.XAccessibleComponent; -import com.sun.star.awt.XExtendedToolkit; import com.sun.star.awt.XWindow; +import com.sun.star.frame.XModel; import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.text.XTextDocument; import com.sun.star.uno.UnoRuntime; @@ -83,34 +83,18 @@ public class AccessibleMenuBar extends TestCase { */ protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) { - XInterface oObj = null; - - try { - oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance( - "com.sun.star.awt.Toolkit"); - } catch (com.sun.star.uno.Exception e) { - log.println("Couldn't get toolkit"); - e.printStackTrace(log); - throw new StatusException("Couldn't get toolkit", e); - } - - XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface( - XExtendedToolkit.class, oObj); - shortWait(); AccessibilityTools at = new AccessibilityTools(); - Object atw = tk.getActiveTopWindow(); - - XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, - atw); + XWindow xWindow = UnoRuntime.queryInterface(XModel.class, xTextDoc). + getCurrentController().getFrame().getContainerWindow(); XAccessible xRoot = at.getAccessibleObject(xWindow); at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE)); - oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.MENU_BAR); + XInterface oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.MENU_BAR); log.println("ImplementationName " + utils.getImplName(oObj)); diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuSeparator.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuSeparator.java index 4c68b532b4b2..f05bcb025803 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuSeparator.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuSeparator.java @@ -32,6 +32,7 @@ import com.sun.star.accessibility.XAccessibleAction; import com.sun.star.accessibility.XAccessibleContext; import com.sun.star.awt.XExtendedToolkit; import com.sun.star.awt.XWindow; +import com.sun.star.frame.XModel; import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.text.XTextDocument; import com.sun.star.uno.UnoRuntime; @@ -82,27 +83,12 @@ public class AccessibleMenuSeparator extends TestCase { */ protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) { - XInterface oObj = null; - - try { - oObj = (XInterface) msf.createInstance("com.sun.star.awt.Toolkit"); - } catch (com.sun.star.uno.Exception e) { - log.println("Couldn't get toolkit"); - e.printStackTrace(log); - throw new StatusException("Couldn't get toolkit", e); - } - - XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface( - XExtendedToolkit.class, oObj); - shortWait(); AccessibilityTools at = new AccessibilityTools(); - Object atw = tk.getActiveTopWindow(); - - XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, - atw); + XWindow xWindow = UnoRuntime.queryInterface(XModel.class, xTextDoc). + getCurrentController().getFrame().getContainerWindow(); XAccessible xRoot = at.getAccessibleObject(xWindow); @@ -110,6 +96,7 @@ public class AccessibleMenuSeparator extends TestCase { XAccessibleContext MenuBar = at.getAccessibleObjectForRole(xRoot, AccessibleRole.MENU_BAR); XAccessibleAction act = null; + XInterface oObj = null; try { //activate Edit-Menu diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleStatusBar.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleStatusBar.java index 432493d9d134..32dd630370a3 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleStatusBar.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleStatusBar.java @@ -32,7 +32,6 @@ import com.sun.star.awt.PosSize; import com.sun.star.awt.Rectangle; import com.sun.star.awt.XExtendedToolkit; import com.sun.star.awt.XWindow; -import com.sun.star.frame.XDesktop; import com.sun.star.frame.XModel; import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.text.XTextDocument; @@ -84,19 +83,9 @@ import util.SOfficeFactory; * @see ifc.accessibility.XAccessibleAction */ public class AccessibleStatusBar extends TestCase { - private static XDesktop the_Desk; private static XTextDocument xTextDoc; /** - * Creates the Desktop service (<code>com.sun.star.frame.Desktop</code>). - */ - protected void initialize(TestParameters Param, PrintWriter log) { - the_Desk = (XDesktop) UnoRuntime.queryInterface(XDesktop.class, - DesktopTools.createDesktop( - (XMultiServiceFactory) Param.getMSF())); - } - - /** * Disposes the document, if exists, created in * <code>createTestEnvironment</code> method. */ @@ -155,16 +144,13 @@ public class AccessibleStatusBar extends TestCase { throw new StatusException("Couldn't create document", e); } - XModel aModel = (XModel) UnoRuntime.queryInterface(XModel.class, - xTextDoc); - XInterface oObj = null; AccessibilityTools at = new AccessibilityTools(); - XWindow xWindow = at.getCurrentContainerWindow( - (XMultiServiceFactory) tParam.getMSF(), - aModel); + final XWindow xWindow = + UnoRuntime.queryInterface(XModel.class, xTextDoc). + getCurrentController().getFrame().getContainerWindow(); XAccessible xRoot = at.getAccessibleObject(xWindow); @@ -180,15 +166,14 @@ public class AccessibleStatusBar extends TestCase { tEnv.addObjRelation("EventProducer", new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() { public void fireEvent() { - XWindow xWin = (XWindow) UnoRuntime.queryInterface( - XWindow.class, tk.getActiveTopWindow()); - Rectangle newPosSize = xWin.getPosSize(); + Rectangle newPosSize = xWindow.getPosSize(); newPosSize.Width = newPosSize.Width - 20; newPosSize.Height = newPosSize.Height - 20; newPosSize.X = newPosSize.X + 20; newPosSize.Y = newPosSize.Y + 20; - xWin.setPosSize(newPosSize.X, newPosSize.Y, newPosSize.Width, - newPosSize.Height, PosSize.POSSIZE); + xWindow.setPosSize( + newPosSize.X, newPosSize.Y, newPosSize.Width, + newPosSize.Height, PosSize.POSSIZE); } }); diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleToolBox.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleToolBox.java index 381ef7571b9f..c02017508695 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleToolBox.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleToolBox.java @@ -47,8 +47,6 @@ import lib.TestParameters; import util.AccessibilityTools; import util.DesktopTools; import util.SOfficeFactory; -import util.UITools; - /** * Test for object that implements the following interfaces : @@ -141,20 +139,10 @@ public class AccessibleToolBox extends TestCase { throw new StatusException("Couldn't create document", e); } - XModel aModel = (XModel) UnoRuntime.queryInterface(XModel.class, - xTextDoc); - XInterface oObj = null; - UITools oUI = new UITools(msf, aModel); - - XWindow xWindow = null; - try { - xWindow = oUI.getActiveTopWindow(); - } catch (Exception ex) { - ex.printStackTrace(log); - throw new StatusException("Couldn't get active top window", ex); - } + XWindow xWindow = UnoRuntime.queryInterface(XModel.class, xTextDoc). + getCurrentController().getFrame().getContainerWindow(); AccessibilityTools at = new AccessibilityTools(); diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoTreeControl.java b/qadevOOo/tests/java/mod/_toolkit/UnoTreeControl.java index 8b6aacee0734..5be41be69f27 100644 --- a/qadevOOo/tests/java/mod/_toolkit/UnoTreeControl.java +++ b/qadevOOo/tests/java/mod/_toolkit/UnoTreeControl.java @@ -220,8 +220,6 @@ public class UnoTreeControl extends TestCase { }); System.out.println("ImplementationName: " + utils.getImplName(oObj)); - //this.getAccessibleContext(xNode); - return tEnv; } // finish method getTestEnvironment @@ -289,26 +287,6 @@ public class UnoTreeControl extends TestCase { } } - private XAccessibleContext getAccessibleContext(XMutableTreeNode xNode ){ - - UITools oDocUITools = new UITools(this.mxMSF, this.xTextDoc); - - XWindow xDialogWindow = null; - try { - - xDialogWindow = oDocUITools.getActiveTopWindow(); - } catch (Exception ex) { - ex.printStackTrace(); - } - - UITools oDialog = new UITools(mxMSF, xDialogWindow); - - oDialog.printAccessibleTree(log, debug); - - return null; - - } - private class execurteDialog extends Thread{ private XDialog mXDialog; |