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.
This commit is contained in:
parent
3096809266
commit
4e9e98942a
1 changed files with 13 additions and 10 deletions
|
@ -2,9 +2,9 @@
|
||||||
*
|
*
|
||||||
* $RCSfile: java_remote_bridge_Test.java,v $
|
* $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
|
* The Contents of this file are made available subject to the terms of
|
||||||
* either of the following licenses
|
* 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.UnoRuntime;
|
||||||
import com.sun.star.uno.XInterface;
|
import com.sun.star.uno.XInterface;
|
||||||
import complexlib.ComplexTestCase;
|
import complexlib.ComplexTestCase;
|
||||||
|
import util.WaitUnreachable;
|
||||||
|
|
||||||
public final class java_remote_bridge_Test extends ComplexTestCase {
|
public final class java_remote_bridge_Test extends ComplexTestCase {
|
||||||
public String getTestObjectName() {
|
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("bridge B life count", bridgeB.getLifeCount() == 2 * COUNT);
|
||||||
assure("proxy count", ProxyFactory.getDebugCount() == 2 * COUNT);
|
assure("proxy count", ProxyFactory.getDebugCount() == 2 * COUNT);
|
||||||
|
|
||||||
System.out.println("waiting for gc to clear all proxies");
|
System.out.println("waiting for proxies to become unreachable:");
|
||||||
proxyBXInterface = null;
|
for (int i = 0; i < COUNT; ++i) {
|
||||||
proxyBTestInterface = null;
|
WaitUnreachable u1 = new WaitUnreachable(proxyBXInterface[i]);
|
||||||
while (ProxyFactory.getDebugCount() > 0)
|
WaitUnreachable u2 = new WaitUnreachable(proxyBTestInterface[i]);
|
||||||
{
|
proxyBXInterface[i] = null;
|
||||||
System.gc();
|
proxyBTestInterface[i] = null;
|
||||||
System.runFinalization();
|
u1.waitUnreachable();
|
||||||
byte[] bytes = new byte[1024];
|
u2.waitUnreachable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assure("proxy count", ProxyFactory.getDebugCount() == 0);
|
||||||
|
|
||||||
System.out.println("waiting for pending messages to be done");
|
System.out.println("waiting for pending messages to be done");
|
||||||
while (bridgeB.getProtocol().getRequestsSendCount()
|
while (bridgeB.getProtocol().getRequestsSendCount()
|
||||||
> bridgeA.getProtocol().getRequestsReceivedCount()) {
|
> bridgeA.getProtocol().getRequestsReceivedCount()) {
|
||||||
|
|
Loading…
Reference in a new issue