import static org.junit.Assert.assertNotNull;
public abstract class SironaExtensionTestBase {
@Test
public void checkMeasures() throws Exception {
final CdiTestContainer container = CdiTestContainerLoader.getCdiContainer();
container.bootContainer();
container.startApplicationScope();
final BeanManager beanManager = container.getBeanManager();
final Class<?> type = type();
final TwoSeconds bean = TwoSeconds.class.cast(beanManager.getReference(beanManager.resolve(beanManager.getBeans(type)), type, null));
bean.twoSeconds();
container.stopApplicationScope();
container.shutdownContainer();
final Counter perf = Repository.INSTANCE.getCounter(new Counter.Key(Role.PERFORMANCES, type.getName() + ".twoSeconds"));
assertNotNull(perf);
assertEquals(2000, TimeUnit.NANOSECONDS.toMillis((int) perf.getMax()), 200);
}