public void before(Object testInstance, Method testMethod, LifecycleMethodExecutor executor) throws Exception { Validate.notNull(testInstance, "TestInstance must be specified"); Validate.notNull(testMethod, "TestMethod must be specified"); ExecutionDecision executionDecision = resolveExecutionDecision(manager, testMethod); if (executionDecision.getDecision() == Decision.DONT_EXECUTE) { return; } manager.fire(new Before(testInstance, testMethod, executor)); }
@Test public void shouldCallAllEnrichers() throws Exception { Mockito.when(serviceLoader.all(TestEnricher.class)).thenReturn(Arrays.asList(enricher, enricher)); bind(SuiteScoped.class, ServiceLoader.class, serviceLoader); fire(new Before(this, getClass().getMethod("shouldCallAllEnrichers"))); Mockito.verify(enricher, Mockito.times(2)).enrich(this); assertEventFired(BeforeEnrichment.class, 1); assertEventFired(AfterEnrichment.class, 1); } }
@Test public void shouldCallAllEnrichers() throws Exception { Mockito.when(serviceLoader.all(TestEnricher.class)).thenReturn(Arrays.asList(enricher, enricher)); bind(SuiteScoped.class, ServiceLoader.class, serviceLoader); fire(new Before(this, getClass().getMethod("shouldCallAllEnrichers"))); Mockito.verify(enricher, Mockito.times(2)).enrich(this); assertEventFired(BeforeEnrichment.class, 1); assertEventFired(AfterEnrichment.class, 1); } }
private void executeTest(Object inspection, Method method, List<Annotation> qualifiers) { before.fire(new Before(inspection, method)); test.fire(new Test(new LifecycleMethodExecutor(inspection, method, qualifiers))); after.fire(new After(inspection, method)); }
@Test @Ignore public void shouldEnrichTestInstance() throws Exception { fire(new org.jboss.arquillian.test.spi.event.suite.Before(testClass(), testMethod())); //assertEventFired(Enrich, count) }
@Test public void shouldInvokeBeforeInContainerDeploymentContext() throws Exception { fire(new org.jboss.arquillian.test.spi.event.suite.Before(this, testMethod())); assertEventFiredInContext(org.jboss.arquillian.test.spi.event.suite.Before.class, ContainerContext.class); assertEventFiredInContext(org.jboss.arquillian.test.spi.event.suite.Before.class, DeploymentContext.class); }
@Test @Ignore public void shouldEnrichTestInstance() throws Exception { fire(new org.jboss.arquillian.test.spi.event.suite.Before(testClass(), testMethod())); //assertEventFired(Enrich, count) }
@Test public void shouldInvokeBeforeInContainerDeploymentContext() throws Exception { fire(new org.jboss.arquillian.test.spi.event.suite.Before(this, testMethod())); assertEventFiredInContext(org.jboss.arquillian.test.spi.event.suite.Before.class, ContainerContext.class); assertEventFiredInContext(org.jboss.arquillian.test.spi.event.suite.Before.class, DeploymentContext.class); }