/**
* This method performs all actions mentioned in class description.
*
*/
public void run() throws Exception {
RMCTEImpl mImpl = new RMCTEImpl();
RemoteMethodControl main = (RemoteMethodControl)
ProxyTrustUtil.newProxyInstance(mImpl);
ProxyTrust boot = createValidBootProxy();
ProxyTrustInvocationHandler ptih = createPTIH(main, boot);
Object proxy = ProxyTrustUtil.newProxyInstance(
new RMCTEImpl(), ptih);
Method m = RemoteMethodControl.class.getDeclaredMethod(
"setConstraints", new Class[] { MethodConstraints.class });
MethodConstraints mc = new BasicMethodConstraints(
new InvocationConstraints(
new InvocationConstraint[] { ClientAuthentication.YES },
null));
Object res = ptihInvoke(ptih, proxy, m, new Object[] { mc });
if (mImpl.getSetConstraintsNum() != 1) {
// FAIL
throw new TestException(
"'setConstraints' method of main proxy was called "
+ mImpl.getSetConstraintsNum()
+ " times while 1 was expected.");
}
// PASS
logger.fine("'setConstraints' method of main proxy was called "
+ " 1 time as expected.");
if (mImpl.getSetConstraintsArg() != mc) {
// FAIL
throw new TestException(
"'setConstraints' method of main proxy was called with "
+ mImpl.getSetConstraintsArg()
+ " argument while " + mc + " was expected.");
}
// PASS
logger.fine("'setConstraints' method of main proxy was called with "