assembler.createContainer(statelessContainerInfo);
// Setup the descriptor information
CounterBean.instances.set(0);
EjbJar ejbJar = new EjbJar("StatsInvocModule");
ejbJar.addEnterpriseBean(new StatelessBean(CounterBean.class));
assembler.createApplication(config.configureApplication(ejbJar));
javax.naming.Context context = new InitialContext();
CounterBean bean = (CounterBean) context.lookup("CounterBeanLocalBean");
//Invoke
bean.waitSecs();
MBeanServer server = ManagementFactory.getPlatformMBeanServer();
ObjectName invocationsName = new ObjectName("openejb.management:J2EEServer=openejb,J2EEApplication=null,EJBModule=StatsInvocModule,StatelessSessionBean=CounterBean,j2eeType=Invocations,name=CounterBean");
// Grab the mbeanInfo and check the expected attributes exist and have the correct return types and parameters
MBeanInfo invocationsMBeanInfo = server.getMBeanInfo(invocationsName);
for (MBeanAttributeInfo info : invocationsMBeanInfo.getAttributes()) {
// System.out.println("//" + info.getName() + " " + server.getAttribute(invocationsName, info.getName()));
if (info.getName().equals("waitSecs().GeometricMean")
|| info.getName().equals("waitSecs().Max")
|| info.getName().equals("waitSecs().Mean")
|| info.getName().equals("waitSecs().Min")
|| info.getName().equals("waitSecs().Percentile01")
|| info.getName().equals("waitSecs().Percentile10")
|| info.getName().equals("waitSecs().Percentile25")
|| info.getName().equals("waitSecs().Percentile50")
|| info.getName().equals("waitSecs().Percentile75")
|| info.getName().equals("waitSecs().Percentile90")
|| info.getName().equals("waitSecs().Percentile99")
|| info.getName().equals("waitSecs().Sum")) {
final Double actual = (Double) (server.getAttribute(invocationsName, info.getName()));
assertTrue("Expected: " + actual + " >= 999", actual >= 999);
}
}
ejbJar.removeEnterpriseBean("StatsInvocModule");
}