diff options
Diffstat (limited to 'qadevOOo/tests/java/ifc/ui/dialogs/_XExecutableDialog.java')
-rw-r--r-- | qadevOOo/tests/java/ifc/ui/dialogs/_XExecutableDialog.java | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/qadevOOo/tests/java/ifc/ui/dialogs/_XExecutableDialog.java b/qadevOOo/tests/java/ifc/ui/dialogs/_XExecutableDialog.java index 95e2c27d9895..2d67bedc2d55 100644 --- a/qadevOOo/tests/java/ifc/ui/dialogs/_XExecutableDialog.java +++ b/qadevOOo/tests/java/ifc/ui/dialogs/_XExecutableDialog.java @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -49,10 +49,10 @@ import com.sun.star.util.XCancellable; * @see com.sun.star.ui.dialogs.XExecutableDialog */ public class _XExecutableDialog extends MultiMethodTest { - + public XExecutableDialog oObj = null; private ExecThread eThread = null; - + /** * Test calls the method. <p> * Has <b> OK </b> status if the method successfully returns @@ -62,7 +62,7 @@ public class _XExecutableDialog extends MultiMethodTest { oObj.setTitle("The Title"); tRes.tested("setTitle()",true); } - + /** * This method is excluded from automated test since * we can't close the dialog. <p> @@ -94,25 +94,25 @@ public class _XExecutableDialog extends MultiMethodTest { log.println("XCancellable isn't supported and the "+ "environment is killed hard"); } - - + + } tRes.tested("execute()",result); } - + /** * Calls <code>execute()</code> method in a separate thread. * Necessary to check if this method works */ protected class ExecThread extends Thread { - + public short execRes = (short) 17 ; private XExecutableDialog Diag = null ; - + public ExecThread(XExecutableDialog Diag) { this.Diag = Diag ; } - + public void run() { try { execRes = Diag.execute(); @@ -122,7 +122,7 @@ public class _XExecutableDialog extends MultiMethodTest { } } } - + /** * Sleeps for 5 sec. to allow StarOffice to react on <code> * reset</code> call. @@ -134,14 +134,14 @@ public class _XExecutableDialog extends MultiMethodTest { log.println("While waiting :" + e) ; } } - + public void after() { if (eThread.isAlive()) { log.println("Thread didn't die ... cleaning up"); disposeEnvironment(); } } - + private void closeDialog() { XCancellable canc = (XCancellable) UnoRuntime.queryInterface( XCancellable.class, tEnv.getTestObject()); @@ -151,19 +151,19 @@ public class _XExecutableDialog extends MultiMethodTest { } else { this.disposeEnvironment(); } - + long st = System.currentTimeMillis(); boolean toLong = false; - + log.println("waiting for dialog to close"); - + while (eThread.isAlive() && !toLong) { //wait for dialog to close toLong = (System.currentTimeMillis()-st > 10000); } - + log.println("done"); - + try { if (eThread.isAlive()) { log.println("Interrupting Thread"); @@ -173,23 +173,23 @@ public class _XExecutableDialog extends MultiMethodTest { } catch (Exception e) { // who cares ;-) } - + st = System.currentTimeMillis(); toLong = false; - + log.println("waiting for interruption to work"); - + while (eThread.isAlive() && !toLong) { //wait for dialog to close toLong = (System.currentTimeMillis()-st > 10000); } - + log.println("DialogThread alive: "+eThread.isAlive()); - + log.println("done"); - + } - + } |