Java Code Examples for org.apache.brooklyn.core.entity.Entities#destroyAllCatching()

The following examples show how to use org.apache.brooklyn.core.entity.Entities#destroyAllCatching() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AbstractJcloudsLocationTest.java    From brooklyn-server with Apache License 2.0 6 votes vote down vote up
@AfterMethod(alwaysRun=true)
public void tearDown() {
    List<Exception> exceptions = Lists.newArrayList();
    for (SshMachineLocation machine : machines) {
        try {
            loc.release(machine);
        } catch (Exception e) {
            LOG.warn("Error releasing {}: {}; continuing...", machine, e.getMessage());
            exceptions.add(e);
        }
    }
    if (!exceptions.isEmpty()) {
        LOG.info("Exception during tearDown: {}", Exceptions.collapseText(exceptions.get(0)));
    }
    machines.clear();
    
    if (ctx != null) {
    	Entities.destroyAllCatching(ctx);
    	ctx = null;
    }
}
 
Example 2
Source File: XmlMementoSerializerTest.java    From brooklyn-server with Apache License 2.0 5 votes vote down vote up
@AfterMethod(alwaysRun=true)
private void tearDown() {
    if (mgmt != null) {
        Entities.destroyAllCatching(mgmt);
        mgmt = null;
    }
}
 
Example 3
Source File: AbstractCloudFoundryPaasLocationLiveTest.java    From SeaCloudsPlatform with Apache License 2.0 5 votes vote down vote up
@AfterMethod
public void tearDown() throws Exception {
    if (app != null) {
        Entities.destroyAllCatching(app.getManagementContext());
    }
    if (managementContext != null){
        Entities.destroyAll(managementContext);
    }
}
 
Example 4
Source File: AbstractOpenShiftPaasLocationLiveTest.java    From SeaCloudsPlatform with Apache License 2.0 5 votes vote down vote up
@AfterMethod
public void tearDown() throws Exception {
    if (app != null) {
        Entities.destroyAllCatching(app.getManagementContext());
    }
    if (managementContext != null){
        Entities.destroyAll(managementContext);
    }
}