expect(mockServer.queryNames(new ObjectName("amx:type=domain-root,*"),null)).andReturn(Collections.<ObjectName>emptySet()).anyTimes();
ObjectName bootAmxName = new ObjectName("amx-support:type=boot-amx");
expect(mockServer.isRegistered(bootAmxName)).andStubReturn(true);
expect(mockServer.invoke(bootAmxName, "bootAMX", null, null)).andThrow(exp);
LogHandler log = createMock(LogHandler.class);
log.error(matches(regexp),isA(exp.getClass()));
replay(mockServer,log);
MBeanServerExecutor servers = getMBeanServerManager(mockServer);
handle.postDetect(servers,new Configuration(),log);
handle.preDispatch(servers,null);
verify(mockServer);