You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by he...@apache.org on 2015/08/19 13:09:32 UTC

[14/72] [abbrv] incubator-brooklyn git commit: BROOKLYN-162 - apply org.apache package prefix to software-base, tidying package names, and moving a few sensory things to core

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/64c2b2e5/software/base/src/test/java/brooklyn/entity/java/JavaSoftwareProcessSshDriverIntegrationTest.java
----------------------------------------------------------------------
diff --git a/software/base/src/test/java/brooklyn/entity/java/JavaSoftwareProcessSshDriverIntegrationTest.java b/software/base/src/test/java/brooklyn/entity/java/JavaSoftwareProcessSshDriverIntegrationTest.java
deleted file mode 100644
index 2aae686..0000000
--- a/software/base/src/test/java/brooklyn/entity/java/JavaSoftwareProcessSshDriverIntegrationTest.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package brooklyn.entity.java;
-
-import static org.testng.Assert.assertFalse;
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertTrue;
-
-import org.apache.brooklyn.api.entity.EntitySpec;
-import org.apache.brooklyn.api.internal.EntityLocal;
-import org.apache.brooklyn.api.location.LocationSpec;
-import org.apache.brooklyn.api.location.MachineProvisioningLocation;
-import org.apache.brooklyn.core.test.BrooklynAppLiveTestSupport;
-import org.apache.brooklyn.core.test.entity.LocalManagementContextForTests;
-import org.apache.brooklyn.entity.core.BrooklynConfigKeys;
-import org.apache.brooklyn.test.Asserts;
-import org.apache.brooklyn.util.collections.MutableMap;
-import org.apache.brooklyn.util.os.Os;
-import org.apache.brooklyn.util.text.Strings;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testng.Assert;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import brooklyn.entity.basic.SoftwareProcess;
-import brooklyn.entity.basic.lifecycle.MyEntity;
-
-import org.apache.brooklyn.location.basic.SshMachineLocation;
-
-import com.google.common.base.Optional;
-import com.google.common.collect.ImmutableList;
-
-public class JavaSoftwareProcessSshDriverIntegrationTest extends BrooklynAppLiveTestSupport {
-
-    private static final long TIMEOUT_MS = 10 * 1000;
-
-    private static final Logger LOG = LoggerFactory.getLogger(JavaSoftwareProcessSshDriverIntegrationTest.class);
-
-    private MachineProvisioningLocation<?> localhost;
-
-    private static class ConcreteJavaSoftwareProcessSshDriver extends JavaSoftwareProcessSshDriver {
-        public ConcreteJavaSoftwareProcessSshDriver(EntityLocal entity, SshMachineLocation machine) {
-            super(entity, machine);
-        }
-        @Override protected String getLogFileLocation() { return null; }
-        @Override public boolean isRunning() { return false; }
-        @Override public void stop() {}
-        @Override public void install() {}
-        @Override public void customize() {}
-        @Override public void launch() {}
-    }
-
-    @BeforeMethod(alwaysRun=true)
-    @Override
-    public void setUp() throws Exception {
-        super.setUp();
-        localhost = app.newLocalhostProvisioningLocation();
-    }
-
-    @Test(groups = "Integration")
-    public void testJavaStartStopSshDriverStartsAndStopsApp() throws Exception {
-        final MyEntity entity = app.createAndManageChild(EntitySpec.create(MyEntity.class));
-        app.start(ImmutableList.of(localhost));
-        Asserts.succeedsEventually(MutableMap.of("timeout", TIMEOUT_MS), new Runnable() {
-            public void run() {
-                assertTrue(entity.getAttribute(SoftwareProcess.SERVICE_UP));
-            }});
-
-        entity.stop();
-        assertFalse(entity.getAttribute(SoftwareProcess.SERVICE_UP));
-    }
-
-    @Test(groups = "Integration")
-    public void testGetJavaVersion() throws Exception {
-        SshMachineLocation sshLocation = app.getManagementContext().getLocationManager().createLocation(
-                LocationSpec.create(SshMachineLocation.class).configure("address", "localhost"));
-        JavaSoftwareProcessSshDriver driver = new ConcreteJavaSoftwareProcessSshDriver(app, sshLocation);
-        Optional<String> version = driver.getInstalledJavaVersion();
-        assertNotNull(version);
-        assertTrue(version.isPresent());
-        LOG.info("{}.testGetJavaVersion found: {} on localhost", getClass(), version.get());
-    }
-
-    @Test(groups = "Integration")
-    public void testStartsInMgmtSpecifiedDirectory() throws Exception {
-        String dir = Os.mergePathsUnix(Os.tmp(), "/brooklyn-test-"+Strings.makeRandomId(4));
-        tearDown();
-        mgmt = new LocalManagementContextForTests();
-        mgmt.getBrooklynProperties().put(BrooklynConfigKeys.ONBOX_BASE_DIR, dir);
-        setUp();
-
-        doTestSpecifiedDirectory(dir, dir);
-        Os.deleteRecursively(dir);
-    }
-
-    @Test(groups = "Integration")
-    public void testStartsInAppSpecifiedDirectoryUnderHome() throws Exception {
-        String dir = Os.mergePathsUnix("~/.brooklyn-test-"+Strings.makeRandomId(4));
-        try {
-            app.config().set(BrooklynConfigKeys.ONBOX_BASE_DIR, dir);
-            doTestSpecifiedDirectory(dir, dir);
-        } finally {
-            Os.deleteRecursively(dir);
-        }
-    }
-
-    @Test(groups = "Integration")
-    public void testStartsInDifferentRunAndInstallSpecifiedDirectories() throws Exception {
-        String dir1 = Os.mergePathsUnix(Os.tmp(), "/brooklyn-test-"+Strings.makeRandomId(4));
-        String dir2 = Os.mergePathsUnix(Os.tmp(), "/brooklyn-test-"+Strings.makeRandomId(4));
-        app.config().set(BrooklynConfigKeys.INSTALL_DIR, dir1);
-        app.config().set(BrooklynConfigKeys.RUN_DIR, dir2);
-        doTestSpecifiedDirectory(dir1, dir2);
-        Os.deleteRecursively(dir1);
-        Os.deleteRecursively(dir2);
-    }
-
-    @Test(groups = "Integration")
-    public void testStartsInLegacySpecifiedDirectory() throws Exception {
-        String dir1 = Os.mergePathsUnix(Os.tmp(), "/brooklyn-test-"+Strings.makeRandomId(4));
-        String dir2 = Os.mergePathsUnix(Os.tmp(), "/brooklyn-test-"+Strings.makeRandomId(4));
-        tearDown();
-        mgmt = new LocalManagementContextForTests();
-        mgmt.getBrooklynProperties().put("brooklyn.dirs.install", dir1);
-        mgmt.getBrooklynProperties().put("brooklyn.dirs.run", dir2);
-        setUp();
-
-        app.config().set(BrooklynConfigKeys.RUN_DIR, dir2);
-        doTestSpecifiedDirectory(dir1, dir2);
-        Os.deleteRecursively(dir1);
-        Os.deleteRecursively(dir2);
-    }
-
-    protected void doTestSpecifiedDirectory(final String installDirPrefix, final String runDirPrefix) throws Exception {
-        final MyEntity entity = app.createAndManageChild(EntitySpec.create(MyEntity.class));
-        app.start(ImmutableList.of(localhost));
-        Asserts.succeedsEventually(MutableMap.of("timeout", TIMEOUT_MS), new Runnable() {
-            public void run() {
-                assertTrue(entity.getAttribute(SoftwareProcess.SERVICE_UP));
-
-                String installDir = entity.getAttribute(SoftwareProcess.INSTALL_DIR);
-                Assert.assertNotNull(installDir);
-
-                String runDir = entity.getAttribute(SoftwareProcess.RUN_DIR);
-                Assert.assertNotNull(runDir);
-            }});
-
-        String installDir = entity.getAttribute(SoftwareProcess.INSTALL_DIR);
-        String runDir = entity.getAttribute(SoftwareProcess.RUN_DIR);
-        LOG.info("dirs for " + app + " are: install=" + installDir + ", run=" + runDir);
-        assertTrue(installDir.startsWith(Os.tidyPath(installDirPrefix)), "INSTALL_DIR is "+installDir+", does not start with expected prefix "+installDirPrefix);
-        assertTrue(runDir.startsWith(Os.tidyPath(runDirPrefix)), "RUN_DIR is "+runDir+", does not start with expected prefix "+runDirPrefix);
-
-        entity.stop();
-        assertFalse(entity.getAttribute(SoftwareProcess.SERVICE_UP));
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/64c2b2e5/software/base/src/test/java/brooklyn/entity/java/JmxSupportTest.java
----------------------------------------------------------------------
diff --git a/software/base/src/test/java/brooklyn/entity/java/JmxSupportTest.java b/software/base/src/test/java/brooklyn/entity/java/JmxSupportTest.java
deleted file mode 100644
index 5f9ed0f..0000000
--- a/software/base/src/test/java/brooklyn/entity/java/JmxSupportTest.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package brooklyn.entity.java;
-
-import static org.testng.Assert.assertEquals;
-
-import org.apache.brooklyn.core.test.entity.TestApplication;
-import org.apache.brooklyn.entity.core.Entities;
-import org.apache.brooklyn.util.core.ResourceUtils;
-import org.apache.brooklyn.util.core.flags.TypeCoercions;
-import org.apache.brooklyn.util.exceptions.Exceptions;
-import org.apache.brooklyn.util.javalang.JavaClassNames;
-import org.apache.brooklyn.util.maven.MavenRetriever;
-import org.apache.brooklyn.util.stream.Streams;
-import org.apache.brooklyn.util.text.Strings;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.Test;
-
-import brooklyn.entity.java.UsesJmx.JmxAgentModes;
-
-@Test
-public class JmxSupportTest {
-
-    private static final Logger log = LoggerFactory.getLogger(JmxSupportTest.class);
-    
-    private TestApplication app;
-
-    @AfterMethod(alwaysRun = true)
-    public void tearDown() {
-        if (app!=null) Entities.destroyAll(app.getManagementContext());
-    }
-    
-    // defaults to JMXMP for most locations (or, in this case, if it does not yet know the location)
-    public void testJmxAutodetect() {
-        app = TestApplication.Factory.newManagedInstanceForTests();
-        JmxSupport support = new JmxSupport(app, null);
-        
-        Assert.assertEquals(support.getJmxAgentMode(), JmxAgentModes.JMXMP_AND_RMI);
-    }
-
-    public void testJmxmpJarExistence() {
-        app = TestApplication.Factory.newManagedInstanceForTests();
-        app.setConfig(JmxSupport.JMX_AGENT_MODE, JmxAgentModes.JMXMP);
-        JmxSupport support = new JmxSupport(app, null);
-        
-        Assert.assertEquals(support.getJmxAgentJarMavenArtifact().getArtifactId(),
-                "brooklyn-jmxmp-agent");
-        
-        Assert.assertTrue(ResourceUtils.create(this).doesUrlExist(support.getJmxAgentJarUrl()), support.getJmxAgentJarUrl());
-        Assert.assertTrue(support.getJmxAgentJarUrl().contains("-shaded-"), support.getJmxAgentJarUrl());
-    }
-    
-    public void testJmxrmiJarExistence() {
-        app = TestApplication.Factory.newManagedInstanceForTests();
-        JmxSupport support = new JmxSupport(app, null);
-        app.setConfig(JmxSupport.JMX_AGENT_MODE, JmxAgentModes.JMX_RMI_CUSTOM_AGENT);
-        
-        Assert.assertEquals(support.getJmxAgentJarMavenArtifact().getArtifactId(),
-                "brooklyn-jmxrmi-agent");
-        
-        Assert.assertTrue(ResourceUtils.create(this).doesUrlExist(support.getJmxAgentJarUrl()), support.getJmxAgentJarUrl());
-    }
-
-    @Test
-    public void testCoerceStringtoJmxAgentModes() {
-        // Test coercions
-        assertEquals(TypeCoercions.coerce("AUTODETECT", JmxAgentModes.class), JmxAgentModes.AUTODETECT);
-        assertEquals(TypeCoercions.coerce("JMXMP_AND_RMI", JmxAgentModes.class), JmxAgentModes.JMXMP_AND_RMI);
-        assertEquals(TypeCoercions.coerce("JMX_RMI_CUSTOM_AGENT", JmxAgentModes.class), JmxAgentModes.JMX_RMI_CUSTOM_AGENT);
-
-        // Test different case format options
-        assertEquals(TypeCoercions.coerce("jmxRmiCustomAgent", JmxAgentModes.class), JmxAgentModes.JMX_RMI_CUSTOM_AGENT);
-        assertEquals(TypeCoercions.coerce("jmx_rmi_custom_agent", JmxAgentModes.class), JmxAgentModes.JMX_RMI_CUSTOM_AGENT);
-        assertEquals(TypeCoercions.coerce("jmx-rmi-custom-agent", JmxAgentModes.class), JmxAgentModes.JMX_RMI_CUSTOM_AGENT);
-        assertEquals(TypeCoercions.coerce("JmxRmiCustomAgent", JmxAgentModes.class), JmxAgentModes.JMX_RMI_CUSTOM_AGENT);
-    }
-
-
-    @Test(groups="Integration")
-    public void testJmxmpJarHostedValidity() {
-        app = TestApplication.Factory.newManagedInstanceForTests();
-        app.setConfig(JmxSupport.JMX_AGENT_MODE, JmxAgentModes.JMXMP);
-        JmxSupport support = new JmxSupport(app, null);
-
-        // make sure we get a valid jar, big enough (no redirect, and classifier correclty set for this!)
-        // (we don't want the unshaded jar, that would be no good!)
-        checkValidArchive(MavenRetriever.hostedUrl(support.getJmxAgentJarMavenArtifact()), 100*1000);
-    }
-    
-    @Test(groups="Integration")
-    public void testJmxrmiJarHostedValidity() {
-        app = TestApplication.Factory.newManagedInstanceForTests();
-        JmxSupport support = new JmxSupport(app, null);
-        app.setConfig(JmxSupport.JMX_AGENT_MODE, JmxAgentModes.JMX_RMI_CUSTOM_AGENT);
-        
-        // make sure we get a valid jar, big enough (no redirect)
-        checkValidArchive(MavenRetriever.hostedUrl(support.getJmxAgentJarMavenArtifact()), 4000);
-    }
-
-    private void checkValidArchive(String url, long minSize) {
-        byte[] bytes;
-        try {
-            bytes = Streams.readFully(ResourceUtils.create(this).getResourceFromUrl(url));
-            log.info("read "+bytes.length+" bytes from "+url+" for "+JavaClassNames.callerNiceClassAndMethod(1));
-        } catch (Exception e) {
-            log.warn("Unable to read URL "+url+" for " +JavaClassNames.callerNiceClassAndMethod(1)+
-                    "; this test may require hosted (sonatype/mavencentral) repo to be populated");
-            Assert.fail("Unable to read URL "+url+"; this test may require hosted (sonatype/mavencentral) repo to be populated");
-            throw Exceptions.propagate(e);
-        }
-        // confirm this follow redirects!
-        Assert.assertTrue(bytes.length > minSize, "download of "+url+" is suspect ("+Strings.makeSizeString(bytes.length)+")");
-        // (could also check it is a zip etc)
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/64c2b2e5/software/base/src/test/java/brooklyn/entity/java/SslKeyConfigTest.java
----------------------------------------------------------------------
diff --git a/software/base/src/test/java/brooklyn/entity/java/SslKeyConfigTest.java b/software/base/src/test/java/brooklyn/entity/java/SslKeyConfigTest.java
deleted file mode 100644
index 954bb43..0000000
--- a/software/base/src/test/java/brooklyn/entity/java/SslKeyConfigTest.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package brooklyn.entity.java;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.security.Key;
-import java.security.KeyStore;
-import java.security.cert.Certificate;
-
-import org.apache.brooklyn.util.core.crypto.FluentKeySigner;
-import org.apache.brooklyn.util.core.crypto.SecureKeys;
-import org.testng.Assert;
-import org.testng.annotations.Test;
-
-public class SslKeyConfigTest {
-
-    @Test
-    public void testWriteKeyAndCertThenReadThem() throws Exception {
-        FluentKeySigner signer = new FluentKeySigner("brooklyn-test").selfsign();
-        
-        KeyStore ks = SecureKeys.newKeyStore();
-        ks.setKeyEntry("key1", 
-                signer.getKey().getPrivate(), "s3cr3t".toCharArray(), new Certificate[] { signer.getAuthorityCertificate() });
-        ByteArrayOutputStream bytes = new ByteArrayOutputStream();
-        ks.store(bytes, "5t0r3".toCharArray());
-        
-        KeyStore ks2 = SecureKeys.newKeyStore(new ByteArrayInputStream(bytes.toByteArray()), "5t0r3");
-        String firstAlias = ks2.aliases().nextElement();
-        Assert.assertEquals(firstAlias, "key1");
-        Key k = ks2.getKey(firstAlias, "s3cr3t".toCharArray());
-        Assert.assertEquals(k, signer.getKey().getPrivate());
-        Certificate[] cc = ks2.getCertificateChain(firstAlias);
-        Assert.assertEquals(cc, new Certificate[] { signer.getAuthorityCertificate() });
-    }
-    
-}

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/64c2b2e5/software/base/src/test/java/brooklyn/entity/java/VanillaJavaAppRebindTest.java
----------------------------------------------------------------------
diff --git a/software/base/src/test/java/brooklyn/entity/java/VanillaJavaAppRebindTest.java b/software/base/src/test/java/brooklyn/entity/java/VanillaJavaAppRebindTest.java
deleted file mode 100644
index 6f1b179..0000000
--- a/software/base/src/test/java/brooklyn/entity/java/VanillaJavaAppRebindTest.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package brooklyn.entity.java;
-
-import static org.testng.Assert.assertTrue;
-
-import java.io.File;
-
-import org.apache.brooklyn.api.entity.EntitySpec;
-import org.apache.brooklyn.api.sensor.AttributeSensor;
-import org.apache.brooklyn.core.mgmt.internal.LocalManagementContext;
-import org.apache.brooklyn.core.mgmt.rebind.RebindTestUtils;
-import org.apache.brooklyn.core.test.entity.TestApplication;
-import org.apache.brooklyn.entity.core.Entities;
-import org.apache.brooklyn.policy.enricher.RollingTimeWindowMeanEnricher;
-import org.apache.brooklyn.sensor.core.Sensors;
-import org.apache.brooklyn.test.EntityTestUtils;
-import org.apache.brooklyn.util.collections.MutableMap;
-import org.apache.brooklyn.util.core.ResourceUtils;
-import org.apache.brooklyn.util.time.Duration;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import brooklyn.entity.java.JavaOptsTest.TestingJavaOptsVanillaJavaAppImpl;
-
-import org.apache.brooklyn.location.basic.LocalhostMachineProvisioningLocation;
-
-import com.google.common.base.Predicates;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Iterables;
-import com.google.common.io.Files;
-
-public class VanillaJavaAppRebindTest {
-
-    private static final Logger LOG = LoggerFactory.getLogger(VanillaJavaAppRebindTest.class);
-    
-    private static String BROOKLYN_THIS_CLASSPATH = null;
-    private static Class<?> MAIN_CLASS = ExampleVanillaMain.class;
-
-    private ClassLoader classLoader = getClass().getClassLoader();
-    private LocalManagementContext managementContext;
-    private File mementoDir;
-    private TestApplication app;
-    private LocalhostMachineProvisioningLocation loc;
-    
-    @BeforeMethod(alwaysRun=true)
-    public void setUp() throws Exception {
-        mementoDir = Files.createTempDir();
-        managementContext = RebindTestUtils.newPersistingManagementContext(mementoDir, classLoader);
-        
-        if (BROOKLYN_THIS_CLASSPATH==null) {
-            BROOKLYN_THIS_CLASSPATH = ResourceUtils.create(MAIN_CLASS).getClassLoaderDir();
-        }
-        app = TestApplication.Factory.newManagedInstanceForTests(managementContext);
-        loc = app.newLocalhostProvisioningLocation(MutableMap.of("address", "localhost"));
-    }
-
-    @AfterMethod(alwaysRun = true)
-    public void tearDown() throws Exception {
-        if (app != null) Entities.destroyAll(app.getManagementContext());
-        if (mementoDir != null) RebindTestUtils.deleteMementoDir(mementoDir);
-    }
-    
-    private void rebind() throws Exception {
-        RebindTestUtils.waitForPersisted(app);
-        managementContext.terminate();
-        
-        app = (TestApplication) RebindTestUtils.rebind(mementoDir, getClass().getClassLoader());
-        managementContext = (LocalManagementContext) app.getManagementContext();
-        loc = (LocalhostMachineProvisioningLocation) Iterables.get(app.getLocations(), 0, null);
-    }
-    
-    @Test(groups="Integration")
-    public void testRebindToJavaApp() throws Exception {
-        VanillaJavaApp javaProcess = app.addChild(EntitySpec.create(VanillaJavaApp.class, TestingJavaOptsVanillaJavaAppImpl.class)
-            .configure("main", MAIN_CLASS.getCanonicalName()).configure("classpath", ImmutableList.of(BROOKLYN_THIS_CLASSPATH)));
-
-        Entities.manage(javaProcess);
-        app.start(ImmutableList.of(loc));
-
-        rebind();
-        VanillaJavaApp javaProcess2 = (VanillaJavaApp) Iterables.find(app.getChildren(), Predicates.instanceOf(VanillaJavaApp.class));
-        
-        EntityTestUtils.assertAttributeEqualsEventually(javaProcess2, VanillaJavaApp.SERVICE_UP, true);
-    }
-
-    @Test(groups="Integration")
-    public void testRebindToKilledJavaApp() throws Exception {
-        VanillaJavaApp javaProcess = app.addChild(EntitySpec.create(VanillaJavaApp.class, TestingJavaOptsVanillaJavaAppImpl.class)
-            .configure("main", MAIN_CLASS.getCanonicalName()).configure("classpath", ImmutableList.of(BROOKLYN_THIS_CLASSPATH)));
-        Entities.manage(javaProcess);
-        app.start(ImmutableList.of(loc));
-        javaProcess.kill();
-        
-        long starttime = System.currentTimeMillis();
-        rebind();
-        long rebindTime = System.currentTimeMillis() - starttime;
-        
-        VanillaJavaApp javaProcess2 = (VanillaJavaApp) Iterables.find(app.getChildren(), Predicates.instanceOf(VanillaJavaApp.class));
-        EntityTestUtils.assertAttributeEqualsEventually(javaProcess2, VanillaJavaApp.SERVICE_UP, false);
-        
-        // check that it was quick (previously it hung)
-        assertTrue(rebindTime < 30*1000, "rebindTime="+rebindTime);
-    }
-    
-    
-    @Test(groups="Integration")
-    public void testEnrichersOnRebindJavaApp() throws Exception {
-        VanillaJavaApp javaProcess = app.addChild(EntitySpec.create(VanillaJavaApp.class, EnrichedVanillaJavaAppImpl.class)
-            .configure("main", MAIN_CLASS.getCanonicalName()).configure("classpath", ImmutableList.of(BROOKLYN_THIS_CLASSPATH)));
-
-        Entities.manage(javaProcess);
-        app.start(ImmutableList.of(loc));
-
-        EntityTestUtils.assertAttributeEventuallyNonNull(javaProcess, EnrichedVanillaJavaAppImpl.AVG1);
-        EntityTestUtils.assertAttributeEventuallyNonNull(javaProcess, EnrichedVanillaJavaAppImpl.AVG2);
-        LOG.info("Got avg "+javaProcess.getAttribute(EnrichedVanillaJavaAppImpl.AVG1));
-
-        rebind();
-        VanillaJavaApp javaProcess2 = (VanillaJavaApp) Iterables.find(app.getChildren(), Predicates.instanceOf(VanillaJavaApp.class));
-
-        // check sensors working
-        EntityTestUtils.assertAttributeChangesEventually(javaProcess2, EnrichedVanillaJavaAppImpl.PROCESS_CPU_TIME); 
-        LOG.info("Avg now "+javaProcess2.getAttribute(EnrichedVanillaJavaAppImpl.AVG1));
-        
-        // check enrichers are functioning
-        EntityTestUtils.assertAttributeChangesEventually(javaProcess2, EnrichedVanillaJavaAppImpl.AVG1); 
-        EntityTestUtils.assertAttributeChangesEventually(javaProcess2, EnrichedVanillaJavaAppImpl.AVG2);
-        LOG.info("Avg now "+javaProcess2.getAttribute(EnrichedVanillaJavaAppImpl.AVG1));
-        
-        // and check we don't have too many
-        Assert.assertEquals(javaProcess2.getEnrichers().size(), javaProcess.getEnrichers().size());
-    }
-
-    public static class EnrichedVanillaJavaAppImpl extends VanillaJavaAppImpl {
-        private static final AttributeSensor<Double> AVG1 = Sensors.newDoubleSensor("avg1");
-        private static final AttributeSensor<Double> AVG2 = Sensors.newDoubleSensor("avg2");
-        
-        @Override
-        public void onManagementStarted() {
-            super.onManagementStarted();
-            LOG.info("mgmt started for "+this);
-            addEnricher(new RollingTimeWindowMeanEnricher<Double>(this, PROCESS_CPU_TIME, AVG1, Duration.TEN_SECONDS));
-        }
-        @Override
-        protected void connectSensors() {
-            super.connectSensors();
-            LOG.info("connecting sensors for "+this);
-            addEnricher(new RollingTimeWindowMeanEnricher<Double>(this, PROCESS_CPU_TIME, AVG2, Duration.TEN_SECONDS));
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/64c2b2e5/software/base/src/test/java/brooklyn/entity/java/VanillaJavaAppTest.java
----------------------------------------------------------------------
diff --git a/software/base/src/test/java/brooklyn/entity/java/VanillaJavaAppTest.java b/software/base/src/test/java/brooklyn/entity/java/VanillaJavaAppTest.java
deleted file mode 100644
index 072c7f8..0000000
--- a/software/base/src/test/java/brooklyn/entity/java/VanillaJavaAppTest.java
+++ /dev/null
@@ -1,350 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package brooklyn.entity.java;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertTrue;
-
-import java.net.MalformedURLException;
-import java.security.KeyStore;
-import java.security.PrivateKey;
-import java.security.cert.Certificate;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.Callable;
-import java.util.concurrent.CopyOnWriteArrayList;
-
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXServiceURL;
-import javax.net.ssl.KeyManagerFactory;
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.SSLSocketFactory;
-import javax.net.ssl.TrustManager;
-
-import org.apache.brooklyn.api.entity.EntitySpec;
-import org.apache.brooklyn.api.internal.EntityLocal;
-import org.apache.brooklyn.api.sensor.SensorEvent;
-import org.apache.brooklyn.api.sensor.SensorEventListener;
-import org.apache.brooklyn.core.test.entity.TestApplication;
-import org.apache.brooklyn.entity.core.Entities;
-import org.apache.brooklyn.entity.lifecycle.Lifecycle;
-import org.apache.brooklyn.test.Asserts;
-import org.apache.brooklyn.util.collections.MutableMap;
-import org.apache.brooklyn.util.core.ResourceUtils;
-import org.apache.brooklyn.util.core.crypto.FluentKeySigner;
-import org.apache.brooklyn.util.core.crypto.SecureKeys;
-import org.apache.brooklyn.util.crypto.SslTrustUtils;
-import org.apache.brooklyn.util.jmx.jmxmp.JmxmpAgent;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import brooklyn.event.feed.jmx.JmxHelper;
-
-import org.apache.brooklyn.location.basic.LocalhostMachineProvisioningLocation;
-import org.apache.brooklyn.location.basic.PortRanges;
-
-import com.google.common.base.Predicate;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Maps;
-
-public class VanillaJavaAppTest {
-
-    private static final Logger LOG = LoggerFactory.getLogger(VanillaJavaAppTest.class);
-    
-    private static final long TIMEOUT_MS = 10*1000;
-
-    // Static attributes such as number of processors and start time are only polled every 60 seconds
-    // so if they are not immediately available, it will be 60 seconds before they are polled again
-    private static final Object LONG_TIMEOUT_MS = 61*1000;
-
-    private static String BROOKLYN_THIS_CLASSPATH = null;
-    private static Class<?> MAIN_CLASS = ExampleVanillaMain.class;
-    private static Class<?> MAIN_CPU_HUNGRY_CLASS = ExampleVanillaMainCpuHungry.class;
-    
-    private TestApplication app;
-    private LocalhostMachineProvisioningLocation loc;
-
-    @BeforeMethod(alwaysRun = true)
-    public void setUp() throws Exception {
-        if (BROOKLYN_THIS_CLASSPATH==null) {
-            BROOKLYN_THIS_CLASSPATH = ResourceUtils.create(MAIN_CLASS).getClassLoaderDir();
-        }
-        app = TestApplication.Factory.newManagedInstanceForTests();
-        loc = app.newLocalhostProvisioningLocation(MutableMap.of("address", "localhost"));
-    }
-
-    @AfterMethod(alwaysRun = true)
-    public void tearDown() throws Exception {
-        if (app != null) Entities.destroyAll(app.getManagementContext());
-    }
-
-    @Test
-    public void testReadsConfigFromFlags() throws Exception {
-        final VanillaJavaApp javaProcess = app.createAndManageChild(EntitySpec.create(VanillaJavaApp.class)
-            .configure("main", "my.Main").configure("classpath", ImmutableList.of("c1", "c2"))
-            .configure("args", ImmutableList.of("a1", "a2")));
-
-        assertEquals(javaProcess.getMainClass(), "my.Main");
-        assertEquals(javaProcess.getClasspath(), ImmutableList.of("c1","c2"));
-        assertEquals(javaProcess.getConfig(VanillaJavaApp.ARGS), ImmutableList.of("a1", "a2"));
-    }
-
-    @Test(groups={"WIP", "Integration"})
-    public void testJavaSystemProperties() throws Exception {
-        final VanillaJavaApp javaProcess = app.createAndManageChild(EntitySpec.create(VanillaJavaApp.class)
-            .configure("main", "my.Main").configure("classpath", ImmutableList.of("c1", "c2"))
-            .configure("args", ImmutableList.of("a1", "a2")));
-        ((EntityLocal)javaProcess).setConfig(UsesJava.JAVA_SYSPROPS, ImmutableMap.of("fooKey", "fooValue", "barKey", "barValue"));
-        // TODO: how to test: launch standalone app that outputs system properties to stdout? Probe via JMX?
-    }
-
-    @Test(groups={"Integration"})
-    public void testStartsAndStops() throws Exception {
-        String main = MAIN_CLASS.getCanonicalName();
-        final VanillaJavaApp javaProcess = app.createAndManageChild(EntitySpec.create(VanillaJavaApp.class)
-            .configure("main", main).configure("classpath", ImmutableList.of(BROOKLYN_THIS_CLASSPATH))
-            .configure("args", ImmutableList.of()));
-        app.start(ImmutableList.of(loc));
-        assertEquals(javaProcess.getAttribute(VanillaJavaApp.SERVICE_STATE_ACTUAL), Lifecycle.RUNNING);
-
-        javaProcess.stop();
-        assertEquals(javaProcess.getAttribute(VanillaJavaApp.SERVICE_STATE_ACTUAL), Lifecycle.STOPPED);
-    }
-
-    @Test(groups={"Integration"})
-    public void testHasJvmMXBeanSensorVals() throws Exception {
-        String main = MAIN_CLASS.getCanonicalName();
-        final VanillaJavaApp javaProcess = app.createAndManageChild(EntitySpec.create(VanillaJavaApp.class)
-            .configure("main", main).configure("classpath", ImmutableList.of(BROOKLYN_THIS_CLASSPATH))
-            .configure("args", ImmutableList.of()));
-        app.start(ImmutableList.of(loc));
-        
-        // Memory MXBean
-        Asserts.succeedsEventually(MutableMap.of("timeout", TIMEOUT_MS), new Runnable() {
-            public void run() {
-                assertNotNull(javaProcess.getAttribute(VanillaJavaApp.NON_HEAP_MEMORY_USAGE));
-                long init = javaProcess.getAttribute(VanillaJavaApp.INIT_HEAP_MEMORY);
-                long used = javaProcess.getAttribute(VanillaJavaApp.USED_HEAP_MEMORY);
-                long committed = javaProcess.getAttribute(VanillaJavaApp.COMMITTED_HEAP_MEMORY);
-                long max = javaProcess.getAttribute(VanillaJavaApp.MAX_HEAP_MEMORY);
-    
-                assertNotNull(used);
-                assertNotNull(init);
-                assertNotNull(committed);
-                assertNotNull(max);
-                assertTrue(init <= max, String.format("init %d > max %d heap memory", init, max));
-                assertTrue(used <= committed, String.format("used %d > committed %d heap memory", used, committed));
-                assertTrue(committed <= max, String.format("committed %d > max %d heap memory", committed, max));
-            }});
-        
-        // Threads MX Bean
-        Asserts.succeedsEventually(MutableMap.of("timeout", TIMEOUT_MS), new Runnable() {
-            public void run() {
-                long current = javaProcess.getAttribute(VanillaJavaApp.CURRENT_THREAD_COUNT);
-                long peak = javaProcess.getAttribute(VanillaJavaApp.PEAK_THREAD_COUNT);
-    
-                assertNotNull(current);
-                assertNotNull(peak);
-                assertTrue(current <= peak, String.format("current %d > peak %d thread count", current, peak));
-            }});
-
-        // Runtime MX Bean
-        Asserts.succeedsEventually(MutableMap.of("timeout", LONG_TIMEOUT_MS), new Runnable() {
-            public void run() {
-                assertNotNull(javaProcess.getAttribute(VanillaJavaApp.START_TIME));
-                assertNotNull(javaProcess.getAttribute(VanillaJavaApp.UP_TIME));
-            }});
-        
-        // Operating System MX Bean
-        Asserts.succeedsEventually(MutableMap.of("timeout", LONG_TIMEOUT_MS), new Runnable() {
-            public void run() {
-                assertNotNull(javaProcess.getAttribute(VanillaJavaApp.PROCESS_CPU_TIME));
-                assertNotNull(javaProcess.getAttribute(VanillaJavaApp.SYSTEM_LOAD_AVERAGE));
-                assertNotNull(javaProcess.getAttribute(VanillaJavaApp.AVAILABLE_PROCESSORS));
-                assertNotNull(javaProcess.getAttribute(VanillaJavaApp.TOTAL_PHYSICAL_MEMORY_SIZE));
-                assertNotNull(javaProcess.getAttribute(VanillaJavaApp.FREE_PHYSICAL_MEMORY_SIZE));
-            }});
-        // TODO work on providing useful metrics from garbage collector MX Bean
-        // assertNotNull(javaProcess.getAttribute(VanillaJavaApp.GARBAGE_COLLECTION_TIME)) TODO: work on providing this
-    }
-    
-    @Test(groups={"Integration"})
-    public void testJvmMXBeanProcessCpuTimeGivesNonZeroPercentage() throws Exception {
-        String main = MAIN_CPU_HUNGRY_CLASS.getCanonicalName();
-        final VanillaJavaApp javaProcess = app.createAndManageChild(EntitySpec.create(VanillaJavaApp.class)
-            .configure("main", main).configure("classpath", ImmutableList.of(BROOKLYN_THIS_CLASSPATH))
-            .configure("args", ImmutableList.of()));
-        app.start(ImmutableList.of(loc));
-
-        JavaAppUtils.connectJavaAppServerPolicies((EntityLocal)javaProcess);
-        
-        final List<Double> fractions = new CopyOnWriteArrayList<Double>();
-        app.getManagementContext().getSubscriptionManager().subscribe(javaProcess, VanillaJavaApp.PROCESS_CPU_TIME_FRACTION_LAST, new SensorEventListener<Double>() {
-                public void onEvent(SensorEvent<Double> event) {
-                    fractions.add(event.getValue());
-                }});
-        
-        // Expect non-trivial load to be generated by the process.
-        // Expect load to be in the right order of magnitude (to ensure we haven't got a decimal point in the wrong place etc);
-        // But with multi-core could get big number; and on jenkins@releng3 we once saw [11.9, 0.6, 0.5]!
-        Asserts.succeedsEventually(new Runnable() {
-            public void run() {
-                Iterable<Double> nonTrivialFractions = Iterables.filter(fractions, new Predicate<Double>() {
-                        public boolean apply(Double input) {
-                            return input > 0.01;
-                        }});
-                assertTrue(Iterables.size(nonTrivialFractions) > 3, "fractions="+fractions); 
-            }});
-
-        Iterable<Double> tooBigFractions = Iterables.filter(fractions, new Predicate<Double>() {
-                public boolean apply(Double input) {
-                    return input > 50;
-                }});
-        assertTrue(Iterables.isEmpty(tooBigFractions), "fractions="+fractions); 
-        
-        Iterable<Double> ballparkRightFractions = Iterables.filter(fractions, new Predicate<Double>() {
-                public boolean apply(Double input) {
-                    return input > 0.01 && input < 4;
-                }});
-        assertTrue(Iterables.size(ballparkRightFractions) >= (fractions.size() / 2), "fractions="+fractions);
-        
-        LOG.info("VanillaJavaApp->ExampleVanillaMainCpuHuntry: ProcessCpuTime fractions="+fractions);
-    }
-
-    @Test(groups={"Integration"})
-    public void testStartsWithJmxPortSpecifiedInConfig() throws Exception {
-        int port = 53405;
-        String main = MAIN_CLASS.getCanonicalName();
-        VanillaJavaApp javaProcess = app.createAndManageChild(EntitySpec.create(VanillaJavaApp.class)
-            .configure("main", main).configure("classpath", ImmutableList.of(BROOKLYN_THIS_CLASSPATH))
-            .configure("args", ImmutableList.of()));
-        ((EntityLocal)javaProcess).setConfig(UsesJmx.JMX_PORT, PortRanges.fromInteger(port));
-        app.start(ImmutableList.of(loc));
-
-        assertEquals(javaProcess.getAttribute(UsesJmx.JMX_PORT), (Integer)port);
-    }
-
-    // FIXME Way test was written requires JmxSensorAdapter; need to rewrite...  
-    @Test(groups={"Integration", "WIP"})
-    public void testStartsWithSecureJmxPortSpecifiedInConfig() throws Exception {
-        int port = 53406;
-        String main = MAIN_CLASS.getCanonicalName();
-        final VanillaJavaApp javaProcess = app.createAndManageChild(EntitySpec.create(VanillaJavaApp.class)
-            .configure("main", main).configure("classpath", ImmutableList.of(BROOKLYN_THIS_CLASSPATH))
-            .configure("args", ImmutableList.of()));
-        ((EntityLocal)javaProcess).setConfig(UsesJmx.JMX_PORT, PortRanges.fromInteger(port));
-        ((EntityLocal)javaProcess).setConfig(UsesJmx.JMX_SSL_ENABLED, true);
-        
-        app.start(ImmutableList.of(loc));
-        // will fail above if JMX can't connect, but also do some add'l checks
-        
-        assertEquals(javaProcess.getAttribute(UsesJmx.JMX_PORT), (Integer)port);
-
-        // good key+cert succeeds
-        new AsserterForJmxConnection(javaProcess)
-                .customizeSocketFactory(null, null)
-                .connect();
-        
-        // bad cert fails
-        Asserts.assertFails(new Callable<Void>() {
-            public Void call() throws Exception {
-                new AsserterForJmxConnection(javaProcess)
-                        .customizeSocketFactory(null, new FluentKeySigner("cheater").newCertificateFor("jmx-access-key", SecureKeys.newKeyPair()))
-                        .connect();
-                return null;
-            }});
-
-        // bad key fails
-        Asserts.assertFails(new Callable<Void>() {
-            public Void call() throws Exception {
-                new AsserterForJmxConnection(javaProcess)
-                        .customizeSocketFactory(SecureKeys.newKeyPair().getPrivate(), null)
-                        .connect();
-                return null;
-            }});
-        
-        // bad profile fails
-        Asserts.assertFails(new Callable<Void>() {
-            public Void call() throws Exception {
-                AsserterForJmxConnection asserter = new AsserterForJmxConnection(javaProcess);
-                asserter.putEnv("jmx.remote.profiles", JmxmpAgent.TLS_JMX_REMOTE_PROFILES);
-                asserter.customizeSocketFactory(SecureKeys.newKeyPair().getPrivate(), null)
-                        .connect();
-                return null;
-            }});
-    }
-
-    private static class AsserterForJmxConnection {
-        final VanillaJavaApp entity;
-        final JMXServiceURL url;
-        final Map<String,Object> env;
-        
-        @SuppressWarnings("unchecked")
-        public AsserterForJmxConnection(VanillaJavaApp e) throws MalformedURLException {
-            this.entity = e;
-            
-            JmxHelper jmxHelper = new JmxHelper((EntityLocal)entity);
-            this.url = new JMXServiceURL(jmxHelper.getUrl());
-            this.env = Maps.newLinkedHashMap(jmxHelper.getConnectionEnvVars());
-        }
-        
-        public JMXServiceURL getJmxUrl() throws MalformedURLException {
-            return url;
-        }
-        
-        public void putEnv(String key, Object val) {
-            env.put(key, val);
-        }
-        
-        public AsserterForJmxConnection customizeSocketFactory(PrivateKey customKey, Certificate customCert) throws Exception {
-            PrivateKey key = (customKey == null) ? entity.getConfig(UsesJmx.JMX_SSL_ACCESS_KEY) : customKey;
-            Certificate cert = (customCert == null) ? entity.getConfig(UsesJmx.JMX_SSL_ACCESS_CERT) : customCert;
-            
-            KeyStore ks = SecureKeys.newKeyStore();
-            KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
-            if (key!=null) {
-                ks.setKeyEntry("brooklyn-jmx-access", key, "".toCharArray(), new Certificate[] {cert});
-            }
-            kmf.init(ks, "".toCharArray());
-
-            TrustManager tms =
-            // TODO use root cert for trusting server
-            //trustStore!=null ? SecureKeys.getTrustManager(trustStore) :
-                SslTrustUtils.TRUST_ALL;
-
-            SSLContext ctx = SSLContext.getInstance("TLSv1");
-            ctx.init(kmf.getKeyManagers(), new TrustManager[] {tms}, null);
-            SSLSocketFactory ssf = ctx.getSocketFactory();
-            env.put(JmxmpAgent.TLS_SOCKET_FACTORY_PROPERTY, ssf);
-            
-            return this;
-        }
-        
-        public JMXConnector connect() throws Exception {
-            return JMXConnectorFactory.connect(getJmxUrl(), env);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/64c2b2e5/software/base/src/test/java/brooklyn/entity/machine/MachineEntityEc2LiveTest.java
----------------------------------------------------------------------
diff --git a/software/base/src/test/java/brooklyn/entity/machine/MachineEntityEc2LiveTest.java b/software/base/src/test/java/brooklyn/entity/machine/MachineEntityEc2LiveTest.java
deleted file mode 100644
index 717ee30..0000000
--- a/software/base/src/test/java/brooklyn/entity/machine/MachineEntityEc2LiveTest.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package brooklyn.entity.machine;
-
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertTrue;
-
-import org.apache.brooklyn.api.entity.EntitySpec;
-import org.apache.brooklyn.api.location.Location;
-import org.apache.brooklyn.test.Asserts;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-
-import brooklyn.entity.AbstractEc2LiveTest;
-
-public class MachineEntityEc2LiveTest extends AbstractEc2LiveTest {
-
-    @Override
-    protected void doTest(Location loc) throws Exception {
-        final MachineEntity server = app.createAndManageChild(EntitySpec.create(MachineEntity.class));
-        
-        app.start(ImmutableList.of(loc));
-        
-        Asserts.succeedsEventually(new Runnable() {
-            @Override public void run() {
-                assertNotNull(server.getAttribute(MachineEntity.UPTIME));
-                assertNotNull(server.getAttribute(MachineEntity.LOAD_AVERAGE));
-                assertNotNull(server.getAttribute(MachineEntity.CPU_USAGE));
-                assertNotNull(server.getAttribute(MachineEntity.FREE_MEMORY));
-                assertNotNull(server.getAttribute(MachineEntity.TOTAL_MEMORY));
-                assertNotNull(server.getAttribute(MachineEntity.USED_MEMORY));
-            }});
-        
-        String result = server.execCommand("MY_ENV=myval && echo start $MY_ENV");
-        assertTrue(result.contains("start myval"), "result="+result);
-    }
-    
-    @Test(enabled=false)
-    public void testDummy() {} // Convince testng IDE integration that this really does have test methods
-}

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/64c2b2e5/software/base/src/test/java/brooklyn/entity/machine/MachineEntityRebindTest.java
----------------------------------------------------------------------
diff --git a/software/base/src/test/java/brooklyn/entity/machine/MachineEntityRebindTest.java b/software/base/src/test/java/brooklyn/entity/machine/MachineEntityRebindTest.java
deleted file mode 100644
index ae85c23..0000000
--- a/software/base/src/test/java/brooklyn/entity/machine/MachineEntityRebindTest.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package brooklyn.entity.machine;
-
-import org.apache.brooklyn.api.entity.Entity;
-import org.apache.brooklyn.api.entity.EntitySpec;
-import org.apache.brooklyn.core.mgmt.rebind.RebindTestFixtureWithApp;
-import org.apache.brooklyn.entity.core.Attributes;
-import org.apache.brooklyn.entity.lifecycle.Lifecycle;
-import org.apache.brooklyn.test.EntityTestUtils;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-
-import brooklyn.entity.basic.EmptySoftwareProcess;
-
-public class MachineEntityRebindTest extends RebindTestFixtureWithApp {
-
-    @Test(groups = "Integration")
-    public void testRebindToMachineEntity() throws Exception {
-        EmptySoftwareProcess machine = origApp.createAndManageChild(EntitySpec.create(EmptySoftwareProcess.class));
-        origApp.start(ImmutableList.of(origManagementContext.getLocationRegistry().resolve("localhost")));
-        EntityTestUtils.assertAttributeEqualsEventually(machine, Attributes.SERVICE_STATE_ACTUAL, Lifecycle.RUNNING);
-        rebind(false);
-        Entity machine2 = newManagementContext.getEntityManager().getEntity(machine.getId());
-        EntityTestUtils.assertAttributeEqualsEventually(machine2, Attributes.SERVICE_STATE_ACTUAL, Lifecycle.RUNNING);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/64c2b2e5/software/base/src/test/java/brooklyn/entity/pool/AbstractServerPoolTest.java
----------------------------------------------------------------------
diff --git a/software/base/src/test/java/brooklyn/entity/pool/AbstractServerPoolTest.java b/software/base/src/test/java/brooklyn/entity/pool/AbstractServerPoolTest.java
deleted file mode 100644
index 2470dd9..0000000
--- a/software/base/src/test/java/brooklyn/entity/pool/AbstractServerPoolTest.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package brooklyn.entity.pool;
-
-import static org.testng.Assert.fail;
-
-import java.util.List;
-
-import org.apache.brooklyn.api.entity.EntitySpec;
-import org.apache.brooklyn.api.location.Location;
-import org.apache.brooklyn.api.location.LocationSpec;
-import org.apache.brooklyn.api.location.NoMachinesAvailableException;
-import org.apache.brooklyn.api.mgmt.ManagementContext;
-import org.apache.brooklyn.core.test.entity.LocalManagementContextForTests;
-import org.apache.brooklyn.core.test.entity.TestApplication;
-import org.apache.brooklyn.entity.core.Attributes;
-import org.apache.brooklyn.entity.core.BrooklynConfigKeys;
-import org.apache.brooklyn.entity.core.Entities;
-import org.apache.brooklyn.entity.factory.ApplicationBuilder;
-import org.apache.brooklyn.test.EntityTestUtils;
-import org.apache.brooklyn.util.exceptions.Exceptions;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-
-import brooklyn.entity.basic.EmptySoftwareProcess;
-
-import org.apache.brooklyn.location.basic.LocalhostMachineProvisioningLocation;
-
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Lists;
-
-public abstract class AbstractServerPoolTest {
-
-    // Note not extending BrooklynAppUnitTestSupport because sub-classes of this are for live and for unit tests.
-    // Instead, we have to repeat that logic for setting SKIP_ON_BOX_BASE_DIR_RESOLUTION
-    
-    private static final int DEFAULT_POOL_SIZE = 3;
-
-    protected Location location;
-    protected ManagementContext mgmt;
-    protected TestApplication poolApp;
-    protected ServerPool pool;
-    private List<TestApplication> createdApps = Lists.newLinkedList();
-
-    @BeforeMethod(alwaysRun=true)
-    public void setUp() throws Exception {
-        createdApps.clear();
-        mgmt = createManagementContext();
-        location = createLocation();
-        EntitySpec<TestApplication> appSpec = EntitySpec.create(TestApplication.class)
-                .configure(BrooklynConfigKeys.SKIP_ON_BOX_BASE_DIR_RESOLUTION, shouldSkipOnBoxBaseDirResolution());
-        poolApp = ApplicationBuilder.newManagedApp(appSpec, mgmt);
-
-        pool = poolApp.createAndManageChild(EntitySpec.create(ServerPool.class)
-                .configure(ServerPool.INITIAL_SIZE, getInitialPoolSize())
-                .configure(ServerPool.MEMBER_SPEC, EntitySpec.create(EmptySoftwareProcess.class)));
-        poolApp.start(ImmutableList.of(location));
-        EntityTestUtils.assertAttributeEqualsEventually(pool, Attributes.SERVICE_UP, true);
-        assertAvailableCountEventuallyEquals(getInitialPoolSize());
-    }
-
-    @AfterMethod(alwaysRun=true)
-    public void tearDown() throws Exception {
-        // Kills the apps before terminating the pool
-        for (TestApplication app : createdApps) {
-            Entities.destroy(app);
-        }
-        if (mgmt != null) {
-            Entities.destroyAll(mgmt);
-            mgmt = null;
-        }
-    }
-
-    protected int getInitialPoolSize() {
-        return DEFAULT_POOL_SIZE;
-    }
-
-    protected ManagementContext createManagementContext() {
-        return new LocalManagementContextForTests();
-    }
-    
-    protected boolean shouldSkipOnBoxBaseDirResolution() {
-        return true;
-    }
-
-    /** @return Creates a LocalhostMachineProvisioningLocation */
-    protected Location createLocation() {
-        return mgmt.getLocationManager().createLocation(LocationSpec.create(LocalhostMachineProvisioningLocation.class));
-    }
-
-    protected void assertNoMachinesAvailableForApp(TestApplication app) {
-        try {
-            app.start(ImmutableList.of(pool.getDynamicLocation()));
-            fail("Expected exception when starting app with too many entities for pool");
-        } catch (Exception e) {
-            Throwable t = Exceptions.getFirstThrowableOfType(e, NoMachinesAvailableException.class);
-            if (t == null) {
-                throw new RuntimeException(e);
-            }
-        }
-    }
-
-    protected void assertAvailableCountEventuallyEquals(int count) {
-        assertAvailableCountEventuallyEquals(pool, count);
-    }
-
-    protected void assertAvailableCountEventuallyEquals(ServerPool pool, int count) {
-        EntityTestUtils.assertAttributeEqualsEventually(pool, ServerPool.AVAILABLE_COUNT, count);
-    }
-
-    protected void assertClaimedCountEventuallyEquals(int count) {
-        assertClaimedCountEventuallyEquals(pool, count);
-    }
-
-    protected void assertClaimedCountEventuallyEquals(ServerPool pool, Integer count) {
-        EntityTestUtils.assertAttributeEqualsEventually(pool, ServerPool.CLAIMED_COUNT, count);
-    }
-
-    protected TestApplication createAppWithChildren(int numChildren) {
-        if (numChildren < 0) fail("Invalid number of children for app: " + numChildren);
-        EntitySpec<TestApplication> appSpec = EntitySpec.create(TestApplication.class)
-                .configure(BrooklynConfigKeys.SKIP_ON_BOX_BASE_DIR_RESOLUTION, shouldSkipOnBoxBaseDirResolution());
-        TestApplication app = ApplicationBuilder.newManagedApp(appSpec, mgmt);
-        while (numChildren-- > 0) {
-            app.createAndManageChild(EntitySpec.create(EmptySoftwareProcess.class));
-        }
-        createdApps.add(app);
-        return app;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/64c2b2e5/software/base/src/test/java/brooklyn/entity/pool/ServerPoolLiveTest.java
----------------------------------------------------------------------
diff --git a/software/base/src/test/java/brooklyn/entity/pool/ServerPoolLiveTest.java b/software/base/src/test/java/brooklyn/entity/pool/ServerPoolLiveTest.java
deleted file mode 100644
index 8520a88..0000000
--- a/software/base/src/test/java/brooklyn/entity/pool/ServerPoolLiveTest.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package brooklyn.entity.pool;
-
-import static org.testng.Assert.assertTrue;
-
-import java.util.Map;
-
-import org.apache.brooklyn.api.entity.Entity;
-import org.apache.brooklyn.api.location.Location;
-import org.apache.brooklyn.api.mgmt.ManagementContext;
-import org.apache.brooklyn.core.internal.BrooklynProperties;
-import org.apache.brooklyn.core.test.entity.LocalManagementContextForTests;
-import org.apache.brooklyn.core.test.entity.TestApplication;
-import org.apache.brooklyn.entity.core.Attributes;
-import org.apache.brooklyn.util.collections.MutableMap;
-import org.testng.annotations.Test;
-
-import com.google.common.base.CaseFormat;
-import com.google.common.collect.ImmutableList;
-
-public class ServerPoolLiveTest extends AbstractServerPoolTest {
-
-    public static final String PROVIDER = "softlayer";
-
-    protected BrooklynProperties brooklynProperties;
-
-    @Override
-    protected Location createLocation() {
-        // Image: {id=CENTOS_6_64, providerId=CENTOS_6_64, os={family=centos, version=6.5, description=CentOS / CentOS / 6.5-64 LAMP for Bare Metal, is64Bit=true}, description=CENTOS_6_64, status=AVAILABLE, loginUser=root}
-        Map<String, ?> allFlags = MutableMap.<String, Object>builder()
-                .put("provider", PROVIDER)
-                .put("tags", ImmutableList.of(getClass().getName()))
-                .put("vmNameMaxLength", 30)
-                .put("imageId", "CENTOS_6_64")
-                .build();
-        return mgmt.getLocationRegistry().resolve(PROVIDER, allFlags);
-    }
-
-    @Override
-    protected ManagementContext createManagementContext() {
-        String[] propsToRemove = new String[]{"imageId", "imageDescriptionRegex", "imageNameRegex", "inboundPorts", "hardwareId", "minRam"};
-
-        // Don't let any defaults from brooklyn.properties (except credentials) interfere with test
-        brooklynProperties = BrooklynProperties.Factory.newDefault();
-        for (String propToRemove : propsToRemove) {
-            for (String propVariant : ImmutableList.of(propToRemove, CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_HYPHEN, propToRemove))) {
-                brooklynProperties.remove("brooklyn.locations.jclouds." + PROVIDER + "." + propVariant);
-                brooklynProperties.remove("brooklyn.locations." + propVariant);
-                brooklynProperties.remove("brooklyn.jclouds." + PROVIDER + "." + propVariant);
-                brooklynProperties.remove("brooklyn.jclouds." + propVariant);
-            }
-        }
-
-        // Also removes scriptHeader (e.g. if doing `. ~/.bashrc` and `. ~/.profile`, then that can cause "stdin: is not a tty")
-        brooklynProperties.remove("brooklyn.ssh.config.scriptHeader");
-        return new LocalManagementContextForTests(brooklynProperties);
-    }
-
-    protected boolean shouldSkipOnBoxBaseDirResolution() {
-        return false;
-    }
-
-    @Override
-    protected int getInitialPoolSize() {
-        return 1;
-    }
-
-    @Test(groups = "Live")
-    public void testAppCanBeDeployedToPool() {
-        TestApplication app = createAppWithChildren(1);
-        app.start(ImmutableList.of(pool.getDynamicLocation()));
-        assertTrue(app.getAttribute(Attributes.SERVICE_UP));
-        for (Entity child : app.getChildren()) {
-            assertTrue(child.getAttribute(Attributes.SERVICE_UP));
-        }
-        TestApplication app2 = createAppWithChildren(1);
-        assertNoMachinesAvailableForApp(app2);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/64c2b2e5/software/base/src/test/java/brooklyn/entity/pool/ServerPoolLocationResolverTest.java
----------------------------------------------------------------------
diff --git a/software/base/src/test/java/brooklyn/entity/pool/ServerPoolLocationResolverTest.java b/software/base/src/test/java/brooklyn/entity/pool/ServerPoolLocationResolverTest.java
deleted file mode 100644
index 7edbb90..0000000
--- a/software/base/src/test/java/brooklyn/entity/pool/ServerPoolLocationResolverTest.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package brooklyn.entity.pool;
-
-import static org.testng.Assert.assertEquals;
-
-import java.util.Map;
-
-import org.apache.brooklyn.api.entity.Entity;
-import org.apache.brooklyn.api.entity.EntitySpec;
-import org.apache.brooklyn.api.location.Location;
-import org.apache.brooklyn.api.location.LocationSpec;
-import org.apache.brooklyn.core.internal.BrooklynProperties;
-import org.apache.brooklyn.core.mgmt.internal.LocalManagementContext;
-import org.apache.brooklyn.core.test.entity.LocalManagementContextForTests;
-import org.apache.brooklyn.core.test.entity.TestApplication;
-import org.apache.brooklyn.entity.core.Entities;
-import org.apache.brooklyn.entity.factory.ApplicationBuilder;
-import org.apache.brooklyn.util.collections.MutableMap;
-import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-
-import brooklyn.entity.basic.EmptySoftwareProcess;
-
-import org.apache.brooklyn.location.basic.LocalhostMachineProvisioningLocation;
-import org.apache.brooklyn.location.dynamic.DynamicLocation;
-
-public class ServerPoolLocationResolverTest {
-
-    private LocalManagementContext managementContext;
-    private Entity locationOwner;
-
-    @BeforeMethod(alwaysRun=true)
-    public void setUp() throws Exception {
-        managementContext = new LocalManagementContextForTests(BrooklynProperties.Factory.newEmpty());
-        TestApplication t = ApplicationBuilder.newManagedApp(TestApplication.class, managementContext);
-        locationOwner = t.createAndManageChild(EntitySpec.create(ServerPool.class)
-                .configure(ServerPool.INITIAL_SIZE, 0)
-                .configure(ServerPool.MEMBER_SPEC, EntitySpec.create(EmptySoftwareProcess.class)));
-        Location poolLocation = managementContext.getLocationManager()
-                .createLocation(LocationSpec.create(LocalhostMachineProvisioningLocation.class));
-        t.start(ImmutableList.of(poolLocation));
-    }
-
-    @AfterMethod(alwaysRun=true)
-    public void tearDown() throws Exception {
-        if (managementContext != null) Entities.destroyAll(managementContext);
-    }
-
-    @Test
-    public void testResolve() {
-        ServerPoolLocation location = resolve("pool:" + locationOwner.getId());
-        assertEquals(location.getOwner().getId(), locationOwner.getId());
-    }
-
-    @Test
-    public void testSetsDisplayName() {
-        ServerPoolLocation location = resolve("pool:" + locationOwner.getId() + ":(displayName=xyz)");
-        assertEquals(location.getDisplayName(), "xyz");
-    }
-
-    private ServerPoolLocation resolve(String val) {
-        Map<String, Object> flags = MutableMap.<String, Object>of(DynamicLocation.OWNER.getName(), locationOwner);
-        Location l = managementContext.getLocationRegistry().resolve(val, flags);
-        Assert.assertNotNull(l);
-        return (ServerPoolLocation) l;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/64c2b2e5/software/base/src/test/java/brooklyn/entity/pool/ServerPoolRebindTest.java
----------------------------------------------------------------------
diff --git a/software/base/src/test/java/brooklyn/entity/pool/ServerPoolRebindTest.java b/software/base/src/test/java/brooklyn/entity/pool/ServerPoolRebindTest.java
deleted file mode 100644
index 19c3e36..0000000
--- a/software/base/src/test/java/brooklyn/entity/pool/ServerPoolRebindTest.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package brooklyn.entity.pool;
-
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertTrue;
-
-import java.io.File;
-import java.util.Collection;
-
-import org.apache.brooklyn.api.entity.Application;
-import org.apache.brooklyn.api.entity.Entity;
-import org.apache.brooklyn.api.mgmt.ManagementContext;
-import org.apache.brooklyn.core.mgmt.internal.LocalManagementContext;
-import org.apache.brooklyn.core.mgmt.rebind.RebindOptions;
-import org.apache.brooklyn.core.mgmt.rebind.RebindTestUtils;
-import org.apache.brooklyn.core.test.entity.TestApplication;
-import org.apache.brooklyn.entity.core.Attributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.Test;
-
-import com.google.common.base.Optional;
-import com.google.common.base.Predicates;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Iterables;
-import com.google.common.io.Files;
-
-public class ServerPoolRebindTest extends AbstractServerPoolTest {
-
-    private static final Logger LOG = LoggerFactory.getLogger(ServerPoolRebindTest.class);
-    private ClassLoader classLoader = getClass().getClassLoader();
-    private File mementoDir;
-
-    @Override
-    protected ManagementContext createManagementContext() {
-        mementoDir = Files.createTempDir();
-        return RebindTestUtils.newPersistingManagementContext(mementoDir, classLoader);
-    }
-
-    @Override
-    @AfterMethod(alwaysRun = true)
-    public void tearDown() throws Exception {
-        super.tearDown();
-        if (mementoDir != null) RebindTestUtils.deleteMementoDir(mementoDir);
-    }
-
-    private Collection<Application> rebind(TestApplication app) throws Exception {
-        LOG.info("Rebind start");
-        RebindTestUtils.waitForPersisted(app);
-        ((LocalManagementContext) app.getManagementContext()).terminate();
-        Collection<Application> r = RebindTestUtils.rebindAll(RebindOptions.create().mementoDir(mementoDir).classLoader(classLoader));
-        LOG.info("Rebind complete");
-        return r;
-    }
-
-    @Test(enabled = false)
-    public void testRebindingToPool() throws Exception {
-        TestApplication app = createAppWithChildren(1);
-        app.start(ImmutableList.of(pool.getDynamicLocation()));
-        assertTrue(app.getAttribute(Attributes.SERVICE_UP));
-        assertAvailableCountEventuallyEquals(pool, getInitialPoolSize() - 1);
-        assertClaimedCountEventuallyEquals(pool, 1);
-
-        Collection<Application> reboundApps = rebind(poolApp);
-        ServerPool reboundPool = null;
-        for (Application reboundApp : reboundApps) {
-            Optional<Entity> np = Iterables.tryFind(reboundApp.getChildren(), Predicates.instanceOf(ServerPool.class));
-            if (np.isPresent()) {
-                mgmt = reboundApp.getManagementContext();
-                reboundPool = (ServerPool) np.get();
-                break;
-            }
-        }
-
-        assertNotNull(reboundPool, "No app in rebound context has " + ServerPool.class.getName() +
-                " child. Apps: " + reboundApps);
-        assertNotNull(reboundPool.getDynamicLocation());
-        assertTrue(reboundPool.getAttribute(Attributes.SERVICE_UP));
-        assertAvailableCountEventuallyEquals(reboundPool, getInitialPoolSize() - 1);
-        assertClaimedCountEventuallyEquals(reboundPool, 1);
-
-        TestApplication app2 = createAppWithChildren(1);
-        app2.start(ImmutableList.of(reboundPool.getDynamicLocation()));
-        assertTrue(app2.getAttribute(Attributes.SERVICE_UP));
-        assertAvailableCountEventuallyEquals(reboundPool, getInitialPoolSize() - 2);
-        assertClaimedCountEventuallyEquals(reboundPool, 2);
-
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/64c2b2e5/software/base/src/test/java/brooklyn/entity/pool/ServerPoolTest.java
----------------------------------------------------------------------
diff --git a/software/base/src/test/java/brooklyn/entity/pool/ServerPoolTest.java b/software/base/src/test/java/brooklyn/entity/pool/ServerPoolTest.java
deleted file mode 100644
index d0310e2..0000000
--- a/software/base/src/test/java/brooklyn/entity/pool/ServerPoolTest.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package brooklyn.entity.pool;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
-import static org.testng.Assert.assertTrue;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.apache.brooklyn.api.entity.Entity;
-import org.apache.brooklyn.api.location.LocationSpec;
-import org.apache.brooklyn.core.test.entity.TestApplication;
-import org.apache.brooklyn.entity.core.Attributes;
-import org.apache.brooklyn.entity.lifecycle.Lifecycle;
-import org.apache.brooklyn.test.EntityTestUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testng.annotations.Test;
-import org.apache.brooklyn.location.basic.LocalhostMachineProvisioningLocation.LocalhostMachine;
-
-import com.google.common.base.Joiner;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Iterables;
-
-public class ServerPoolTest extends AbstractServerPoolTest {
-
-    private static final Logger LOG = LoggerFactory.getLogger(ServerPoolTest.class);
-
-    @Test
-    public void testAppCanBeDeployedToServerPool() {
-        TestApplication app = createAppWithChildren(1);
-        app.start(ImmutableList.of(pool.getDynamicLocation()));
-        assertTrue(app.getAttribute(Attributes.SERVICE_UP));
-        for (Entity child : app.getChildren()) {
-            assertTrue(child.getAttribute(Attributes.SERVICE_UP));
-        }
-    }
-
-    @Test
-    public void testFailureWhenNotEnoughServersAvailable() {
-        TestApplication app = createAppWithChildren(getInitialPoolSize() + 1);
-        assertNoMachinesAvailableForApp(app);
-        EntityTestUtils.assertAttributeEqualsEventually(app, Attributes.SERVICE_STATE_ACTUAL, Lifecycle.ON_FIRE);
-    }
-
-    @Test
-    public void testDeployReleaseDeploy() {
-        TestApplication app = createAppWithChildren(getInitialPoolSize());
-        TestApplication app2 = createAppWithChildren(1);
-
-        app.start(ImmutableList.of(pool.getDynamicLocation()));
-        EntityTestUtils.assertAttributeEqualsEventually(app, Attributes.SERVICE_UP, true);
-        assertAvailableCountEventuallyEquals(0);
-        assertNoMachinesAvailableForApp(app2);
-
-        app.stop();
-        assertFalse(app.getAttribute(Attributes.SERVICE_UP));
-        assertAvailableCountEventuallyEquals(getInitialPoolSize());
-
-        app2.start(ImmutableList.of(pool.getDynamicLocation()));
-        EntityTestUtils.assertAttributeEqualsEventually(app2, Attributes.SERVICE_UP, true);
-        
-        assertAvailableCountEventuallyEquals(getInitialPoolSize() - 1);
-        assertClaimedCountEventuallyEquals(1);
-    }
-
-    @Test
-    public void testResizingPoolUp() {
-        TestApplication app = createAppWithChildren(getInitialPoolSize());
-        app.start(ImmutableList.of(pool.getDynamicLocation()));
-        assertTrue(app.getAttribute(Attributes.SERVICE_UP));
-
-        TestApplication app2 = createAppWithChildren(1);
-        assertNoMachinesAvailableForApp(app2);
-
-        pool.resizeByDelta(1);
-        
-        assertAvailableCountEventuallyEquals(1);
-
-        assertEquals((int) pool.getCurrentSize(), getInitialPoolSize() + 1);
-        app2.start(ImmutableList.of(pool.getDynamicLocation()));
-        assertTrue(app2.getAttribute(Attributes.SERVICE_UP));
-    }
-
-    @Test
-    public void testResizePoolDownSucceedsWhenEnoughMachinesAreFree() {
-        TestApplication app = createAppWithChildren(1);
-        app.start(ImmutableList.of(pool.getDynamicLocation()));
-        assertAvailableCountEventuallyEquals(getInitialPoolSize() - 1);
-
-        pool.resize(1);
-
-        assertAvailableCountEventuallyEquals(0);
-    }
-
-    @Test
-    public void testResizeDownDoesNotReleaseClaimedMachines() {
-        TestApplication app = createAppWithChildren(getInitialPoolSize() - 1);
-        app.start(ImmutableList.of(pool.getDynamicLocation()));
-        assertAvailableCountEventuallyEquals(1);
-        assertClaimedCountEventuallyEquals(getInitialPoolSize() - 1);
-
-        LOG.info("Test attempting to resize to 0 members. Should only drop the one available machine.");
-        pool.resize(0);
-
-        assertAvailableCountEventuallyEquals(0);
-        assertEquals(Iterables.size(pool.getMembers()), getInitialPoolSize() - 1);
-        assertAvailableCountEventuallyEquals(0);
-        assertClaimedCountEventuallyEquals(getInitialPoolSize() - 1);
-    }
-
-    @Test
-    public void testCanAddExistingMachinesToPool() {
-        TestApplication app = createAppWithChildren(getInitialPoolSize());
-        app.start(ImmutableList.of(pool.getDynamicLocation()));
-        assertAvailableCountEventuallyEquals(0);
-
-        LocalhostMachine loc = mgmt.getLocationManager().createLocation(LocationSpec.create(LocalhostMachine.class));
-        Entity added = pool.addExistingMachine(loc);
-        assertFalse(added.getConfig(ServerPoolImpl.REMOVABLE));
-        assertAvailableCountEventuallyEquals(1);
-
-        TestApplication app2 = createAppWithChildren(1);
-        app2.start(ImmutableList.of(pool.getDynamicLocation()));
-        assertAvailableCountEventuallyEquals(0);
-    }
-
-    @Test
-    public void testExistingMachinesAreNotRemovedFromThePoolOnShrinkButAreOnStop() {
-        LocalhostMachine loc = mgmt.getLocationManager().createLocation(LocationSpec.create(LocalhostMachine.class));
-        pool.addExistingMachine(loc);
-        assertAvailableCountEventuallyEquals(getInitialPoolSize() + 1);
-        pool.resize(0);
-        assertAvailableCountEventuallyEquals(1);
-        pool.stop();
-        assertAvailableCountEventuallyEquals(0);
-    }
-
-    @Test
-    public void testAddExistingMachineFromSpec() {
-        TestApplication app = createAppWithChildren(getInitialPoolSize());
-        app.start(ImmutableList.of(pool.getDynamicLocation()));
-        assertAvailableCountEventuallyEquals(0);
-
-        Collection<Entity> added = pool.addExistingMachinesFromSpec("byon:(hosts=\"localhost,localhost\")");
-        assertEquals(added.size(), 2, "Added: " + Joiner.on(", ").join(added));
-        Iterator<Entity> it = added.iterator();
-        assertFalse(it.next().getConfig(ServerPoolImpl.REMOVABLE));
-        assertFalse(it.next().getConfig(ServerPoolImpl.REMOVABLE));
-        assertAvailableCountEventuallyEquals(2);
-
-        TestApplication app2 = createAppWithChildren(2);
-        app2.start(ImmutableList.of(pool.getDynamicLocation()));
-        assertAvailableCountEventuallyEquals(0);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/64c2b2e5/software/base/src/test/java/brooklyn/entity/service/SystemServiceEnricherTest.java
----------------------------------------------------------------------
diff --git a/software/base/src/test/java/brooklyn/entity/service/SystemServiceEnricherTest.java b/software/base/src/test/java/brooklyn/entity/service/SystemServiceEnricherTest.java
deleted file mode 100644
index 4406f4f..0000000
--- a/software/base/src/test/java/brooklyn/entity/service/SystemServiceEnricherTest.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package brooklyn.entity.service;
-
-import static org.testng.Assert.assertEquals;
-
-import org.apache.brooklyn.api.entity.EntitySpec;
-import org.apache.brooklyn.api.sensor.EnricherSpec;
-import org.apache.brooklyn.core.test.BrooklynAppLiveTestSupport;
-import org.apache.brooklyn.effector.core.EffectorTasks;
-import org.apache.brooklyn.entity.core.Attributes;
-import org.apache.brooklyn.entity.core.Entities;
-import org.apache.brooklyn.entity.core.EntityPredicates;
-import org.apache.brooklyn.entity.lifecycle.Lifecycle;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import brooklyn.entity.basic.VanillaSoftwareProcess;
-import brooklyn.entity.basic.VanillaSoftwareProcessImpl;
-import brooklyn.entity.basic.VanillaSoftwareProcessSshDriver;
-
-import org.apache.brooklyn.location.basic.SshMachineLocation;
-import org.apache.brooklyn.location.jclouds.JcloudsLocation;
-import org.apache.brooklyn.test.Asserts;
-import org.apache.brooklyn.util.ssh.BashCommands;
-import org.apache.brooklyn.util.time.Duration;
-
-import com.google.common.base.Suppliers;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-
-public class SystemServiceEnricherTest extends BrooklynAppLiveTestSupport {
-    //requires /etc/init.d OS, for example CentOS 6.5
-    private static final String LOCATION_SPEC = "named:service-live-test-location";
-    private JcloudsLocation location;
-
-    @Override
-    @BeforeMethod(alwaysRun=true)
-    public void setUp() throws Exception {
-        super.setUp();
-        location = (JcloudsLocation) mgmt.getLocationRegistry().resolve(LOCATION_SPEC);
-    }
-
-    @Test(groups = "Live")
-    public void testRestartLaunchesService() {
-        String launchCmd = "nohup bash -c \"echo \\$\\$ > $PID_FILE; while true; do sleep 1000; done\" &";
-        EntitySpec<VanillaSoftwareProcess> procSpec = EntitySpec.create(VanillaSoftwareProcess.class)
-                .configure(VanillaSoftwareProcess.LAUNCH_COMMAND, launchCmd)
-                .enricher(EnricherSpec.create(SystemServiceEnricher.class));
-        VanillaSoftwareProcess proc = app.createAndManageChild(procSpec);
-        app.start(ImmutableList.of(location));
-
-        waitHealthy(proc);
-
-        SshMachineLocation machine = EffectorTasks.getSshMachine(proc);
-        String pidFile = getPidFile(proc);
-        String killCmd = "kill -9 `cat " + pidFile + "`";
-        machine.execCommands("kill process", ImmutableList.of(killCmd));
-
-        waitFailed(proc);
-
-        int restartCode = machine.execCommands("restart machine", ImmutableList.of(BashCommands.sudo("/sbin/shutdown -r now")));
-        assertEquals(restartCode, 0);
-
-        waitHealthy(proc);
-    }
-
-    private String getPidFile(VanillaSoftwareProcess proc) {
-        VanillaSoftwareProcessImpl impl = (VanillaSoftwareProcessImpl)Entities.deproxy(proc);
-        return ((VanillaSoftwareProcessSshDriver)impl.getDriver()).getPidFile();
-    }
-
-    private void waitFailed(VanillaSoftwareProcess proc) {
-        Asserts.eventually(ImmutableMap.of("timeout", Duration.FIVE_MINUTES), Suppliers.ofInstance(proc), EntityPredicates.attributeEqualTo(Attributes.SERVICE_STATE_ACTUAL, Lifecycle.ON_FIRE));
-    }
-
-    private void waitHealthy(VanillaSoftwareProcess proc) {
-        Asserts.eventually(ImmutableMap.of("timeout", Duration.FIVE_MINUTES), Suppliers.ofInstance(proc), EntityPredicates.attributeEqualTo(Attributes.SERVICE_STATE_ACTUAL, Lifecycle.RUNNING));
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/64c2b2e5/software/base/src/test/java/brooklyn/entity/software/AbstractDockerLiveTest.java
----------------------------------------------------------------------
diff --git a/software/base/src/test/java/brooklyn/entity/software/AbstractDockerLiveTest.java b/software/base/src/test/java/brooklyn/entity/software/AbstractDockerLiveTest.java
deleted file mode 100644
index 1dea4ca..0000000
--- a/software/base/src/test/java/brooklyn/entity/software/AbstractDockerLiveTest.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package brooklyn.entity.software;
-
-import com.google.common.base.CaseFormat;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-
-import org.apache.brooklyn.api.location.Location;
-import org.apache.brooklyn.api.mgmt.ManagementContext;
-import org.apache.brooklyn.core.internal.BrooklynProperties;
-import org.apache.brooklyn.core.mgmt.internal.LocalManagementContext;
-import org.apache.brooklyn.core.test.entity.TestApplication;
-import org.apache.brooklyn.entity.core.Entities;
-import org.apache.brooklyn.entity.factory.ApplicationBuilder;
-import org.apache.brooklyn.util.collections.MutableMap;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * Runs a test with many different distros and versions.
- */
-public abstract class AbstractDockerLiveTest {
-    
-    public static final String PROVIDER = "docker";
-
-    protected BrooklynProperties brooklynProperties;
-    protected ManagementContext ctx;
-    
-    protected TestApplication app;
-    protected Location jcloudsLocation;
-    
-    @BeforeMethod(alwaysRun=true)
-    public void setUp() throws Exception {
-        List<String> propsToRemove = ImmutableList.of("imageDescriptionRegex", "imageNameRegex", "inboundPorts",
-                "hardwareId", "minRam");
-        
-     // Don't let any defaults from brooklyn.properties (except credentials) interfere with test
-        brooklynProperties = BrooklynProperties.Factory.newDefault();
-        for (String propToRemove : propsToRemove) {
-            for (String propVariant : ImmutableList.of(propToRemove, CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_HYPHEN, propToRemove))) {
-                brooklynProperties.remove("brooklyn.locations.jclouds."+PROVIDER+"."+propVariant);
-                brooklynProperties.remove("brooklyn.locations."+propVariant);
-                brooklynProperties.remove("brooklyn.jclouds."+PROVIDER+"."+propVariant);
-                brooklynProperties.remove("brooklyn.jclouds."+propVariant);
-            }
-        }
-
-        // Also removes scriptHeader (e.g. if doing `. ~/.bashrc` and `. ~/.profile`, then that can cause "stdin: is not a tty")
-        brooklynProperties.remove("brooklyn.ssh.config.scriptHeader");
-        
-        ctx = new LocalManagementContext(brooklynProperties);
-        app = ApplicationBuilder.newManagedApp(TestApplication.class, ctx);
-    }
-
-    @AfterMethod(alwaysRun=true)
-    public void tearDown() throws Exception {
-        if (app != null) Entities.destroyAllCatching(app.getManagementContext());
-    }
-
-    @Test(groups={"Live", "WIP"})
-    public void test_Ubuntu_13_10() throws Exception {
-          runTest(ImmutableMap.of("imageId", "7fe2ec2ff748c411cf0d6833120741778c00e1b07a83c4104296b6258b5331c4",
-              "loginUser", "root",
-              "loginUser.password", "password"));
-     }
-
-    protected void runTest(Map<String,?> flags) throws Exception {
-        String tag = getClass().getSimpleName().toLowerCase();
-        Map<String,?> allFlags = MutableMap.<String,Object>builder()
-                .put("tags", ImmutableList.of(tag))
-                .putAll(flags)
-                .build();
-        jcloudsLocation = ctx.getLocationRegistry().resolve(PROVIDER, allFlags);
-        doTest(jcloudsLocation);
-    }
-
-    protected abstract void doTest(Location loc) throws Exception;
-}