@AfterMethod(alwaysRun=true) public void tearDown() throws Exception { if (mgmt != null) Entities.destroyAll(mgmt); mgmt = null; }
protected void destroyManagementContextSafely(ManagementContext mgmt) { try { if (mgmt != null) Entities.destroyAll(mgmt); } catch (Throwable t) { LOG.error("Caught exception destroying management context "+mgmt, t); // If failing during teardown... // we should fail here, except almost always that masks a primary failure in the test itself, // so it would be extremely unhelpful to do so. if we could check if test has not already failed, // that would be ideal, but i'm not sure if that's possible with TestNG. ? } }
@AfterMethod(alwaysRun=true) public void tearDown() throws Exception { if (mgmt != null) Entities.destroyAll(mgmt); mgmt = null; }
@AfterMethod(alwaysRun=true) public void tearDown() { if (mgmt != null) Entities.destroyAll(mgmt); mgmt = null; }
@Override @AfterMethod(alwaysRun = true) public void tearDown() throws Exception { if (mgmt != null) { Entities.destroyAll(mgmt); } }
@AfterMethod(alwaysRun=true) public void tearDown() throws Exception { try { if (mgmt != null) Entities.destroyAll(mgmt); } finally { mgmt = null; if (propsFile != null) propsFile.delete(); } }
@AfterMethod(alwaysRun=true) public void tearDown() throws Exception { if (app != null) Entities.destroyAll(app.getManagementContext()); if (tempFile != null) tempFile.delete(); }
@AfterMethod(alwaysRun = true) public void tearDown() { TypePlanTransformers.clearForced(); if (mgmt!=null) Entities.destroyAll(mgmt); }
@AfterMethod(alwaysRun = true) @Override public void tearDown() throws Exception { for (ManagementContext mgmt: mgmtContexts) Entities.destroyAll(mgmt); super.tearDown(); mementoDir = null; mgmtContexts.clear(); }
@AfterMethod(alwaysRun=true) public void tearDown() throws Exception { for (LocalManagementContext managementContext : managementContexts) { Entities.destroyAll(managementContext); } managementContexts.clear(); if (webServer != null) webServer.stop(); }
@AfterMethod(alwaysRun=true) public void stopServer() throws Exception { if (server!=null) { ManagementContext mgmt = getManagementContextFromJettyServerAttributes(server); server.stop(); if (mgmt!=null) Entities.destroyAll(mgmt); server = null; } }
@AfterMethod(alwaysRun=true) public void tearDown() { if ( app != null) { Entities.destroyAll(app.getManagementContext()); app = null; } }
@AfterMethod(alwaysRun=true) public void tearDown() throws Exception { if (mgmt != null) Entities.destroyAll(mgmt); mgmt = null; FileUtils.deleteDirectory(tempDir); checkExpectedFailure(); }
@AfterMethod(alwaysRun=true) public void tearDown() throws Exception { if (manager != null) manager.stop(); if (managementContext != null) Entities.destroyAll(managementContext); if (objectStore != null) objectStore.deleteCompletely(); }
@AfterMethod(alwaysRun=true) public void tearDown() throws Exception { if (store != null) store.close(); if (parentdir != null) Os.deleteRecursively(basedir); if (mgmt != null) Entities.destroyAll(mgmt); }
@AfterMethod(alwaysRun=true) public void tearDown() throws Exception { if (app != null) Entities.destroyAll(app.getManagementContext()); server.stop(); }
@AfterMethod(alwaysRun=true) public void tearDown() throws Exception { if (app != null) Entities.destroyAll(app.getManagementContext()); if (jmxService != null) jmxService.shutdown(); }
@Override @AfterMethod(alwaysRun=true) public void tearDown() throws Exception { super.tearDown(); if (mgmt!=null) Entities.destroyAll(mgmt); if (store!=null) store.deleteCompletely(); }
public void tearDown() throws Exception { if (ha != null) ha.stop(); if (mgmt != null) Entities.destroyAll(mgmt); if (objectStore != null) objectStore.deleteCompletely(); }
@Test public void testLocation() throws Exception { final TestApplication app = TestApplication.Factory.newManagedInstanceForTests(); ManagementContext managementContext = app.getManagementContext(); try { final Location loc = managementContext.getLocationManager().createLocation(LocationSpec.create(SimulatedLocation.class)); serializer.setLookupContext(newEmptyLookupManagementContext(managementContext, true).add(loc)); assertSerializeAndDeserialize(loc); } finally { Entities.destroyAll(managementContext); } }