summaryrefslogtreecommitdiff
path: root/qadevOOo/tests/java/ifc/awt/_XMessageBoxFactory.java
diff options
context:
space:
mode:
Diffstat (limited to 'qadevOOo/tests/java/ifc/awt/_XMessageBoxFactory.java')
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XMessageBoxFactory.java30
1 files changed, 16 insertions, 14 deletions
diff --git a/qadevOOo/tests/java/ifc/awt/_XMessageBoxFactory.java b/qadevOOo/tests/java/ifc/awt/_XMessageBoxFactory.java
index c4e80ee8a1d7..9c96506938da 100644
--- a/qadevOOo/tests/java/ifc/awt/_XMessageBoxFactory.java
+++ b/qadevOOo/tests/java/ifc/awt/_XMessageBoxFactory.java
@@ -61,48 +61,50 @@ public class _XMessageBoxFactory extends MultiMethodTest {
final UITools tools = new UITools(
(XMultiServiceFactory) tParam.getMSF(),
UnoRuntime.queryInterface(XWindow.class, mb));
- final State[] state = new State[] { State.NONE };
+ final boolean[] done = new boolean[] { false };
+ final boolean[] good = new boolean[] { false };
XRequestCallback async = AsyncCallback.create(
tParam.getComponentContext());
async.addCallback(
new XCallback() {
public void notify(Object aData) {
mb.execute();
+ synchronized (done) {
+ done[0] = true;
+ done.notifyAll();
+ }
}
},
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;
+ throw new RuntimeException(e);
}
- synchronized (state) {
- state[0] = ok ? State.GOOD : State.BAD;
- state.notifyAll();
+ synchronized (good) {
+ good[0] = true;
}
}
},
Any.VOID);
- boolean ok;
- synchronized (state) {
- while (state[0] == State.NONE) {
+ synchronized (done) {
+ while (!done[0]) {
try {
- state.wait();
+ done.wait();
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
- ok = state[0] == State.GOOD;
+ }
+ boolean ok;
+ synchronized (good) {
+ ok = good[0];
}
tRes.tested("createMessageBox()", ok);
}
-
- private enum State { NONE, GOOD, BAD };
}