@Override protected void tearDown() { tearDownStack.runTearDown(); }
@Override protected void tearDown() { tearDownStack.runTearDown(); }
@Override protected void tearDown() { tearDownStack.runTearDown(); }
@Override protected final void tearDown() { tearDownStack.runTearDown(); }
@Override protected void tearDown() { stack.runTearDown(); }
@Override protected final void tearDown() { tearDownStack.runTearDown(); assertNull( "exceptions should not be propagated to uncaught exception handlers", thrownByExecutionThread); }
public void testSingleTearDown() throws Exception { final TearDownStack stack = buildTearDownStack(); final SimpleTearDown tearDown = new SimpleTearDown(); stack.addTearDown(tearDown); assertEquals(false, tearDown.ran); stack.runTearDown(); assertEquals("tearDown should have run", true, tearDown.ran); }
public void testThrowingTearDown() throws Exception { final TearDownStack stack = buildTearDownStack(); final ThrowingTearDown tearDownOne = new ThrowingTearDown("one"); stack.addTearDown(tearDownOne); final ThrowingTearDown tearDownTwo = new ThrowingTearDown("two"); stack.addTearDown(tearDownTwo); assertEquals(false, tearDownOne.ran); assertEquals(false, tearDownTwo.ran); try { stack.runTearDown(); fail("runTearDown should have thrown an exception"); } catch (ClusterException expected) { assertThat(expected).hasCauseThat().hasMessageThat().isEqualTo("two"); } catch (RuntimeException e) { throw new RuntimeException( "A ClusterException should have been thrown, rather than a " + e.getClass().getName(), e); } assertEquals(true, tearDownOne.ran); assertEquals(true, tearDownTwo.ran); }
public void testMultipleTearDownsHappenInOrder() throws Exception { final TearDownStack stack = buildTearDownStack(); final SimpleTearDown tearDownOne = new SimpleTearDown(); stack.addTearDown(tearDownOne); final Callback callback = new Callback() { @Override public void run() { assertEquals( "tearDownTwo should have been run before tearDownOne", false, tearDownOne.ran); } }; final SimpleTearDown tearDownTwo = new SimpleTearDown(callback); stack.addTearDown(tearDownTwo); assertEquals(false, tearDownOne.ran); assertEquals(false, tearDownTwo.ran); stack.runTearDown(); assertEquals("tearDownOne should have run", true, tearDownOne.ran); assertEquals("tearDownTwo should have run", true, tearDownTwo.ran); }
@Override protected void tearDown() { tearDownStack.runTearDown(); }
@Override protected void tearDown() { tearDownStack.runTearDown(); }
@Override protected void tearDown() { stack.runTearDown(); }
@AfterTest void tearDown() { tearDowns.runTearDown(); } }
@Override protected void tearDown() { tearDownStack.runTearDown(); }
@Override protected void tearDown() { stack.runTearDown(); }
@Override protected void tearDown() { tearDownStack.runTearDown(); }
@Override protected final void tearDown() { tearDownStack.runTearDown(); }
@Override protected final void tearDown() { tearDownStack.runTearDown(); assertNull("exceptions should not be propagated to uncaught exception handlers", thrownByExecutionThread); }
public void testSingleTearDown() throws Exception { final TearDownStack stack = buildTearDownStack(); final SimpleTearDown tearDown = new SimpleTearDown(); stack.addTearDown(tearDown); assertEquals(false, tearDown.ran); stack.runTearDown(); assertEquals("tearDown should have run", true, tearDown.ran); }
public void testSingleTearDown() throws Exception { final TearDownStack stack = buildTearDownStack(); final SimpleTearDown tearDown = new SimpleTearDown(); stack.addTearDown(tearDown); assertEquals(false, tearDown.ran); stack.runTearDown(); assertEquals("tearDown should have run", true, tearDown.ran); }