diff options
author | sb <sb@openoffice.org> | 2010-02-26 17:03:57 +0100 |
---|---|---|
committer | sb <sb@openoffice.org> | 2010-02-26 17:03:57 +0100 |
commit | dd4389dc3fad63cc42e9320c855d0c69f4dee2b4 (patch) | |
tree | 2696ba54262d734913ec9a7dfe38793e666c4eeb /qadevOOo | |
parent | 87b410ab0055092a24de0f950f563fa2aa33d584 (diff) |
sb118: improved tests (no getActiveTopWindow etc.)
Diffstat (limited to 'qadevOOo')
22 files changed, 76 insertions, 311 deletions
diff --git a/qadevOOo/runner/util/UITools.java b/qadevOOo/runner/util/UITools.java index 992458ca5..4edf4c609 100644 --- a/qadevOOo/runner/util/UITools.java +++ b/qadevOOo/runner/util/UITools.java @@ -673,26 +673,6 @@ public class UITools { throw new Exception("Could not get message from Basic-MessageBox: " + e.toString()); } } - - - /** - * 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> diff --git a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleComponent.java b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleComponent.java index 8fa8692fd..958d70304 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/sheet/_XRangeSelection.java b/qadevOOo/tests/java/ifc/sheet/_XRangeSelection.java index d96fdcb1d..9af63c122 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 b0c6c313a..c59a731d8 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"); @@ -114,16 +112,10 @@ public class AccessibleShape extends TestCase { e.printStackTrace(log); 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 f720cff78..c2494f6c0 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 6e034f51d..b882e0242 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 d13cf4531..7b5827a24 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/_svtools/AccessibleBrowseBox.java b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBox.java index b21788648..f21ac75da 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 d4afcdef9..e7efa1769 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 6d153db9b..a59cf21fd 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; @@ -201,22 +200,10 @@ public class AccessibleBrowseBoxHeaderCell extends TestCase { } catch (com.sun.star.lang.IllegalArgumentException ex) { 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 bac7ad220..8ee05967b 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 deaf5bcb7..549ef0a91 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 9f26e14ec..a6a951859 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 981b36264..e393b2c57 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 08b8b36f0..47554e907 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; @@ -230,25 +229,12 @@ public class AccessibleTreeListBoxEntry extends TestCase { } catch (com.sun.star.lang.IllegalArgumentException ex) { 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/_toolkit/AccessibleFixedText.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleFixedText.java index 9f572368c..5fafb21fb 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 4e862389e..d9da588e2 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 0ea70c6fa..b0fcb29cf 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 295deab4e..77d5cf198 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 6e7a84ee0..0f6cca0ed 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 f362985cb..ed352e6e7 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 1afdefecf..4a8dc0380 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; |