Skip to content

Commit

Permalink
Make sure @AfterTest runs and protect it againts failures
Browse files Browse the repository at this point in the history
  • Loading branch information
galderz committed Sep 27, 2011
1 parent 80d97d5 commit 537468b
Showing 1 changed file with 6 additions and 3 deletions.
Expand Up @@ -79,9 +79,12 @@ public void simpleTest() throws IOException {
assertEquals("v", cache.get("k"));
}

@AfterTest
@AfterTest(alwaysRun = true)
public void tearDown() {
hotRodServer.stop();
cacheManager.stop();
try {
if (hotRodServer != null) hotRodServer.stop();
} finally {
if (cacheManager != null) cacheManager.stop();
}
}
}

0 comments on commit 537468b

Please sign in to comment.