@Test(expectedExceptions = IllegalStateException.class,expectedExceptionsMessageRegExp = ".*not register.*")
public void mbeanRegistrationFailed() throws JMException {

    handler.registerMBean(new Dummy(true, "test:type=dummy"));
}