test/java/rmi/transport/checkLeaseInfoLeak/CheckLeaseLeak.java

Print this page

        

*** 27,36 **** --- 27,37 ---- * * @author Laird Dornin * * @library ../../testlibrary * @build CheckLeaseLeak CheckLeaseLeak_Stub LeaseLeakClient LeaseLeak + * @build TestLibrary * @run main/othervm/timeout=240 CheckLeaseLeak * */ /**
*** 55,65 **** import java.io.*; import java.lang.reflect.*; import java.rmi.registry.*; public class CheckLeaseLeak extends UnicastRemoteObject implements LeaseLeak { - public CheckLeaseLeak() throws RemoteException { } public void ping () throws RemoteException { } /** * Id to fake the DGC_ID, so we can later get a reference to the --- 56,65 ----
*** 85,107 **** TestLibrary.setInteger("java.rmi.dgc.leaseValue", LEASE_VALUE); try { Registry registry = ! java.rmi.registry.LocateRegistry. ! createRegistry(TestLibrary.REGISTRY_PORT); leakServer = new CheckLeaseLeak(); registry.rebind("/LeaseLeak", leakServer); /* create a bunch of clients in a *different* vm */ for (int i = 0 ; i < ITERATIONS ; i ++ ) { System.err.println("Created client: " + i); JavaVM jvm = new JavaVM("LeaseLeakClient", " -Djava.security.policy=" + ! TestParams.defaultPolicy, ""); jvm.start(); if (jvm.getVM().waitFor() == 1 ) { TestLibrary.bomb("Client process failed"); } --- 85,110 ---- TestLibrary.setInteger("java.rmi.dgc.leaseValue", LEASE_VALUE); try { Registry registry = ! TestLibrary.createRegistryOnUnusedPort(); ! int registryPort = TestLibrary.getRegistryPort(registry); leakServer = new CheckLeaseLeak(); registry.rebind("/LeaseLeak", leakServer); /* create a bunch of clients in a *different* vm */ for (int i = 0 ; i < ITERATIONS ; i ++ ) { System.err.println("Created client: " + i); JavaVM jvm = new JavaVM("LeaseLeakClient", " -Djava.security.policy=" + ! TestParams.defaultPolicy + ! " -Drmi.registry.port=" + ! registryPort, ! ""); jvm.start(); if (jvm.getVM().waitFor() == 1 ) { TestLibrary.bomb("Client process failed"); }