throws Exception
{
MBeanServer server = MBeanServerFactory.newMBeanServer();
InvocationHandlerTest test = new InvocationHandlerTest();
server.registerMBean(test, invocationHandlerTestName);
InvocationHandlerTestMBean proxy = (InvocationHandlerTestMBean) MBeanServerInvocationHandler.newProxyInstance(
server, invocationHandlerTestName, InvocationHandlerTestMBean.class, true);
try
{
proxy.equals(new Object());
fail("equals(Object) should not work when it is not exposed for management");
}
catch (Exception ignored)
{
}