InvocationConstraint[] server1;
InvocationConstraint[] server2;
FakeObjectEndpoint oe1 = new FakeObjectEndpoint();
FakeObjectEndpoint oe2 = new FakeTrustedObjectEndpoint(false);
FakeObjectEndpoint oe3 = new FakeTrustedObjectEndpoint(true);
BasicInvocationHandler handler1;
BasicInvocationHandler handler2;
TrustEquivalence proxy1;
TrustEquivalence proxy2;
for (int i = 0; i < cases.length; i++) {
proxyInterfaces1 = (Class[])cases[i][0];
client1 = (InvocationConstraint[])cases[i][1];
server1 = (InvocationConstraint[])cases[i][2];
for (int j = 0; j < cases.length; j++) {
proxyInterfaces2 = (Class[])cases[j][0];
client2 = (InvocationConstraint[])cases[j][1];
server2 = (InvocationConstraint[])cases[j][2];
logger.log(Level.FINE,"=================================");
logger.log(Level.FINE,"test case " + (counter++) + ": "
+ "i=" + i + ",j=" + j
+ ",ObjectEndpoint doesn't implement TrustEquivalence");
logger.log(Level.FINE,"");
handler1 = newHandler(oe1,client1,server1);
handler2 = newHandler(oe1,client2,server2);
proxy1 = newProxy(proxyInterfaces1,handler1);
proxy2 = newProxy(proxyInterfaces2,handler2);
// verify BasicInvocationHandler.invoke test cases
assertion(! proxy1.checkTrustEquivalence(proxy2));
assertion(! proxy2.checkTrustEquivalence(proxy1));
// verify BasicInvocationHandler test cases
assertion(! handler1.checkTrustEquivalence(handler2));
assertion(! handler2.checkTrustEquivalence(handler1));
logger.log(Level.FINE,"=================================");
logger.log(Level.FINE,"test case " + (counter++) + ": "
+ "i=" + i + ",j=" + j
+",ObjectEndpoint.checkTrustEquivalence returns false");
logger.log(Level.FINE,"");
handler1 = newHandler(oe2,client1,server1);
handler2 = newHandler(oe2,client2,server2);
proxy1 = newProxy(proxyInterfaces1,handler1);
proxy2 = newProxy(proxyInterfaces2,handler2);
// verify BasicInvocationHandler.invoke test cases
assertion(! proxy1.checkTrustEquivalence(proxy2));
assertion(! proxy2.checkTrustEquivalence(proxy1));
// verify BasicInvocationHandler test cases
assertion(! handler1.checkTrustEquivalence(handler2));
assertion(! handler2.checkTrustEquivalence(handler1));
logger.log(Level.FINE,"=================================");
logger.log(Level.FINE,"test case " + (counter++) + ": "
+ "i=" + i + ",j=" + j
+ ",ObjectEndpoint.checkTrustEquivalence returns true");
logger.log(Level.FINE,"");
handler1 = newHandler(oe3,client1,server1);
handler2 = newHandler(oe3,client2,server2);
proxy1 = newProxy(proxyInterfaces1,handler1);
proxy2 = newProxy(proxyInterfaces2,handler2);
if (i == j) {
// verify BasicInvocationHandler.invoke test cases
assertion(proxy1.checkTrustEquivalence(proxy2));
assertion(proxy2.checkTrustEquivalence(proxy1));
// verify BasicInvocationHandler test cases
assertion(handler1.checkTrustEquivalence(handler2));
assertion(handler2.checkTrustEquivalence(handler1));
} else {
// verify BasicInvocationHandler.invoke test cases
assertion(! proxy1.checkTrustEquivalence(proxy2));
assertion(! proxy2.checkTrustEquivalence(proxy1));
// verify BasicInvocationHandler test cases
assertion(! handler1.checkTrustEquivalence(handler2));
assertion(! handler2.checkTrustEquivalence(handler1));
}
}//inner for loop
}//outer for loop
}