@BeforeSuite(groups = "arquillian", inheritGroups = true) public void arquillianBeforeSuite() throws Exception { if (deployableTest.get() == null) { TestRunnerAdaptor adaptor = TestRunnerAdaptorBuilder.build(); adaptor.beforeSuite(); deployableTest.set(adaptor); // don't set TestRunnerAdaptor if beforeSuite fails cycleStack.get().push(Cycle.BEFORE_SUITE); } }
@Test public void shouldCallAllMethodsWithRealAdapter() throws Exception { System.setProperty("arquillian.debug", "true"); TestRunnerAdaptor adaptor = spy(TestRunnerAdaptorBuilder.build()); Result result = run(adaptor, ArquillianClass1.class); Assert.assertTrue(result.wasSuccessful()); assertCycle(1, Cycle.values()); verify(adaptor, times(1)).beforeSuite(); verify(adaptor, times(1)).afterSuite(); } }
@Test public void shouldCallAllMethodsWithRealAdapter() throws Exception { System.setProperty("arquillian.debug", "true"); TestRunnerAdaptor adaptor = spy(TestRunnerAdaptorBuilder.build()); Result result = run(adaptor, ArquillianClass1.class); Assert.assertTrue(result.wasSuccessful()); assertCycle(1, Cycle.values()); verify(adaptor, times(1)).beforeSuite(); verify(adaptor, times(1)).afterSuite(); } }
State.getInitializationException()))); } else { final TestRunnerAdaptor adaptor = TestRunnerAdaptorBuilder.build(); try {
void initializeAdaptor() throws Exception { // first time we're being initialized if (!State.hasTestAdaptor()) { // no, initialization has been attempted before and failed, refuse // to do anything else if (State.hasInitializationException()) { // failed on suite level, ignore children // notifier.fireTestIgnored(getFailureDescription()); handleSuiteLevelFailure(State.getInitializationException()); } else { try { // ARQ-1742 If exceptions happen during boot TestRunnerAdaptor adaptor = TestRunnerAdaptorBuilder .build(); // don't set it if beforeSuite fails adaptor.beforeSuite(); State.testAdaptor(adaptor); } catch (Exception e) { // caught exception during BeforeSuite, mark this as failed State.caughtInitializationException(e); handleBeforeSuiteFailure(e); } } } if (State.hasTestAdaptor()) { setAdaptor(State.getTestAdaptor()); } }
void initializeAdaptor() throws Exception { // first time we're being initialized if (!State.hasTestAdaptor()) { // no, initialization has been attempted before and failed, refuse // to do anything else if (State.hasInitializationException()) { // failed on suite level, ignore children // notifier.fireTestIgnored(getFailureDescription()); handleSuiteLevelFailure(State.getInitializationException()); } else { try { // ARQ-1742 If exceptions happen during boot TestRunnerAdaptor adaptor = TestRunnerAdaptorBuilder .build(); // don't set it if beforeSuite fails adaptor.beforeSuite(); State.testAdaptor(adaptor); } catch (Exception e) { // caught exception during BeforeSuite, mark this as failed State.caughtInitializationException(e); handleBeforeSuiteFailure(e); } } } if (State.hasTestAdaptor()) { setAdaptor(State.getTestAdaptor()); } }
final TestRunnerAdaptor adaptor = TestRunnerAdaptorBuilder.build(); try