* If some error occurs.
*/
private void test0(int configServer, boolean endorsedServer,
int configClient, boolean endorsedClient, int configRegistry,
boolean endorsedRegistry) throws Exception {
SubProcess registry = null;
SubProcess server = null;
SubProcess client = null;
try {
System.out.println("test0: creating registry");
registry = startProcess("org.apache.harmony.rmi.DGCTest",
REGISTRY_ID, configRegistry, endorsedRegistry);
registry.pipeError();
System.out.println("test0: Expecting READY from registry");
registry.expect();
registry.pipeInput();
System.out.println("test0: starting server");
server = startProcess("org.apache.harmony.rmi.DGCTest",
SERVER_ID_0, configServer, endorsedServer);
server.pipeError();
server.closeOutput();
System.out.println("test0: Expecting READY from server");
server.expect();
System.out.println("test0: starting client");
client = startProcess("org.apache.harmony.rmi.DGCTest",
CLIENT_ID_0, configClient, endorsedClient);
client.pipeInput();
client.pipeError();
client.closeOutput();
System.out.println("test0: Expecting STARTED from server");
server.expect("TestObject.test1() started");
server.pipeInput();
System.out.println("test0: destroying registry");
registry.destroy();
System.out.println("test0: destroying client");
client.destroy();
System.out.println("test0: waiting for server to return");
assertEquals("Test server return", 0, server.waitFor());
} finally {
if (registry != null) {
registry.destroy();
}
if (client != null) {
client.destroy();
}
if (server != null) {
server.destroy();
}
}