summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsb <sb@openoffice.org>2010-02-24 11:21:30 +0100
committersb <sb@openoffice.org>2010-02-24 11:21:30 +0100
commitb47b8e7e111186e6bdb3bc4e0188cddae04e6c62 (patch)
tree551badc888b8d80f4debde1dd9330dc0b7425a24
parentda8aa753c03c345ce205a14ea02e94fb7e897d61 (diff)
sb118: #i80788# fixed Toolkit test
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XMessageBoxFactory.java33
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XToolkit.java5
2 files changed, 26 insertions, 12 deletions
diff --git a/qadevOOo/tests/java/ifc/awt/_XMessageBoxFactory.java b/qadevOOo/tests/java/ifc/awt/_XMessageBoxFactory.java
index 614e5cf091c8..0816a0defeaa 100644
--- a/qadevOOo/tests/java/ifc/awt/_XMessageBoxFactory.java
+++ b/qadevOOo/tests/java/ifc/awt/_XMessageBoxFactory.java
@@ -33,11 +33,12 @@ package ifc.awt;
import com.sun.star.awt.Rectangle;
import com.sun.star.awt.XWindowPeer;
import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
import lib.MultiMethodTest;
+import com.sun.star.awt.XMessageBox;
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;
@@ -56,7 +57,6 @@ public class _XMessageBoxFactory extends MultiMethodTest {
public XMessageBoxFactory oObj = null;
private XWindowPeer the_win = null;
- private XModel xModel = null;
/**
* Retrieves object relation.
@@ -66,10 +66,6 @@ public class _XMessageBoxFactory extends MultiMethodTest {
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")) ;
-
}
@@ -83,9 +79,15 @@ public class _XMessageBoxFactory extends MultiMethodTest {
new Runnable() {
public void run() {
Rectangle rect = new Rectangle(0,0,100,100);
- oObj.createMessageBox(the_win, rect, "errorbox", 1, "The Title", "The Message") ;
+ XMessageBox mb = oObj.createMessageBox(the_win, rect, "errorbox", 1, "The Title", "The Message") ;
+ synchronized (this) {
+ messageBox = mb;
+ notifyAll();
+ }
+ mb.execute();
}
}) ;
+ private XMessageBox messageBox = null;
/**
@@ -109,12 +111,19 @@ public class _XMessageBoxFactory extends MultiMethodTest {
}
result &= execThread.isAlive() ;
- UITools oUITools = new UITools((XMultiServiceFactory) tParam.getMSF(), xModel);
-
- XWindow xWindow = null;
+ synchronized (execThread) {
+ while (messageBox == null) {
+ try {
+ execThread.wait();
+ } catch (InterruptedException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+ UITools oUITools = new UITools(
+ (XMultiServiceFactory) tParam.getMSF(),
+ UnoRuntime.queryInterface(XWindow.class, messageBox));
try{
- xWindow = oUITools.getActiveTopWindow();
-
oUITools.printAccessibleTree(log, tParam.getBool("DebugIsActive"));
oUITools.clickButton("OK");
diff --git a/qadevOOo/tests/java/ifc/awt/_XToolkit.java b/qadevOOo/tests/java/ifc/awt/_XToolkit.java
index ca0d5d3c3fa4..c78847b3e642 100644
--- a/qadevOOo/tests/java/ifc/awt/_XToolkit.java
+++ b/qadevOOo/tests/java/ifc/awt/_XToolkit.java
@@ -38,6 +38,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>
@@ -90,6 +92,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) {
@@ -114,6 +117,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) {