public void testUnregisterMBeanOnExceptionFromPreDeregister() throws Exception
{
MBeanServer server = MBeanServerFactory.newMBeanServer();
ObjectName name = new ObjectName("test:foo=bar");
server.registerMBean(new LockedTest(), name);
try
{
server.unregisterMBean(name);