MBeanServer server = MBeanServerFactory.newMBeanServer();
ObjectName name = new ObjectName("test:foo=bar");
try
{
server.registerMBean(new Test3(), name);
// should not reach here
fail("Test3 registered despite of throwin an exception from the preRegister() method");
}
catch (MBeanRegistrationException e)