/**
* This method performs all actions mentioned in class description.
*
*/
public void run() throws Exception {
IiopExporter ie1 = createIiopExporter();
TestRemoteObject tro = new TestRemoteObject();
ie1.export(tro);
logger.log(Level.FINE,
"Invoke unexport method of constructed"
+ " IiopExporter1 with 'true' value...");
boolean uRes = ie1.unexport(true);
if (!uRes) {
// FAIL
throw new TestException(
"performed unexport method invocation of constructed "
+ "IiopExporter1 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"
+ " IiopExporter1 with 'true' value again...");
uRes = ie1.unexport(true);
if (!uRes) {
// FAIL
throw new TestException(
"performed unexport method invocation of constructed "
+ "IiopExporter1 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"
+ " IiopExporter1 with 'false' value...");
uRes = ie1.unexport(false);
if (!uRes) {
// FAIL
throw new TestException(
"performed unexport method invocation of constructed "
+ "IiopExporter1 with 'false' value has returned false "
+ "while true is expected.");
} else {
// PASS
logger.log(Level.FINE, "Method returned true as expected.");
}
IiopExporter ie2 = createIiopExporter();
ie2.export(tro);
logger.log(Level.FINE,
"Invoke unexport method of constructed"
+ " IiopExporter2 with 'false' value...");
uRes = ie2.unexport(false);
if (!uRes) {
// FAIL
throw new TestException(
"performed unexport method invocation of constructed "
+ "IiopExporter2 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"
+ " IiopExporter2 with 'false' value again...");
uRes = ie2.unexport(false);
if (!uRes) {
// FAIL
throw new TestException(
"performed unexport method invocation of constructed "
+ "IiopExporter2 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"
+ " IiopExporter2 with 'true' value...");
uRes = ie2.unexport(true);
if (!uRes) {
// FAIL
throw new TestException(
"performed unexport method invocation of constructed "
+ "IiopExporter2 with 'true' value has returned false "
+ "while true is expected.");
} else {
// PASS
logger.log(Level.FINE, "Method returned true as expected.");
}
IiopExporter ie3 = createIiopExporter();
TestRemoteInterface stub = (TestRemoteInterface) ie3.export(tro);
// bind stub to the ORB manually if needed
if ((cType == NOARG_FACTORY) || useNullOrb) {
connectStub(stub);
}
Unexporter u = new Unexporter(ie3, false);
logger.log(Level.FINE,
"Start thread which will invoke unexport method"
+ " of constructed IiopExporter3 with 'false' value...");
u.start();
stub.wait(new Integer(5000));
uRes = u.getResult();
if (!uRes) {
// FAIL
throw new TestException(
"performed unexport method invocation of constructed "
+ "IiopExporter3 with 'false' value while remote "
+ "call is in progress has returned false "
+ "while true is expected.");
} else {
// PASS
logger.log(Level.FINE, "Method returned true as expected.");
}
IiopExporter ie4 = createIiopExporter();
stub = (TestRemoteInterface) ie4.export(tro);
// bind stub to the ORB manually if needed
if ((cType == NOARG_FACTORY) || useNullOrb) {
connectStub(stub);
}