summaryrefslogtreecommitdiff
path: root/jurt
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2003-08-13 16:22:50 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2003-08-13 16:22:50 +0000
commit4e9e98942aa07da50f795397ca921b9e3844da5b (patch)
treea14ac393ebe81270de33061fec76100056c2908a /jurt
parent30968092668b4547567af617802c7a8c7937f2a4 (diff)
INTEGRATION: CWS sb7 (1.7.10); FILE MERGED
2003/08/06 14:10:14 sb 1.7.10.1: #111153# Made waiting for gc more reliable.
Diffstat (limited to 'jurt')
-rw-r--r--jurt/test/com/sun/star/lib/uno/bridges/java_remote/java_remote_bridge_Test.java23
1 files changed, 13 insertions, 10 deletions
diff --git a/jurt/test/com/sun/star/lib/uno/bridges/java_remote/java_remote_bridge_Test.java b/jurt/test/com/sun/star/lib/uno/bridges/java_remote/java_remote_bridge_Test.java
index 76e041a267aa..9645fc018b59 100644
--- a/jurt/test/com/sun/star/lib/uno/bridges/java_remote/java_remote_bridge_Test.java
+++ b/jurt/test/com/sun/star/lib/uno/bridges/java_remote/java_remote_bridge_Test.java
@@ -2,9 +2,9 @@
*
* $RCSfile: java_remote_bridge_Test.java,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: vg $ $Date: 2003-05-22 09:11:39 $
+ * last change: $Author: hr $ $Date: 2003-08-13 17:22:50 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -74,6 +74,7 @@ import com.sun.star.uno.Type;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XInterface;
import complexlib.ComplexTestCase;
+import util.WaitUnreachable;
public final class java_remote_bridge_Test extends ComplexTestCase {
public String getTestObjectName() {
@@ -188,16 +189,18 @@ public final class java_remote_bridge_Test extends ComplexTestCase {
assure("bridge B life count", bridgeB.getLifeCount() == 2 * COUNT);
assure("proxy count", ProxyFactory.getDebugCount() == 2 * COUNT);
- System.out.println("waiting for gc to clear all proxies");
- proxyBXInterface = null;
- proxyBTestInterface = null;
- while (ProxyFactory.getDebugCount() > 0)
- {
- System.gc();
- System.runFinalization();
- byte[] bytes = new byte[1024];
+ System.out.println("waiting for proxies to become unreachable:");
+ for (int i = 0; i < COUNT; ++i) {
+ WaitUnreachable u1 = new WaitUnreachable(proxyBXInterface[i]);
+ WaitUnreachable u2 = new WaitUnreachable(proxyBTestInterface[i]);
+ proxyBXInterface[i] = null;
+ proxyBTestInterface[i] = null;
+ u1.waitUnreachable();
+ u2.waitUnreachable();
}
+ assure("proxy count", ProxyFactory.getDebugCount() == 0);
+
System.out.println("waiting for pending messages to be done");
while (bridgeB.getProtocol().getRequestsSendCount()
> bridgeA.getProtocol().getRequestsReceivedCount()) {