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 2016/02/01 18:47:42 UTC

[06/51] [abbrv] [partial] brooklyn-library git commit: move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/couchdb/CouchDBNodeIntegrationTest.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/couchdb/CouchDBNodeIntegrationTest.java b/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/couchdb/CouchDBNodeIntegrationTest.java
deleted file mode 100644
index 8b5ec54..0000000
--- a/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/couchdb/CouchDBNodeIntegrationTest.java
+++ /dev/null
@@ -1,66 +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 org.apache.brooklyn.entity.nosql.couchdb;
-
-import org.apache.brooklyn.api.entity.EntitySpec;
-import org.apache.brooklyn.core.entity.trait.Startable;
-import org.apache.brooklyn.entity.nosql.couchdb.CouchDBNode;
-import org.apache.brooklyn.test.EntityTestUtils;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-
-/**
- * CouchDB integration tests.
- *
- * Test the operation of the {@link CouchDBNode} class.
- */
-public class CouchDBNodeIntegrationTest extends AbstractCouchDBNodeTest {
-
-    /**
-     * Test that a node starts and sets SERVICE_UP correctly.
-     */
-    @Test(groups = {"Integration", "WIP"})
-    public void canStartupAndShutdown() {
-        couchdb = app.createAndManageChild(EntitySpec.create(CouchDBNode.class)
-                .configure("httpPort", "8000+"));
-        app.start(ImmutableList.of(testLocation));
-
-        EntityTestUtils.assertAttributeEqualsEventually(couchdb, Startable.SERVICE_UP, true);
-
-        couchdb.stop();
-
-        EntityTestUtils.assertAttributeEquals(couchdb, Startable.SERVICE_UP, false);
-    }
-
-    /**
-     * Test that a node can be used with jcouchdb client.
-     */
-    @Test(groups = {"Integration", "WIP"})
-    public void testConnection() throws Exception {
-        couchdb = app.createAndManageChild(EntitySpec.create(CouchDBNode.class)
-                .configure("httpPort", "8000+"));
-        app.start(ImmutableList.of(testLocation));
-
-        EntityTestUtils.assertAttributeEqualsEventually(couchdb, Startable.SERVICE_UP, true);
-
-        JcouchdbSupport jcouchdb = new JcouchdbSupport(couchdb);
-        jcouchdb.jcouchdbTest();
-    }
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/couchdb/CouchDBNodeLiveTest.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/couchdb/CouchDBNodeLiveTest.java b/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/couchdb/CouchDBNodeLiveTest.java
deleted file mode 100644
index bfaf1b7..0000000
--- a/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/couchdb/CouchDBNodeLiveTest.java
+++ /dev/null
@@ -1,74 +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 org.apache.brooklyn.entity.nosql.couchdb;
-
-import java.util.Map;
-
-import org.apache.brooklyn.api.entity.EntitySpec;
-import org.apache.brooklyn.core.entity.trait.Startable;
-import org.apache.brooklyn.entity.nosql.couchdb.CouchDBNode;
-import org.apache.brooklyn.test.EntityTestUtils;
-import org.apache.brooklyn.util.collections.MutableMap;
-import org.apache.brooklyn.util.text.Strings;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testng.annotations.DataProvider;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-
-/**
- * CouchDB live tests.
- *
- * Test the operation of the {@link CouchDBNode} class using the jclouds {@code rackspace-cloudservers-uk}
- * and {@code aws-ec2} providers, with different OS images. The tests use the {@link JcouchdbSupport#jcouchdbTest(CouchDBNode)} method
- * to exercise the node, and will need to have {@code brooklyn.jclouds.provider.identity} and {@code .credential}
- * set, usually in the {@code .brooklyn/brooklyn.properties} file.
- */
-public class CouchDBNodeLiveTest extends AbstractCouchDBNodeTest {
-
-    private static final Logger log = LoggerFactory.getLogger(CouchDBNodeLiveTest.class);
-
-    @DataProvider(name = "virtualMachineData")
-    public Object[][] provideVirtualMachineData() {
-        return new Object[][] { // ImageId, Provider, Region, Description (for logging)
-            new Object[] { "eu-west-1/ami-0307d674", "aws-ec2", "eu-west-1", "Ubuntu Server 14.04 LTS (HVM), SSD Volume Type" },
-            new Object[] { "LON/f9b690bf-88eb-43c2-99cf-391f2558732e", "rackspace-cloudservers-uk", "", "Ubuntu 12.04 LTS (Precise Pangolin)" }, 
-            new Object[] { "LON/a84b1592-6817-42da-a57c-3c13f3cfc1da", "rackspace-cloudservers-uk", "", "CentOS 6.5 (PVHVM)" }, 
-        };
-    }
-
-    @Test(groups = "Live", dataProvider = "virtualMachineData")
-    protected void testOperatingSystemProvider(String imageId, String provider, String region, String description) throws Exception {
-        log.info("Testing CouchDB on {}{} using {} ({})", new Object[] { provider, Strings.isNonEmpty(region) ? ":" + region : "", description, imageId });
-
-        Map<String, String> properties = MutableMap.of("imageId", imageId);
-        testLocation = app.getManagementContext().getLocationRegistry()
-                .resolve(provider + (Strings.isNonEmpty(region) ? ":" + region : ""), properties);
-
-        couchdb = app.createAndManageChild(EntitySpec.create(CouchDBNode.class)
-                .configure("httpPort", "12345+")
-                .configure("clusterName", "TestCluster"));
-        app.start(ImmutableList.of(testLocation));
-        EntityTestUtils.assertAttributeEqualsEventually(couchdb, Startable.SERVICE_UP, true);
-
-        JcouchdbSupport jcouchdb = new JcouchdbSupport(couchdb);
-        jcouchdb.jcouchdbTest();
-    }
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/couchdb/JcouchdbSupport.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/couchdb/JcouchdbSupport.java b/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/couchdb/JcouchdbSupport.java
deleted file mode 100644
index 9883ea6..0000000
--- a/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/couchdb/JcouchdbSupport.java
+++ /dev/null
@@ -1,77 +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 org.apache.brooklyn.entity.nosql.couchdb;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertTrue;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.brooklyn.core.entity.Attributes;
-import org.apache.brooklyn.entity.nosql.couchdb.CouchDBNode;
-import org.jcouchdb.db.Database;
-import org.jcouchdb.db.Server;
-import org.jcouchdb.db.ServerImpl;
-
-/**
- * CouchDB test framework for integration and live tests, using jcouchdb API.
- */
-public class JcouchdbSupport {
-
-    private CouchDBNode node;
-
-    public JcouchdbSupport(CouchDBNode node) {
-        this.node = node;
-    }
-
-    /**
-     * Exercise the {@link CouchDBNode} using the jcouchdb API.
-     */
-    public void jcouchdbTest() throws Exception {
-        Server server = new ServerImpl(node.getAttribute(Attributes.HOSTNAME), node.getHttpPort());
-        assertTrue(server.createDatabase("brooklyn"));
-
-        Database db = new Database(node.getAttribute(Attributes.HOSTNAME), node.getHttpPort(), "brooklyn");
-
-        // create a hash map document with two fields
-        Map<String,String> doc = new HashMap<String, String>();
-        doc.put("first", "one");
-        doc.put("second", "two");
-
-        // create the document in couchdb
-        int before = db.listDocuments(null, null).getTotalRows();
-        db.createDocument(doc);
-        int after = db.listDocuments(null, null).getTotalRows();
-
-        assertEquals(before + 1, after);
-    }
-
-    /**
-     * Write to a {@link CouchDBNode} using the jcouchdb API.
-     */
-    protected void writeData() throws Exception {
-    }
-
-    /**
-     * Read from a {@link CouchDBNode} using the jcouchdb API.
-     */
-    protected void readData() throws Exception {
-    }
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/elasticsearch/ElasticSearchClusterIntegrationTest.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/elasticsearch/ElasticSearchClusterIntegrationTest.java b/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/elasticsearch/ElasticSearchClusterIntegrationTest.java
deleted file mode 100644
index eacc57f..0000000
--- a/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/elasticsearch/ElasticSearchClusterIntegrationTest.java
+++ /dev/null
@@ -1,127 +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 org.apache.brooklyn.entity.nosql.elasticsearch;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertTrue;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-
-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.core.entity.Attributes;
-import org.apache.brooklyn.core.entity.trait.Startable;
-import org.apache.brooklyn.core.test.BrooklynAppLiveTestSupport;
-import org.apache.brooklyn.entity.group.DynamicCluster;
-import org.apache.brooklyn.feed.http.HttpValueFunctions;
-import org.apache.brooklyn.test.Asserts;
-import org.apache.brooklyn.test.EntityTestUtils;
-import org.apache.brooklyn.util.http.HttpTool;
-import org.apache.brooklyn.util.http.HttpToolResponse;
-import org.apache.http.client.methods.HttpGet;
-import org.bouncycastle.util.Strings;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-
-public class ElasticSearchClusterIntegrationTest extends BrooklynAppLiveTestSupport {
-
-    // FIXME Exception in thread "main" java.lang.UnsupportedClassVersionError: org/elasticsearch/bootstrap/Elasticsearch : Unsupported major.minor version 51.0
-
-    private static final Logger LOG = LoggerFactory.getLogger(ElasticSearchClusterIntegrationTest.class);
-
-    protected Location testLocation;
-    protected ElasticSearchCluster elasticSearchCluster;
-
-    @BeforeMethod(alwaysRun = true)
-    @Override
-    public void setUp() throws Exception {
-        super.setUp();
-        testLocation = app.newLocalhostProvisioningLocation();
-    }
-
-    @Test(groups = {"Integration"})
-    public void testStartupAndShutdown() {
-        elasticSearchCluster = app.createAndManageChild(EntitySpec.create(ElasticSearchCluster.class)
-                .configure(DynamicCluster.INITIAL_SIZE, 3));
-        app.start(ImmutableList.of(testLocation));
-        
-        EntityTestUtils.assertAttributeEqualsEventually(elasticSearchCluster, Startable.SERVICE_UP, true);
-        
-        elasticSearchCluster.stop();
-        
-        EntityTestUtils.assertAttributeEqualsEventually(elasticSearchCluster, Startable.SERVICE_UP, false);
-    }
-    
-    @Test(groups = {"Integration"})
-    public void testPutAndGet() throws URISyntaxException {
-        elasticSearchCluster = app.createAndManageChild(EntitySpec.create(ElasticSearchCluster.class)
-                .configure(DynamicCluster.INITIAL_SIZE, 3));
-        app.start(ImmutableList.of(testLocation));
-        
-        EntityTestUtils.assertAttributeEqualsEventually(elasticSearchCluster, Startable.SERVICE_UP, true);
-        assertEquals(elasticSearchCluster.getMembers().size(), 3);
-        assertEquals(clusterDocumentCount(), 0);
-        
-        ElasticSearchNode anyNode = (ElasticSearchNode)elasticSearchCluster.getMembers().iterator().next();
-        
-        String document = "{\"foo\" : \"bar\",\"baz\" : \"quux\"}";
-        
-        String putBaseUri = "http://" + anyNode.getAttribute(Attributes.HOSTNAME) + ":" + anyNode.getAttribute(Attributes.HTTP_PORT);
-        
-        HttpToolResponse putResponse = HttpTool.httpPut(
-                HttpTool.httpClientBuilder()
-                    .port(anyNode.getAttribute(Attributes.HTTP_PORT))
-                    .build(), 
-                new URI(putBaseUri + "/mydocuments/docs/1"), 
-                ImmutableMap.<String, String>of(), 
-                Strings.toByteArray(document)); 
-        assertEquals(putResponse.getResponseCode(), 201);
-        
-        for (Entity entity : elasticSearchCluster.getMembers()) {
-            ElasticSearchNode node = (ElasticSearchNode)entity;
-            String getBaseUri = "http://" + node.getAttribute(Attributes.HOSTNAME) + ":" + node.getAttribute(Attributes.HTTP_PORT);
-            HttpToolResponse getResponse = HttpTool.execAndConsume(
-                    HttpTool.httpClientBuilder().build(),
-                    new HttpGet(getBaseUri + "/mydocuments/docs/1/_source"));
-            assertEquals(getResponse.getResponseCode(), 200);
-            assertEquals(HttpValueFunctions.jsonContents("foo", String.class).apply(getResponse), "bar");
-        }
-        Asserts.succeedsEventually(new Runnable() {
-            public void run() {
-                int count = clusterDocumentCount();
-                assertTrue(count >= 1, "count="+count);
-                LOG.debug("Document count is {}", count);
-            }});
-    }
-    
-    private int clusterDocumentCount() {
-        int result = 0;
-        for (Entity entity : elasticSearchCluster.getMembers()) {
-            result += entity.getAttribute(ElasticSearchNode.DOCUMENT_COUNT);
-        }
-        return result;
-    }
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/elasticsearch/ElasticSearchNodeIntegrationTest.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/elasticsearch/ElasticSearchNodeIntegrationTest.java b/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/elasticsearch/ElasticSearchNodeIntegrationTest.java
deleted file mode 100644
index e6412f8..0000000
--- a/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/elasticsearch/ElasticSearchNodeIntegrationTest.java
+++ /dev/null
@@ -1,111 +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 org.apache.brooklyn.entity.nosql.elasticsearch;
-
-import static org.testng.Assert.assertEquals;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-
-import org.apache.brooklyn.api.entity.EntitySpec;
-import org.apache.brooklyn.api.location.Location;
-import org.apache.brooklyn.core.entity.Attributes;
-import org.apache.brooklyn.core.entity.Entities;
-import org.apache.brooklyn.core.entity.factory.ApplicationBuilder;
-import org.apache.brooklyn.core.entity.trait.Startable;
-import org.apache.brooklyn.core.test.entity.TestApplication;
-import org.apache.brooklyn.feed.http.HttpValueFunctions;
-import org.apache.brooklyn.test.EntityTestUtils;
-import org.apache.brooklyn.util.http.HttpTool;
-import org.apache.brooklyn.util.http.HttpToolResponse;
-import org.apache.http.client.methods.HttpGet;
-import org.bouncycastle.util.Strings;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-import org.apache.brooklyn.location.localhost.LocalhostMachineProvisioningLocation;
-
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-
-public class ElasticSearchNodeIntegrationTest {
-    
-    protected TestApplication app;
-    protected Location testLocation;
-    protected ElasticSearchNode elasticSearchNode;
-
-    @BeforeMethod(alwaysRun = true)
-    public void setup() throws Exception {
-        app = ApplicationBuilder.newManagedApp(TestApplication.class);
-        testLocation = new LocalhostMachineProvisioningLocation();
-    }
-
-    @AfterMethod(alwaysRun = true)
-    public void shutdown() {
-        Entities.destroyAll(app.getManagementContext());
-    }
-    
-    @Test(groups = {"Integration"})
-    public void testStartupAndShutdown() {
-        elasticSearchNode = app.createAndManageChild(EntitySpec.create(ElasticSearchNode.class));
-        app.start(ImmutableList.of(testLocation));
-        
-        EntityTestUtils.assertAttributeEqualsEventually(elasticSearchNode, Startable.SERVICE_UP, true);
-        
-        elasticSearchNode.stop();
-        
-        EntityTestUtils.assertAttributeEqualsEventually(elasticSearchNode, Startable.SERVICE_UP, false);
-    }
-    
-    @Test(groups = {"Integration"})
-    public void testDocumentCount() throws URISyntaxException {
-        elasticSearchNode = app.createAndManageChild(EntitySpec.create(ElasticSearchNode.class));
-        app.start(ImmutableList.of(testLocation));
-        
-        EntityTestUtils.assertAttributeEqualsEventually(elasticSearchNode, Startable.SERVICE_UP, true);
-        
-        EntityTestUtils.assertAttributeEquals(elasticSearchNode, ElasticSearchNode.DOCUMENT_COUNT, 0);
-        
-        String baseUri = "http://" + elasticSearchNode.getAttribute(Attributes.HOSTNAME) + ":" + elasticSearchNode.getAttribute(Attributes.HTTP_PORT);
-        
-        HttpToolResponse pingResponse = HttpTool.execAndConsume(
-                HttpTool.httpClientBuilder().build(),
-                new HttpGet(baseUri));
-        assertEquals(pingResponse.getResponseCode(), 200);
-        
-        String document = "{\"foo\" : \"bar\",\"baz\" : \"quux\"}";
-        
-        HttpToolResponse putResponse = HttpTool.httpPut(
-                HttpTool.httpClientBuilder()
-                    .port(elasticSearchNode.getAttribute(Attributes.HTTP_PORT))
-                    .build(), 
-                new URI(baseUri + "/mydocuments/docs/1"), 
-                ImmutableMap.<String, String>of(), 
-                Strings.toByteArray(document)); 
-        assertEquals(putResponse.getResponseCode(), 201);
-        
-        HttpToolResponse getResponse = HttpTool.execAndConsume(
-                HttpTool.httpClientBuilder().build(),
-                new HttpGet(baseUri + "/mydocuments/docs/1/_source"));
-        assertEquals(getResponse.getResponseCode(), 200);
-        assertEquals(HttpValueFunctions.jsonContents("foo", String.class).apply(getResponse), "bar");
-        
-        EntityTestUtils.assertAttributeEqualsEventually(elasticSearchNode, ElasticSearchNode.DOCUMENT_COUNT, 1);
-    }
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/hazelcast/HazelcastClusterEc2LiveTest.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/hazelcast/HazelcastClusterEc2LiveTest.java b/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/hazelcast/HazelcastClusterEc2LiveTest.java
deleted file mode 100644
index 111ba9e..0000000
--- a/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/hazelcast/HazelcastClusterEc2LiveTest.java
+++ /dev/null
@@ -1,47 +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 org.apache.brooklyn.entity.nosql.hazelcast;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testng.annotations.Test;
-
-import org.apache.brooklyn.entity.AbstractEc2LiveTest;
-import org.apache.brooklyn.api.location.Location;
-
-public class HazelcastClusterEc2LiveTest extends AbstractEc2LiveTest {
-    @SuppressWarnings("unused")
-    private static final Logger LOG = LoggerFactory.getLogger(HazelcastClusterEc2LiveTest.class);
-
-    @Override
-    protected void doTest(Location loc) throws Exception {
-        HazelcastTestHelper.testHazelcastCluster(app, loc);
-    }
-
-    @Test(enabled = false)
-    public void testDummy() {
-    } // Convince TestNG IDE integration that this really does have test methods
-
-    
-    @Test(groups = {"Live", "Live-sanity"})
-    @Override
-    public void test_CentOS_6_3() throws Exception {
-        super.test_CentOS_6_3();
-    }
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/hazelcast/HazelcastClusterNodeIntegrationTest.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/hazelcast/HazelcastClusterNodeIntegrationTest.java b/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/hazelcast/HazelcastClusterNodeIntegrationTest.java
deleted file mode 100644
index dc89934..0000000
--- a/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/hazelcast/HazelcastClusterNodeIntegrationTest.java
+++ /dev/null
@@ -1,49 +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 org.apache.brooklyn.entity.nosql.hazelcast;
-
-import org.apache.brooklyn.api.location.Location;
-import org.apache.brooklyn.core.entity.Entities;
-import org.apache.brooklyn.core.test.entity.TestApplication;
-
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-import org.apache.brooklyn.location.localhost.LocalhostMachineProvisioningLocation;
-
-public class HazelcastClusterNodeIntegrationTest {
-    private TestApplication app;
-    private Location location;
-
-    @BeforeMethod(alwaysRun = true)
-    public void setup() throws Exception {
-        app = TestApplication.Factory.newManagedInstanceForTests();;
-        location = new LocalhostMachineProvisioningLocation();
-    }
-
-    @AfterMethod(alwaysRun = true)
-    public void shutdown() {
-        Entities.destroyAll(app.getManagementContext());
-    }
-
-    @Test(groups = {"Integration"})
-    public void testHazelcastCluster() {
-        HazelcastTestHelper.testHazelcastCluster(app, location);
-    }
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/hazelcast/HazelcastClusterSoftlayerLiveTest.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/hazelcast/HazelcastClusterSoftlayerLiveTest.java b/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/hazelcast/HazelcastClusterSoftlayerLiveTest.java
deleted file mode 100644
index 412ce87..0000000
--- a/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/hazelcast/HazelcastClusterSoftlayerLiveTest.java
+++ /dev/null
@@ -1,47 +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 org.apache.brooklyn.entity.nosql.hazelcast;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testng.annotations.Test;
-
-import org.apache.brooklyn.entity.AbstractSoftlayerLiveTest;
-import org.apache.brooklyn.api.location.Location;
-
-public class HazelcastClusterSoftlayerLiveTest extends AbstractSoftlayerLiveTest {
-    @SuppressWarnings("unused")
-    private static final Logger LOG = LoggerFactory.getLogger(HazelcastClusterSoftlayerLiveTest.class);
-
-    @Override
-    protected void doTest(Location loc) throws Exception {
-        HazelcastTestHelper.testHazelcastCluster(app, loc);
-    }
-
-    @Test(enabled = false)
-    public void testDummy() {
-    } // Convince TestNG IDE integration that this really does have test methods
-
-    
-    @Test(groups = {"Live", "Live-sanity"})
-    @Override
-    public void test_Ubuntu_12_0_4() throws Exception {
-        super.test_Ubuntu_12_0_4();
-    }
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/hazelcast/HazelcastNodeIntegrationTest.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/hazelcast/HazelcastNodeIntegrationTest.java b/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/hazelcast/HazelcastNodeIntegrationTest.java
deleted file mode 100644
index 26a18c5..0000000
--- a/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/hazelcast/HazelcastNodeIntegrationTest.java
+++ /dev/null
@@ -1,107 +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 org.apache.brooklyn.entity.nosql.hazelcast;
-
-import static org.testng.Assert.assertEquals;
-
-import java.net.URISyntaxException;
-
-import org.apache.brooklyn.api.entity.EntitySpec;
-import org.apache.brooklyn.api.location.Location;
-import org.apache.brooklyn.core.entity.Attributes;
-import org.apache.brooklyn.core.entity.Entities;
-import org.apache.brooklyn.core.entity.EntityAsserts;
-import org.apache.brooklyn.core.entity.trait.Startable;
-import org.apache.brooklyn.core.test.entity.TestApplication;
-import org.apache.brooklyn.util.http.HttpTool;
-import org.apache.brooklyn.util.http.HttpToolResponse;
-import org.apache.http.client.methods.HttpGet;
-import com.hazelcast.core.HazelcastInstance;
-import com.hazelcast.core.IMap;
-
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-import org.apache.brooklyn.location.localhost.LocalhostMachineProvisioningLocation;
-
-import com.google.common.collect.ImmutableList;
-
-public class HazelcastNodeIntegrationTest {
-    protected TestApplication app;
-    protected Location testLocation;
-    protected HazelcastNode hazelcastNode;
-
-    @BeforeMethod(alwaysRun = true)
-    public void setup() throws Exception {
-        app = TestApplication.Factory.newManagedInstanceForTests();;
-        testLocation = new LocalhostMachineProvisioningLocation();
-    }
-
-    @AfterMethod(alwaysRun = true)
-    public void shutdown() {
-        Entities.destroyAll(app.getManagementContext());
-    }
-    
-    @Test(groups = {"Integration"})
-    public void testHazelcastStartupAndShutdown() {
-        hazelcastNode = app.createAndManageChild(EntitySpec.create(HazelcastNode.class));
-        app.start(ImmutableList.of(testLocation));
-        EntityAsserts.assertAttributeEqualsEventually(hazelcastNode, Startable.SERVICE_UP, true);
-
-        hazelcastNode.stop();
-        EntityAsserts.assertAttributeEqualsEventually(hazelcastNode, Startable.SERVICE_UP, false);
-    }
-
-    @Test(groups = {"Integration"})
-    public void testHazelcastRestInterface() throws URISyntaxException {
-        hazelcastNode = app.createAndManageChild(EntitySpec.create(HazelcastNode.class));
-        app.start(ImmutableList.of(testLocation));
-
-        EntityAsserts.assertAttributeEqualsEventually(hazelcastNode, Startable.SERVICE_UP, true);
-        EntityAsserts.assertAttributeEquals(hazelcastNode, HazelcastNode.NODE_PORT, 5701);
-
-        String baseUri = String.format("http://%s:%d/hazelcast/rest/cluster", hazelcastNode.getAttribute(Attributes.HOSTNAME), hazelcastNode.getAttribute(HazelcastNode.NODE_PORT)); 
-        HttpToolResponse response = HttpTool.execAndConsume(
-                HttpTool.httpClientBuilder().build(),
-                new HttpGet(baseUri));
-        assertEquals(response.getResponseCode(), 200);
-    }
-
-    @Test(groups = {"Integration"})
-    public void testHazelcastClient() throws URISyntaxException {
-        hazelcastNode = app.createAndManageChild(EntitySpec.create(HazelcastNode.class));
-        app.start(ImmutableList.of(testLocation));
-
-        EntityAsserts.assertAttributeEqualsEventually(hazelcastNode, Startable.SERVICE_UP, true);
-        HazelcastTestHelper helper = new HazelcastTestHelper(hazelcastNode.getAttribute(Attributes.HOSTNAME), hazelcastNode.getAttribute(HazelcastNode.NODE_PORT));
-
-        HazelcastInstance client = helper.getClient();
-        HazelcastInstance client2 = helper.getClient();
-
-        client.getMap(HazelcastTestHelper.GROUP_NAME).put("A", "a");
-        client2.getMap(HazelcastTestHelper.GROUP_NAME).put("B", "b");
-
-        final IMap<Object, Object> map = client.getMap(HazelcastTestHelper.GROUP_NAME);
-        assertEquals("a", map.get("A"));
-        assertEquals("b", map.get("B"));
-
-        client.shutdown();
-        client2.shutdown();
-    }
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/hazelcast/HazelcastTestHelper.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/hazelcast/HazelcastTestHelper.java b/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/hazelcast/HazelcastTestHelper.java
deleted file mode 100644
index b48e0bd..0000000
--- a/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/hazelcast/HazelcastTestHelper.java
+++ /dev/null
@@ -1,76 +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 org.apache.brooklyn.entity.nosql.hazelcast;
-
-import org.apache.brooklyn.api.entity.EntitySpec;
-import org.apache.brooklyn.api.location.Location;
-import org.apache.brooklyn.core.entity.Attributes;
-import org.apache.brooklyn.core.entity.EntityAsserts;
-import org.apache.brooklyn.core.test.entity.TestApplication;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Iterables;
-import com.hazelcast.client.HazelcastClient;
-import com.hazelcast.client.config.ClientConfig;
-import com.hazelcast.core.HazelcastInstance;
-
-public class HazelcastTestHelper {
-    private static final Logger LOG = LoggerFactory.getLogger(HazelcastTestHelper.class);
-    private static ClientConfig clientConfig;
-
-    public static final String GROUP_NAME = "brooklyn";
-    public static final String GROUP_PASS = "brooklyn";
-
-    public HazelcastTestHelper(String hazelcastAddress, Integer hazelcastPort) {
-        clientConfig = new ClientConfig();
-        clientConfig.getGroupConfig().setName(GROUP_NAME).setPassword(GROUP_PASS);
-        clientConfig.getNetworkConfig().addAddress(String.format("%s:%d", hazelcastAddress, hazelcastPort));
-    }
-
-    public HazelcastInstance getClient() {
-        HazelcastInstance client = HazelcastClient.newHazelcastClient(clientConfig);
-        LOG.info("Hazelcast client {}", client.getName());
-
-        return client;
-    }
-
-    public static void testHazelcastCluster(TestApplication app, Location loc) {
-        HazelcastCluster cluster = app.createAndManageChild(EntitySpec.create(HazelcastCluster.class)
-                .configure(HazelcastCluster.INITIAL_SIZE, 3)
-                .configure(HazelcastCluster.MEMBER_SPEC, EntitySpec.create(HazelcastNode.class)));
-        app.start(ImmutableList.of(loc));
-
-        EntityAsserts.assertAttributeEqualsEventually(cluster, HazelcastNode.SERVICE_UP, true);
-
-        HazelcastNode first = (HazelcastNode) Iterables.get(cluster.getMembers(), 0);
-        HazelcastNode second = (HazelcastNode) Iterables.get(cluster.getMembers(), 1);
-
-        assertNodesUpAndInCluster(first, second);
-
-        EntityAsserts.assertAttributeEqualsEventually(cluster, Attributes.SERVICE_UP, true);
-    }
-
-    private static void assertNodesUpAndInCluster(final HazelcastNode... nodes) {
-        for (final HazelcastNode node : nodes) {
-            EntityAsserts.assertAttributeEqualsEventually(node, HazelcastNode.SERVICE_UP, true);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/mongodb/MongoDBEc2LiveTest.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/mongodb/MongoDBEc2LiveTest.java b/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/mongodb/MongoDBEc2LiveTest.java
deleted file mode 100644
index 5ad5fa7..0000000
--- a/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/mongodb/MongoDBEc2LiveTest.java
+++ /dev/null
@@ -1,84 +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 org.apache.brooklyn.entity.nosql.mongodb;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-
-import org.apache.brooklyn.api.entity.EntitySpec;
-import org.apache.brooklyn.api.location.Location;
-import org.apache.brooklyn.core.entity.Attributes;
-import org.apache.brooklyn.core.entity.EntityAsserts;
-import org.apache.brooklyn.core.entity.lifecycle.Lifecycle;
-import org.apache.brooklyn.core.location.cloud.CloudLocationConfig;
-import org.apache.brooklyn.entity.AbstractEc2LiveTest;
-import org.apache.brooklyn.test.EntityTestUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import com.mongodb.DBObject;
-
-public class MongoDBEc2LiveTest extends AbstractEc2LiveTest {
-
-    @SuppressWarnings("unused")
-    private static final Logger LOG = LoggerFactory.getLogger(MongoDBEc2LiveTest.class);
-
-    @Override
-    protected void doTest(Location loc) throws Exception {
-        MongoDBServer entity = app.createAndManageChild(EntitySpec.create(MongoDBServer.class)
-                .configure("mongodbConfTemplateUrl", "classpath:///test-mongodb.conf"));
-        app.start(ImmutableList.of(loc));
-
-        EntityTestUtils.assertAttributeEqualsEventually(entity, MongoDBServer.SERVICE_UP, true);
-
-        String id = MongoDBTestHelper.insert(entity, "hello", "world!");
-        DBObject docOut = MongoDBTestHelper.getById(entity, id);
-        assertEquals(docOut.get("hello"), "world!");
-    }
-
-    @Test(groups = {"Live"})
-    public void testWithOnlyPort22() throws Exception {
-        // CentOS-6.3-x86_64-GA-EBS-02-85586466-5b6c-4495-b580-14f72b4bcf51-ami-bb9af1d2.1
-        jcloudsLocation = mgmt.getLocationRegistry().resolve(LOCATION_SPEC, ImmutableMap.of(
-                "tags", ImmutableList.of(getClass().getName()),
-                "imageId", "us-east-1/ami-a96b01c0", 
-                "hardwareId", SMALL_HARDWARE_ID));
-
-        MongoDBServer server = app.createAndManageChild(EntitySpec.create(MongoDBServer.class)
-                .configure(MongoDBServer.PROVISIONING_PROPERTIES.subKey(CloudLocationConfig.INBOUND_PORTS.getName()), ImmutableList.of(22))
-                .configure(MongoDBServer.USE_CLIENT_MONITORING, false));
-        
-        app.start(ImmutableList.of(jcloudsLocation));
-        
-        EntityAsserts.assertAttributeEqualsEventually(server, Attributes.SERVICE_UP, true);
-        EntityAsserts.assertAttributeEqualsEventually(server, Attributes.SERVICE_STATE_ACTUAL, Lifecycle.RUNNING);
-        
-        Integer port = server.getAttribute(MongoDBServer.PORT);
-        assertNotNull(port);
-        
-        assertViaSshLocalPortListeningEventually(server, port);
-    }
-    
-    @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/brooklyn-library/blob/02abbab0/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/mongodb/MongoDBIntegrationTest.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/mongodb/MongoDBIntegrationTest.java b/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/mongodb/MongoDBIntegrationTest.java
deleted file mode 100644
index c982fd3..0000000
--- a/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/mongodb/MongoDBIntegrationTest.java
+++ /dev/null
@@ -1,90 +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 org.apache.brooklyn.entity.nosql.mongodb;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
-
-import org.apache.brooklyn.api.entity.EntitySpec;
-import org.apache.brooklyn.core.entity.Entities;
-import org.apache.brooklyn.core.entity.factory.ApplicationBuilder;
-import org.apache.brooklyn.core.entity.trait.Startable;
-import org.apache.brooklyn.core.test.entity.TestApplication;
-import org.apache.brooklyn.test.EntityTestUtils;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-import org.apache.brooklyn.location.localhost.LocalhostMachineProvisioningLocation;
-
-import com.google.common.collect.ImmutableList;
-import com.mongodb.DBObject;
-
-public class MongoDBIntegrationTest {
-
-    private TestApplication app;
-    private LocalhostMachineProvisioningLocation localhostProvisioningLocation;
-
-    @BeforeMethod(alwaysRun=true)
-    public void setUp() throws Exception {
-        localhostProvisioningLocation = new LocalhostMachineProvisioningLocation();
-        app = ApplicationBuilder.newManagedApp(TestApplication.class);
-    }
-
-    @AfterMethod(alwaysRun=true)
-    public void tearDown() throws Exception {
-        if (app != null) Entities.destroyAll(app.getManagementContext());
-    }
-
-    @Test(groups = "Integration")
-    public void testCanStartAndStop() throws Exception {
-        MongoDBServer entity = app.createAndManageChild(EntitySpec.create(MongoDBServer.class)
-                .configure("mongodbConfTemplateUrl", "classpath:///test-mongodb.conf"));
-        app.start(ImmutableList.of(localhostProvisioningLocation));
-
-        EntityTestUtils.assertAttributeEqualsEventually(entity, Startable.SERVICE_UP, true);
-        entity.stop();
-        assertFalse(entity.getAttribute(Startable.SERVICE_UP));
-    }
-
-    @Test(groups = "Integration", dependsOnMethods = { "testCanStartAndStop" })
-    public void testCanReadAndWrite() throws Exception {
-        MongoDBServer entity = app.createAndManageChild(EntitySpec.create(MongoDBServer.class)
-                .configure("mongodbConfTemplateUrl", "classpath:///test-mongodb.conf"));
-        app.start(ImmutableList.of(localhostProvisioningLocation));
-
-        String id = MongoDBTestHelper.insert(entity, "hello", "world!");
-        DBObject docOut = MongoDBTestHelper.getById(entity, id);
-        assertEquals(docOut.get("hello"), "world!");
-    }
-
-    @Test(groups = "Integration", dependsOnMethods = { "testCanStartAndStop" })
-    public void testPollInsertCountSensor() throws Exception {
-        MongoDBServer entity = app.createAndManageChild(EntitySpec.create(MongoDBServer.class)
-                .configure("mongodbConfTemplateUrl", "classpath:///test-mongodb.conf"));
-        app.start(ImmutableList.of(localhostProvisioningLocation));
-        EntityTestUtils.assertAttributeEqualsEventually(entity, Startable.SERVICE_UP, true);
-
-        EntityTestUtils.assertAttributeEventuallyNonNull(entity, MongoDBServer.OPCOUNTERS_INSERTS);
-        Long initialInserts = entity.getAttribute(MongoDBServer.OPCOUNTERS_INSERTS);
-        MongoDBTestHelper.insert(entity, "a", Boolean.TRUE);
-        MongoDBTestHelper.insert(entity, "b", Boolean.FALSE);
-        EntityTestUtils.assertAttributeEqualsEventually(entity, MongoDBServer.OPCOUNTERS_INSERTS, initialInserts + 2);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/mongodb/MongoDBRebindIntegrationTest.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/mongodb/MongoDBRebindIntegrationTest.java b/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/mongodb/MongoDBRebindIntegrationTest.java
deleted file mode 100644
index 6fc2013..0000000
--- a/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/mongodb/MongoDBRebindIntegrationTest.java
+++ /dev/null
@@ -1,59 +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 org.apache.brooklyn.entity.nosql.mongodb;
-
-import org.apache.brooklyn.api.entity.EntitySpec;
-import org.apache.brooklyn.core.mgmt.rebind.RebindTestFixtureWithApp;
-import org.apache.brooklyn.test.EntityTestUtils;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-import org.apache.brooklyn.location.localhost.LocalhostMachineProvisioningLocation;
-
-import com.google.common.base.Predicates;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Iterables;
-
-public class MongoDBRebindIntegrationTest extends RebindTestFixtureWithApp {
-
-    private LocalhostMachineProvisioningLocation loc;
-    
-    @BeforeMethod(alwaysRun=true)
-    @Override
-    public void setUp() throws Exception {
-        super.setUp();
-        loc = origApp.newLocalhostProvisioningLocation();
-    }
-
-    @Test(groups = {"Integration"})
-    public void testRebindMongoDb() throws Exception {
-        MongoDBServer origEntity = origApp.createAndManageChild(EntitySpec.create(MongoDBServer.class)
-                .configure("mongodbConfTemplateUrl", "classpath:///test-mongodb.conf"));
-        origApp.start(ImmutableList.of(loc));
-        EntityTestUtils.assertAttributeEventuallyNonNull(origEntity, MongoDBServer.STATUS_BSON);
-
-        // rebind
-        rebind();
-        final MongoDBServer newEntity = (MongoDBServer) Iterables.find(newApp.getChildren(), Predicates.instanceOf(MongoDBServer.class));
-
-        // confirm effectors still work on entity
-        EntityTestUtils.assertAttributeEqualsEventually(newEntity, MongoDBServer.SERVICE_UP, true);
-        newEntity.stop();
-        EntityTestUtils.assertAttributeEqualsEventually(newEntity, MongoDBServer.SERVICE_UP, false);
-    }
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/mongodb/MongoDBReplicaSetEc2LiveTest.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/mongodb/MongoDBReplicaSetEc2LiveTest.java b/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/mongodb/MongoDBReplicaSetEc2LiveTest.java
deleted file mode 100644
index ca57f10..0000000
--- a/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/mongodb/MongoDBReplicaSetEc2LiveTest.java
+++ /dev/null
@@ -1,95 +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 org.apache.brooklyn.entity.nosql.mongodb;
-
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import com.mongodb.DBObject;
-
-import groovy.time.TimeDuration;
-
-import org.apache.brooklyn.api.entity.EntitySpec;
-import org.apache.brooklyn.api.location.Location;
-import org.apache.brooklyn.core.entity.Entities;
-import org.apache.brooklyn.entity.AbstractEc2LiveTest;
-import org.apache.brooklyn.entity.group.DynamicCluster;
-import org.apache.brooklyn.test.Asserts;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testng.annotations.Test;
-
-import java.util.concurrent.Callable;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-
-public class MongoDBReplicaSetEc2LiveTest extends AbstractEc2LiveTest {
-
-    @SuppressWarnings("unused")
-    private static final Logger LOG = LoggerFactory.getLogger(MongoDBReplicaSetEc2LiveTest.class);
-    private static final Integer REPLICA_SET_SIZE = 3;
-    private static final TimeDuration TIMEOUT = new TimeDuration(0, 0, 180, 0);
-
-    /**
-     * Test that a three node replica set starts and allows access through both nodes.
-     */
-    @Override
-    protected void doTest(Location loc) throws Exception {
-        final MongoDBReplicaSet replicaSet = app.createAndManageChild(EntitySpec.create(MongoDBReplicaSet.class)
-                .configure(DynamicCluster.INITIAL_SIZE, REPLICA_SET_SIZE)
-                .configure("replicaSetName", "mongodb-live-test-replica-set")
-                .configure("memberSpec", EntitySpec.create(MongoDBServer.class)
-                        .configure("mongodbConfTemplateUrl", "classpath:///test-mongodb.conf")
-                        .configure("port", "27017+")));
-
-        assertEquals(replicaSet.getCurrentSize().intValue(), 0);
-
-        app.start(ImmutableList.of(loc));
-
-        Asserts.succeedsEventually(ImmutableMap.of("timeout", TIMEOUT), new Callable<Boolean>() {
-            @Override
-            public Boolean call() {
-                assertEquals(replicaSet.getCurrentSize(), REPLICA_SET_SIZE);
-                assertNotNull(replicaSet.getPrimary());
-                assertEquals(replicaSet.getSecondaries().size(), REPLICA_SET_SIZE-1);
-                return true;
-            }
-        });
-
-        Entities.dumpInfo(app);
-
-        // Test inserting a document and reading from secondaries
-        final String documentId = MongoDBTestHelper.insert(replicaSet.getPrimary(), "meaning-of-life", 42);
-        Asserts.succeedsEventually(ImmutableMap.of("timeout", TIMEOUT), new Callable<Boolean>() {
-            @Override
-            public Boolean call() throws Exception {
-                assertEquals(replicaSet.getCurrentSize().intValue(), 3);
-                for (MongoDBServer secondary : replicaSet.getSecondaries()) {
-                    DBObject docOut = MongoDBTestHelper.getById(secondary, documentId);
-                    assertEquals(docOut.get("meaning-of-life"), 42);
-                }
-                return true;
-            }
-        });
-
-    }
-
-    @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/brooklyn-library/blob/02abbab0/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/mongodb/MongoDBReplicaSetIntegrationTest.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/mongodb/MongoDBReplicaSetIntegrationTest.java b/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/mongodb/MongoDBReplicaSetIntegrationTest.java
deleted file mode 100644
index 8f82b60..0000000
--- a/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/mongodb/MongoDBReplicaSetIntegrationTest.java
+++ /dev/null
@@ -1,205 +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 org.apache.brooklyn.entity.nosql.mongodb;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
-import static org.testng.Assert.assertNotEquals;
-import static org.testng.Assert.assertNotNull;
-
-import java.util.Collection;
-import java.util.concurrent.TimeUnit;
-
-import org.apache.brooklyn.api.entity.Entity;
-import org.apache.brooklyn.api.entity.EntitySpec;
-import org.apache.brooklyn.core.entity.trait.Startable;
-import org.apache.brooklyn.core.test.BrooklynAppLiveTestSupport;
-import org.apache.brooklyn.entity.group.DynamicCluster;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-import org.apache.brooklyn.location.localhost.LocalhostMachineProvisioningLocation;
-import org.apache.brooklyn.test.Asserts;
-import org.apache.brooklyn.util.time.Duration;
-
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import com.mongodb.DBObject;
-
-public class MongoDBReplicaSetIntegrationTest extends BrooklynAppLiveTestSupport {
-
-    @SuppressWarnings("unused")
-    private static final Logger log = LoggerFactory.getLogger(MongoDBReplicaSetIntegrationTest.class);
-    
-    private Collection<LocalhostMachineProvisioningLocation> locs;
-
-    // Replica sets can take a while to start
-    private static final Duration TIMEOUT = Duration.of(3, TimeUnit.MINUTES);
-
-    @BeforeMethod(alwaysRun=true)
-    @Override
-    public void setUp() throws Exception {
-        super.setUp();
-        locs = ImmutableList.of(app.newLocalhostProvisioningLocation());
-    }
-
-    /**
-     * Creates and starts a replica set, asserts it reaches the given size
-     * and that the primary and secondaries are non-null.
-     */
-    private MongoDBReplicaSet makeAndStartReplicaSet(final Integer size, final String testDescription) {
-        // Sets secondaryPreferred so we can read from slaves.
-        final MongoDBReplicaSet replicaSet = app.createAndManageChild(EntitySpec.create(MongoDBReplicaSet.class)
-                .configure(DynamicCluster.INITIAL_SIZE, size)
-                .configure("replicaSetName", "test-rs-"+testDescription)
-                .configure("memberSpec", EntitySpec.create(MongoDBServer.class)
-                        .configure("mongodbConfTemplateUrl", "classpath:///test-mongodb.conf")
-                        .configure("port", "27017+")));
-        app.start(locs);
-
-        Asserts.succeedsEventually(ImmutableMap.of("timeout", TIMEOUT), new Runnable() {
-            @Override
-            public void run() {
-                assertEquals(replicaSet.getCurrentSize(), size);
-                assertNotNull(replicaSet.getPrimary(), "replica set has no primary");
-                assertEquals(replicaSet.getPrimary().getReplicaSet().getName(), "test-rs-"+testDescription+replicaSet.getId());
-                assertEquals(replicaSet.getSecondaries().size(), size-1);
-            }
-        });
-        return replicaSet;
-    }
-
-    @Test(groups = "Integration")
-    public void testCanStartAndStopAReplicaSet() {
-        final MongoDBReplicaSet replicaSet = makeAndStartReplicaSet(3, "can-start-and-stop");
-        replicaSet.stop();
-        assertFalse(replicaSet.getAttribute(Startable.SERVICE_UP));
-    }
-
-    @Test(groups = "Integration")
-    public void testWriteToMasterAndReadFromSecondary() {
-        final MongoDBReplicaSet replicaSet = makeAndStartReplicaSet(3, "master-write-secondary-read");
-
-        // Test we can read a document written to the primary from all secondaries
-        final String documentId = MongoDBTestHelper.insert(replicaSet.getPrimary(), "meaning-of-life", 42);
-        Asserts.succeedsEventually(ImmutableMap.of("timeout", TIMEOUT), new Runnable() {
-            @Override
-            public void run() {
-                assertEquals(replicaSet.getCurrentSize().intValue(), 3);
-                for (MongoDBServer secondary : replicaSet.getSecondaries()) {
-                    DBObject docOut = MongoDBTestHelper.getById(secondary, documentId);
-                    assertEquals(docOut.get("meaning-of-life"), 42);
-                }
-            }
-        });
-    }
-
-    @Test(groups = "Integration")
-    public void testCanResizeAndReadFromNewInstances() {
-        final MongoDBReplicaSet replicaSet = makeAndStartReplicaSet(3, "resize-and-read-from-secondaries");
-
-        // Test we can a document written to the primary from all secondaries
-        final String documentId = MongoDBTestHelper.insert(replicaSet.getPrimary(), "meaning-of-life", 42);
-        Asserts.succeedsEventually(ImmutableMap.of("timeout", TIMEOUT), new Runnable() {
-            @Override
-            public void run() {
-                assertEquals(replicaSet.getCurrentSize().intValue(), 3);
-                for (MongoDBServer secondary : replicaSet.getSecondaries()) {
-                    DBObject docOut = MongoDBTestHelper.getById(secondary, documentId);
-                    assertEquals(docOut.get("meaning-of-life"), 42);
-                }
-            }
-        });
-
-        // Resize and confirm new members get data
-        replicaSet.resize(5);
-        Asserts.succeedsEventually(ImmutableMap.of("timeout", TIMEOUT), new Runnable() {
-            @Override
-            public void run() {
-                assertEquals(replicaSet.getCurrentSize().intValue(), 5);
-                Collection<MongoDBServer> secondaries = replicaSet.getSecondaries();
-                assertEquals(secondaries.size(), 4);
-                for (MongoDBServer secondary : secondaries) {
-                    DBObject docOut = MongoDBTestHelper.getById(secondary, documentId);
-                    assertEquals(docOut.get("meaning-of-life"), 42);
-                }
-            }
-        });
-
-    }
-
-    @Test(groups = "Integration")
-    public void testResizeToEvenNumberOfMembers() {
-        final MongoDBReplicaSet replicaSet = makeAndStartReplicaSet(3, "resize-even-ignored");
-        assertEquals(replicaSet.getCurrentSize().intValue(), 3);
-        replicaSet.resize(4);
-        Asserts.succeedsEventually(new Runnable() {
-            @Override
-            public void run() {
-                assertEquals(replicaSet.getCurrentSize().intValue(), 4);
-            }
-        });
-    }
-
-    /**
-     * Test replacing the primary succeeds. More interesting than replacing a secondary
-     * because the removal of a primary must happen _through_ the primary. The flow is:
-     *  - Brooklyn removes the server from the set and stops it
-     *  - The remaining members of the set elect a new primary
-     *  - We remove the original primary from the new primary.
-     */
-    @Test(groups = "Integration")
-    public void testReplacePrimary() {
-        final MongoDBReplicaSet replicaSet = makeAndStartReplicaSet(3, "replace-primary");
-        final MongoDBServer replaced = replicaSet.getPrimary();
-        replicaSet.replaceMember(replaced.getId());
-        Asserts.succeedsEventually(ImmutableMap.of("timeout", TIMEOUT), new Runnable() {
-            @Override
-            public void run() {
-                assertEquals(replicaSet.getCurrentSize().intValue(), 3);
-                for (Entity member : replicaSet.getMembers()) {
-                    assertNotEquals(member.getId(), replaced.getId());
-                }
-                assertNotNull(replicaSet.getPrimary());
-                assertNotEquals(replicaSet.getPrimary().getId(), replaced.getId(), "Expected a new primary to have been elected");
-            }
-        });
-    }
-
-    @Test(groups = "Integration")
-    public void testRemovePrimary() {
-        final MongoDBReplicaSet replicaSet = makeAndStartReplicaSet(3, "remove-primary");
-        final MongoDBServer removed = replicaSet.getPrimary();
-
-        replicaSet.removeMember(removed);
-        removed.stop();
-        Asserts.succeedsEventually(ImmutableMap.of("timeout", TIMEOUT), new Runnable() {
-            @Override
-            public void run() {
-                assertEquals(replicaSet.getCurrentSize().intValue(), 2);
-                for (Entity member : replicaSet.getMembers()) {
-                    assertNotEquals(member.getId(), removed.getId());
-                }
-                assertNotNull(replicaSet.getPrimary());
-                assertNotEquals(replicaSet.getPrimary().getId(), removed.getId(), "Expected a new primary to have been elected");
-            }
-        });
-    }
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/mongodb/MongoDBRestartIntegrationTest.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/mongodb/MongoDBRestartIntegrationTest.java b/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/mongodb/MongoDBRestartIntegrationTest.java
deleted file mode 100644
index 17f5c6b..0000000
--- a/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/mongodb/MongoDBRestartIntegrationTest.java
+++ /dev/null
@@ -1,42 +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 org.apache.brooklyn.entity.nosql.mongodb;
-
-import org.apache.brooklyn.api.entity.EntitySpec;
-import org.apache.brooklyn.entity.nosql.mongodb.MongoDBServer;
-import org.apache.brooklyn.entity.software.base.AbstractSoftwareProcessRestartIntegrationTest;
-import org.apache.brooklyn.entity.software.base.SoftwareProcess;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testng.annotations.Test;
-
-/**
- * Tests restart of the software *process* (as opposed to the VM).
- */
-@Test(groups="Integration")
-public class MongoDBRestartIntegrationTest extends AbstractSoftwareProcessRestartIntegrationTest {
-    
-    @SuppressWarnings("unused")
-    private static final Logger LOG = LoggerFactory.getLogger(MongoDBRestartIntegrationTest.class);
-
-    @Override
-    protected EntitySpec<? extends SoftwareProcess> newEntitySpec() {
-        return EntitySpec.create(MongoDBServer.class);
-    }
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/mongodb/MongoDBSoftLayerLiveTest.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/mongodb/MongoDBSoftLayerLiveTest.java b/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/mongodb/MongoDBSoftLayerLiveTest.java
deleted file mode 100644
index be6c33b..0000000
--- a/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/mongodb/MongoDBSoftLayerLiveTest.java
+++ /dev/null
@@ -1,55 +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 org.apache.brooklyn.entity.nosql.mongodb;
-
-import static org.testng.Assert.assertEquals;
-
-import org.apache.brooklyn.api.entity.EntitySpec;
-import org.apache.brooklyn.api.location.Location;
-import org.apache.brooklyn.entity.AbstractSoftlayerLiveTest;
-import org.apache.brooklyn.test.EntityTestUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-import com.mongodb.DBObject;
-
-public class MongoDBSoftLayerLiveTest extends AbstractSoftlayerLiveTest {
-
-    @SuppressWarnings("unused")
-    private static final Logger LOG = LoggerFactory.getLogger(MongoDBSoftLayerLiveTest.class);
-
-    @Override
-    protected void doTest(Location loc) throws Exception {
-        MongoDBServer entity = app.createAndManageChild(EntitySpec.create(MongoDBServer.class)
-                .configure("mongodbConfTemplateUrl", "classpath:///test-mongodb.conf"));
-        app.start(ImmutableList.of(loc));
-
-        EntityTestUtils.assertAttributeEqualsEventually(entity, MongoDBServer.SERVICE_UP, true);
-
-        String id = MongoDBTestHelper.insert(entity, "hello", "world!");
-        DBObject docOut = MongoDBTestHelper.getById(entity, id);
-        assertEquals(docOut.get("hello"), "world!");
-    }
-
-    @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/brooklyn-library/blob/02abbab0/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/mongodb/MongoDBTestHelper.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/mongodb/MongoDBTestHelper.java b/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/mongodb/MongoDBTestHelper.java
deleted file mode 100644
index 76b2a91..0000000
--- a/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/mongodb/MongoDBTestHelper.java
+++ /dev/null
@@ -1,123 +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 org.apache.brooklyn.entity.nosql.mongodb;
-
-import java.net.UnknownHostException;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.brooklyn.core.location.access.BrooklynAccessUtils;
-import org.bson.types.ObjectId;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.base.Throwables;
-import com.google.common.net.HostAndPort;
-import com.mongodb.BasicDBObject;
-import com.mongodb.CommandResult;
-import com.mongodb.DB;
-import com.mongodb.DBCollection;
-import com.mongodb.DBObject;
-import com.mongodb.MongoClient;
-import com.mongodb.ReadPreference;
-
-public class MongoDBTestHelper {
-
-    private static final Logger LOG = LoggerFactory.getLogger(MongoDBTestHelper.class);
-
-    private static final String TEST_DB = "brooklyn_test";
-    private static final String TEST_COLLECTION = "test_collection";
-    private static final String ADMIN_DB = "admin";
-
-    /**
-     * Inserts a new object with { key: value } at given server.
-     * @return The new document's id
-     */
-    public static String insert(AbstractMongoDBServer entity, String key, Object value) {
-        LOG.info("Inserting {}:{} at {}", new Object[]{key, value, entity});
-        MongoClient mongoClient = clientForServer(entity);
-        try {
-            DB db = mongoClient.getDB(TEST_DB);
-            DBCollection testCollection = db.getCollection(TEST_COLLECTION);
-            BasicDBObject doc = new BasicDBObject(key, value);
-            testCollection.insert(doc);
-            ObjectId id = (ObjectId) doc.get("_id");
-            return id.toString();
-        } finally {
-            mongoClient.close();
-        }
-    }
-
-    /** @return The {@link DBObject} representing the object with the given id */
-    public static DBObject getById(AbstractMongoDBServer entity, String id) {
-        LOG.info("Getting {} from {}", new Object[]{id, entity});
-        MongoClient mongoClient = clientForServer(entity);
-        // Secondary preferred means the driver will let us read from secondaries too.
-        mongoClient.setReadPreference(ReadPreference.secondaryPreferred());
-        try {
-            DB db = mongoClient.getDB(TEST_DB);
-            DBCollection testCollection = db.getCollection(TEST_COLLECTION);
-            return testCollection.findOne(new BasicDBObject("_id", new ObjectId(id)));
-        } finally {
-            mongoClient.close();
-        }
-    }
-    
-    public static List<String> getDatabaseNames(AbstractMongoDBServer entity) {
-        LOG.info("Getting database names from {}", entity);
-        MongoClient mongoClient = clientForServer(entity);
-        try {
-            return mongoClient.getDatabaseNames();
-        } finally {
-            mongoClient.close();
-        }
-    }
-    
-    public static boolean isConfigServer(AbstractMongoDBServer entity) {
-        LOG.info("Checking if {} is a config server", entity);
-        MongoClient mongoClient = clientForServer(entity);
-        try {
-            DB db = mongoClient.getDB(ADMIN_DB);
-            CommandResult commandResult = db.command("getCmdLineOpts");
-            Map<?, ?> parsedArgs = (Map<?, ?>)commandResult.get("parsed");
-            if (parsedArgs == null) return false;
-            Boolean configServer = (Boolean)parsedArgs.get("configsvr");
-            if (configServer != null) {
-                // v2.5 format
-                return Boolean.TRUE.equals(configServer);
-            } else {
-                // v2.6 format
-                String role = (String) ((Map)parsedArgs.get("sharding")).get("clusterRole");
-                return "configsvr".equals(role);
-            }
-        } finally {
-            mongoClient.close();
-        }
-    }
-
-    private static MongoClient clientForServer(AbstractMongoDBServer server) {
-        try {
-            HostAndPort hap = BrooklynAccessUtils.getBrooklynAccessibleAddress(server, server.getAttribute(MongoDBServer.PORT));
-            return new MongoClient(hap.getHostText(), hap.getPort());
-        } catch (Exception e) {
-            // Fail whatever test called this method.
-            throw Throwables.propagate(e);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/mongodb/MongoDBWinEc2LiveTest.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/mongodb/MongoDBWinEc2LiveTest.java b/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/mongodb/MongoDBWinEc2LiveTest.java
deleted file mode 100644
index e4233ab..0000000
--- a/brooklyn-library/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/mongodb/MongoDBWinEc2LiveTest.java
+++ /dev/null
@@ -1,138 +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 org.apache.brooklyn.entity.nosql.mongodb;
-
-import org.apache.brooklyn.api.entity.EntitySpec;
-import org.apache.brooklyn.api.location.MachineProvisioningLocation;
-import org.apache.brooklyn.core.entity.Attributes;
-import org.apache.brooklyn.core.entity.BrooklynConfigKeys;
-import org.apache.brooklyn.core.entity.Entities;
-import org.apache.brooklyn.core.entity.factory.ApplicationBuilder;
-import org.apache.brooklyn.core.entity.lifecycle.Lifecycle;
-import org.apache.brooklyn.core.internal.BrooklynProperties;
-import org.apache.brooklyn.core.mgmt.internal.ManagementContextInternal;
-import org.apache.brooklyn.core.test.entity.LocalManagementContextForTests;
-import org.apache.brooklyn.core.test.entity.TestApplication;
-import org.apache.brooklyn.entity.software.base.VanillaWindowsProcess;
-import org.apache.brooklyn.entity.software.base.test.location.WindowsTestFixture;
-import org.apache.brooklyn.location.winrm.WinRmMachineLocation;
-import org.apache.brooklyn.test.EntityTestUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-
-public class MongoDBWinEc2LiveTest {
-    private static final Logger LOG = LoggerFactory.getLogger(MongoDBWinEc2LiveTest.class);
-
-    protected ManagementContextInternal mgmt;
-    protected TestApplication app;
-    protected MachineProvisioningLocation<WinRmMachineLocation> location;
-    protected WinRmMachineLocation machine;
-
-    @BeforeClass(alwaysRun = true)
-    public void setUpClass() throws Exception {
-        mgmt = new LocalManagementContextForTests(BrooklynProperties.Factory.newDefault());
-
-        location = WindowsTestFixture.setUpWindowsLocation(mgmt);
-        machine = location.obtain(ImmutableMap.of());
-    }
-
-    @AfterClass(alwaysRun = true)
-    public void tearDownClass() throws Exception {
-        try {
-            try {
-                if (location != null)
-                    location.release(machine);
-            } finally {
-                if (mgmt != null)
-                    Entities.destroyAll(mgmt);
-            }
-        } catch (Throwable t) {
-            LOG.error("Caught exception in tearDownClass method", t);
-        } finally {
-            mgmt = null;
-        }
-    }
-
-    @BeforeMethod(alwaysRun = true)
-    public void setUp() throws Exception {
-        EntitySpec<TestApplication> appSpec = EntitySpec.create(TestApplication.class)
-                .configure(BrooklynConfigKeys.SKIP_ON_BOX_BASE_DIR_RESOLUTION, true);
-        app = ApplicationBuilder.newManagedApp(appSpec, mgmt);
-    }
-
-    @AfterMethod(alwaysRun = true)
-    public void tearDown() throws Exception {
-        try {
-            try {
-                if (app != null)
-                    Entities.destroy(app);
-            } catch (Throwable t) {
-                LOG.error("Caught exception in tearDown method", t);
-            }
-        } finally {
-            app = null;
-        }
-    }
-
-    @Test(groups = "Live")
-    public void doTest() {
-
-        ImmutableMap<String, String> installTemplates = new ImmutableMap.Builder<String, String>()
-                .put("classpath://org/apache/brooklyn/entity/nosql/mongodb/win/install_mongodb.ps1", "C:\\install_mongodb.ps1")
-                .put("classpath://org/apache/brooklyn/entity/nosql/mongodb/win/configure_mongodb.ps1", "C:\\configure_mongodb.ps1")
-                .put("classpath://org/apache/brooklyn/entity/nosql/mongodb/win/launch_mongodb.ps1", "C:\\launch_mongodb.ps1")
-                .put("classpath://org/apache/brooklyn/entity/nosql/mongodb/win/stop_mongodb.ps1", "C:\\stop_mongodb.ps1")
-                .put("classpath://org/apache/brooklyn/entity/nosql/mongodb/win/checkrunning_mongodb.ps1", "C:\\checkrunning_mongodb.ps1")
-                .build();
-
-        VanillaWindowsProcess entity = app.createAndManageChild(EntitySpec.create(VanillaWindowsProcess.class)
-                .configure(VanillaWindowsProcess.INSTALL_TEMPLATES, installTemplates)
-                .configure(VanillaWindowsProcess.INSTALL_POWERSHELL_COMMAND, "C:\\install_mongodb.ps1")
-                .configure(VanillaWindowsProcess.CUSTOMIZE_POWERSHELL_COMMAND, "C:\\configure_mongodb.ps1")
-                .configure(VanillaWindowsProcess.LAUNCH_POWERSHELL_COMMAND, "C:\\launch_mongodb.ps1")
-                .configure(VanillaWindowsProcess.CHECK_RUNNING_POWERSHELL_COMMAND, "C:\\checkrunning_mongodb.ps1")
-                .configure(VanillaWindowsProcess.STOP_POWERSHELL_COMMAND, "C:\\stop_mongodb.ps1")
-                .configure(VanillaWindowsProcess.PROVISIONING_PROPERTIES, ImmutableMap.<String, Object> of("required.ports", "27017"))
-                .configure("mongodb.download.url", "https://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-ssl-3.0.6-signed.msi")
-                .configure("mongodb.instance.name", "Instance1"));
-
-        app.start(ImmutableList.of(machine));
-        LOG.info("app started; asserting up");
-        EntityTestUtils.assertAttributeEqualsEventually(entity, Attributes.SERVICE_UP, true);
-        EntityTestUtils.assertAttributeEqualsEventually(entity, Attributes.SERVICE_STATE_ACTUAL, Lifecycle.RUNNING);
-
-        entity.stop();
-        LOG.info("stopping entity");
-        EntityTestUtils.assertAttributeEqualsEventually(entity, Attributes.SERVICE_STATE_ACTUAL, Lifecycle.STOPPED);
-        EntityTestUtils.assertAttributeEqualsEventually(entity, Attributes.SERVICE_UP, false);
-    }
-
-    @Test(enabled = false)
-    public void testDummy() {
-    } // Convince TestNG IDE integration that this really does have test methods
-
-}