示例#1
0
  @Test
  public void shouldAddMBeanContainerAsEventListener() throws Exception {
    ArgumentCaptor<MBeanContainer> captor = ArgumentCaptor.forClass(MBeanContainer.class);
    jetty6Server.configure();

    verify(container).addEventListener(captor.capture());
    MBeanContainer mBeanContainer = captor.getValue();
    assertThat(mBeanContainer.getMBeanServer(), is(not(nullValue())));
  }
示例#2
0
 private MBeanContainer mbeans() {
   MBeanServer platformMBeanServer = ManagementFactory.getPlatformMBeanServer();
   MBeanContainer mbeans = new MBeanContainer(platformMBeanServer);
   mbeans.start();
   return mbeans;
 }