* This method performs all actions mentioned in class description.
*
*/
public void run() throws Exception {
BaseExporter me = new UnexportTrueExporter();
BaseExporter be = new UnexportSameExporter();
ProxyTrustExporter pte = createPTE(me, be);
boolean res = pte.unexport(true);
logger.fine("Called unexport(true) method.");
if (me.getUnexpNum() != 1) {
// FAIL
throw new TestException(
"Unexport method of mainExporter was called "
+ me.getUnexpNum() + " times while 1 was expected.");
}
// PASS
logger.fine("Unexport method of mainExporter was called 1 "
+ "time as expected.");
if (be.getUnexpNum() != 1) {
// FAIL
throw new TestException(
"Unexport method of bootExporter was called "
+ be.getUnexpNum() + " times while 1 was expected.");
}
// PASS
logger.fine("Unexport method of bootExporter was called 1 "
+ "time as expected.");
if (!res) {
// FAIL
throw new TestException(
"Unexport method of ProxyTrustExporter returned "
+ "false while true was expected.");
}
// PASS
logger.fine("Unexport method of ProxyTrustExporter returned "
+ "true as expected.");
me.resetCounters();
be.resetCounters();
res = pte.unexport(false);
logger.fine("Called unexport(false) method.");
if (me.getUnexpNum() != 1) {
// FAIL
throw new TestException(
"Unexport method of mainExporter was called "
+ me.getUnexpNum() + " times while 1 was expected.");
}
// PASS
logger.fine("Unexport method of mainExporter was called 1 "
+ "time as expected.");
if (be.getUnexpNum() != 1) {
// FAIL
throw new TestException(
"Unexport method of bootExporter was called "
+ be.getUnexpNum() + " times while 1 was expected.");
}
// PASS
logger.fine("Unexport method of bootExporter was called 1 "
+ "time as expected.");
if (!res) {
// FAIL
throw new TestException(
"Unexport method of ProxyTrustExporter returned "
+ "false while true was expected.");
}
// PASS
logger.fine("Unexport method of ProxyTrustExporter returned "
+ "true as expected.");
me = new UnexportSameExporter();
be = new UnexportTrueExporter();
pte = createPTE(me, be);
res = pte.unexport(false);
logger.fine("Called unexport(false) method.");
if (me.getUnexpNum() != 1) {
// FAIL
throw new TestException(
"Unexport method of mainExporter was called "
+ me.getUnexpNum() + " times while 1 was expected.");
}
// PASS
logger.fine("Unexport method of mainExporter was called 1 "
+ "time as expected.");
if (be.getUnexpNum() != 0) {
// FAIL
throw new TestException(
"Unexport method of bootExporter was called "
+ be.getUnexpNum() + " times while 0 was expected.");
}
// PASS
logger.fine("Unexport method of bootExporter was not called "
+ "as expected.");