public void run() throws Exception {
RemoteMethodControl main = createValidMainProxy();
ProxyTrust boot = createValidBootProxy();
ProxyTrustInvocationHandler ptih = createPTIH(main, boot);
Object proxy = ProxyTrustUtil.newProxyInstance(
new Interface1TEImpl(), ptih);
Method m = TrustEquivalence.class.getDeclaredMethod(
"checkTrustEquivalence", new Class[] { Object.class });
TestClassLoader cl = new TestClassLoader();
Object[] args = new Object[] {
ProxyTrustUtil.newProxyInstance(new Interface1Impl(), ptih),
ProxyTrustUtil.newProxyInstance(new Interface2TEImpl(), ptih),
ProxyTrustUtil.newProxyInstance(new Interface12TEImpl(), ptih),
ProxyTrustUtil.newProxyInstance(new TEImpl(), ptih),
ProxyTrustUtil.newProxyInstance(new Interface1TEImpl()),
ProxyTrustUtil.newProxyInstance(new Interface1TEImpl(), ptih, cl),
proxy };
boolean[] expRes = new boolean[] {
false, false, false, false, false, true, true };
Object res;
for (int i = 0; i < args.length; ++i) {
res = ptihInvoke(ptih, proxy, m, new Object[] { args[i] });
if (!isOk(res, expRes[i])) {
// FAIL
throw new TestException(
"'invoke' method of constructed "
+ "ProxyTrustInvocationHandler returned " + res
+ ", while Boolean(" + expRes[i]
+ ") was expected.");
}
}
proxy = ProxyTrustUtil.newProxyInstance(new TEImpl(), ptih);
args = new Object[] {
ProxyTrustUtil.newProxyInstance(new Interface1TEImpl(), ptih),
ProxyTrustUtil.newProxyInstance(new TEImpl()),
ProxyTrustUtil.newProxyInstance(new TEImpl(), ptih, cl),
proxy };
expRes = new boolean[] { false, false, true, true };