*
*/
public void run() throws Exception {
RemoteMethodControl main = createValidMainProxy();
ProxyTrust boot = createValidBootProxy();
ProxyTrustInvocationHandler ptih = createPTIH(main, boot);
Object proxy = ProxyTrustUtil.newProxyInstance(new NPIImpl(), ptih);
Method m = NonPublicInterface.class.getDeclaredMethod(
"test", new Class[0]);
Object res = null;
try {
ptihInvoke(ptih, proxy, m, null);
// FAIL
throw new TestException(
"'invoke' invocation of ProxyTrustInvocationHandler "
+ "did not throw any exception while "
+ "IllegalArgumentException was expected.");
} catch (IllegalArgumentException iae) {
// PASS
logger.fine("'invoke' invocation of "
+ "ProxyTrustInvocationHandler threw " + iae
+ " as expected.");
}
proxy = new RMCImpl();
m = RemoteMethodControl.class.getDeclaredMethod(
"setConstraints", new Class[] { MethodConstraints.class });
MethodConstraints mc = new BasicMethodConstraints(
new InvocationConstraints(
new InvocationConstraint[] { ClientAuthentication.YES },
null));
try {
ptihInvoke(ptih, proxy, m, new Object[] { mc });
// FAIL
throw new TestException(
"'invoke' invocation of ProxyTrustInvocationHandler "
+ "did not throw any exception while "
+ "some kind of exception was expected.");
} catch (Exception e) {
// PASS
logger.fine("'invoke' invocation of "
+ "ProxyTrustInvocationHandler threw " + e
+ " as expected.");
}
proxy = ProxyTrustUtil.newProxyInstance(new RMCImpl(),
new ProxyTrustInvocationHandler(main, boot));
try {
ptihInvoke(ptih, proxy, m, new Object[] { mc });
// FAIL