/**
* This method performs all actions mentioned in class description.
*
*/
public void run() throws Exception {
JrmpExporter je1 = createJrmpExporter();
TestRemoteObject tro = new TestRemoteObject();
je1.export(tro);
logger.log(Level.FINE,
"Invoke unexport method of constructed"
+ " JrmpExporter1 with 'true' value...");
boolean uRes = je1.unexport(true);
if (!uRes) {
// FAIL
throw new TestException(
"performed unexport method invocation of constructed "
+ "JrmpExporter1 with 'true' value has returned false "
+ "while true is expected.");
} else {
// PASS
logger.log(Level.FINE, "Method returned true as expected.");
}
logger.log(Level.FINE,
"Invoke unexport method of constructed"
+ " JrmpExporter1 with 'true' value again...");
uRes = je1.unexport(true);
if (!uRes) {
// FAIL
throw new TestException(
"performed unexport method invocation of constructed "
+ "JrmpExporter1 with 'true' value again has returned "
+ "false while true is expected.");
} else {
// PASS
logger.log(Level.FINE, "Method returned true as expected.");
}
logger.log(Level.FINE,
"Invoke unexport method of constructed"
+ " JrmpExporter1 with 'false' value...");
uRes = je1.unexport(false);
if (!uRes) {
// FAIL
throw new TestException(
"performed unexport method invocation of constructed "
+ "JrmpExporter1 with 'false' value has returned false "
+ "while true is expected.");
} else {
// PASS
logger.log(Level.FINE, "Method returned true as expected.");
}
JrmpExporter je2 = createJrmpExporter();
je2.export(tro);
logger.log(Level.FINE,
"Invoke unexport method of constructed"
+ " JrmpExporter2 with 'false' value...");
uRes = je2.unexport(false);
if (!uRes) {
// FAIL
throw new TestException(
"performed unexport method invocation of constructed "
+ "JrmpExporter2 with 'false' value has returned false "
+ "while true is expected.");
} else {
// PASS
logger.log(Level.FINE, "Method returned true as expected.");
}
logger.log(Level.FINE,
"Invoke unexport method of constructed"
+ " JrmpExporter2 with 'false' value again...");
uRes = je2.unexport(false);
if (!uRes) {
// FAIL
throw new TestException(
"performed unexport method invocation of constructed "
+ "JrmpExporter2 with 'false' value again has returned "
+ "false while true is expected.");
} else {
// PASS
logger.log(Level.FINE, "Method returned true as expected.");
}
logger.log(Level.FINE,
"Invoke unexport method of constructed"
+ " JrmpExporter2 with 'true' value...");
uRes = je2.unexport(true);
if (!uRes) {
// FAIL
throw new TestException(
"performed unexport method invocation of constructed "
+ "JrmpExporter2 with 'true' value has returned false "
+ "while true is expected.");
} else {
// PASS
logger.log(Level.FINE, "Method returned true as expected.");
}
JrmpExporter je3 = createJrmpExporter();
TestRemoteInterface stub = (TestRemoteInterface) je3.export(tro);
Unexporter u = new Unexporter(je3, false);
logger.log(Level.FINE,
"Start thread which will invoke unexport method"
+ " of constructed JrmpExporter3 with 'false' value...");
u.start();