brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henev...@apache.org
Subject [45/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!)
Date Mon, 01 Feb 2016 17:48:21 GMT
http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/qa/src/test/java/org/apache/brooklyn/qa/load/LoadTest.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/qa/src/test/java/org/apache/brooklyn/qa/load/LoadTest.java b/brooklyn-library/qa/src/test/java/org/apache/brooklyn/qa/load/LoadTest.java
deleted file mode 100644
index 6a57570..0000000
--- a/brooklyn-library/qa/src/test/java/org/apache/brooklyn/qa/load/LoadTest.java
+++ /dev/null
@@ -1,241 +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.qa.load;
-
-import static org.testng.Assert.assertEquals;
-
-import java.io.File;
-import java.util.Collections;
-import java.util.List;
-import java.util.concurrent.Callable;
-import java.util.concurrent.Executors;
-import java.util.concurrent.Future;
-import java.util.concurrent.TimeUnit;
-
-import org.apache.brooklyn.api.entity.EntitySpec;
-import org.apache.brooklyn.api.location.Location;
-import org.apache.brooklyn.api.mgmt.ManagementContext;
-import org.apache.brooklyn.api.mgmt.ha.HighAvailabilityMode;
-import org.apache.brooklyn.core.entity.Entities;
-import org.apache.brooklyn.core.entity.StartableApplication;
-import org.apache.brooklyn.core.entity.trait.Startable;
-import org.apache.brooklyn.core.mgmt.internal.LocalManagementContext;
-import org.apache.brooklyn.core.mgmt.persist.PersistMode;
-import org.apache.brooklyn.launcher.BrooklynLauncher;
-import org.apache.brooklyn.test.PerformanceTestUtils;
-import org.apache.brooklyn.util.os.Os;
-import org.apache.brooklyn.util.time.Duration;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import com.google.common.base.Stopwatch;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Lists;
-import com.google.common.io.Files;
-import com.google.common.util.concurrent.Futures;
-import com.google.common.util.concurrent.ListenableFuture;
-import com.google.common.util.concurrent.ListeningExecutorService;
-import com.google.common.util.concurrent.MoreExecutors;
-
-/**
- * Customers ask about the scalability of Brooklyn. These load tests investigate how many 
- * concurrent apps can be deployed and managed by a single Brooklyn management node.
- * 
- * The apps are "simulated" in that they don't create the underlying resources 
- * (we are not checking if the test machine can run 100s of app-servers simultaneously!) 
- * The install/customize/launch will instead execute ssh commands of comparable length,
- * but that just echo rather than execute the actual commands.
- * 
- * "SIMULATE_EXTERNAL_MONITORING" means that we do not poll the entities directly (over ssh, http or 
- * whatever). Instead we simulate the metrics being injected directly to be set on the entity (e.g. 
- * having been collected from a Graphite server).
- * 
- * "SKIP_SSH_ON_START" means don't do the normal install+customize+launch ssh commands. Instead, just
- * startup the entities so we can monitor their resource usage.
- */
-public class LoadTest {
-
-    // TODO Could/should issue provisioning request through REST api, rather than programmatically; 
-    // and poll to detect completion.
-    
-    /*
-     * Useful commands when investigating:
-     *     LOG_FILE=usage/qa/brooklyn-camp-tests.log
-     *     grep -E "OutOfMemoryError|[P|p]rovisioning time|sleeping before|CPU fraction|LoadTest using" $LOG_FILE | less
-     *     grep -E "OutOfMemoryError|[P|p]rovisioning time" $LOG_FILE; grep "CPU fraction" $LOG_FILE | tail -1; grep "LoadTest using" $LOG_FILE | tail -1
-     *     grep -E "OutOfMemoryError|LoadTest using" $LOG_FILE
-     */
-    private static final Logger LOG = LoggerFactory.getLogger(LoadTest.class);
-
-    private File persistenceDir;
-    private BrooklynLauncher launcher;
-    private String webServerUrl;
-    private ManagementContext managementContext;
-    private ListeningExecutorService executor;
-    private Future<?> cpuFuture;
-    
-    private Location localhost;
-    
-    List<Duration> provisioningTimes;
-
-
-    @BeforeMethod(alwaysRun=true)
-    public void setUp() throws Exception {
-        // Create management node
-        persistenceDir = Files.createTempDir();
-        launcher = BrooklynLauncher.newInstance()
-                .persistMode(PersistMode.CLEAN)
-                .highAvailabilityMode(HighAvailabilityMode.MASTER)
-                .persistenceDir(persistenceDir)
-                .start();
-        webServerUrl = launcher.getServerDetails().getWebServerUrl();
-        managementContext = launcher.getServerDetails().getManagementContext();
-
-        localhost = managementContext.getLocationRegistry().resolve("localhost");
-        
-        provisioningTimes = Collections.synchronizedList(Lists.<Duration>newArrayList());
-
-        // Create executors
-        executor = MoreExecutors.listeningDecorator(Executors.newCachedThreadPool());
-
-        // Monitor utilisation (memory/CPU) while tests run
-        executor.submit(new Callable<Void>() {
-            public Void call() {
-                try {
-                    while (true) {
-                        managementContext.getExecutionManager(); // force GC to be instantiated
-                        String usage = ((LocalManagementContext)managementContext).getGarbageCollector().getUsageString();
-                        LOG.info("LoadTest using "+usage);
-                        Thread.sleep(1000);
-                    }
-                } catch (InterruptedException e) {
-                    Thread.currentThread().interrupt(); // exit gracefully
-                } catch (Exception e) {
-                    LOG.error("Error getting usage info", e);
-                }
-                return null;
-            }});
-        
-        cpuFuture = PerformanceTestUtils.sampleProcessCpuTime(Duration.ONE_SECOND, "during testProvisionAppsConcurrently");
-
-    }
-    
-    @AfterMethod(alwaysRun=true)
-    public void tearDown() throws Exception {
-        if (cpuFuture != null) cpuFuture.cancel(true);
-        if (executor != null) executor.shutdownNow();
-        if (launcher != null) launcher.terminate();
-        if (persistenceDir != null) Os.deleteRecursively(persistenceDir);
-    }
-    
-    /**
-     * Creates multiple apps simultaneously. 
-     * 
-     * Long-term target is 50 concurrent provisioning requests (which may be issued while there are
-     * many existing applications under management). Until we reach that point, we can partition the
-     * load across multiple (separate) brooklyn management nodes.
-     *   TODO TBD: is that 50 VMs worth, or 50 apps with 4 VMs in each? 
-     * 
-     * TODO Does not measure the cost of jclouds for creating all the VMs/containers.
-     */
-    @Test(groups="Acceptance")
-    public void testLocalhostProvisioningAppsConcurrently() throws Exception {
-        final int NUM_CONCURRENT_APPS_PROVISIONING = 20; 
-        
-        List<ListenableFuture<StartableApplication>> futures = Lists.newArrayList();
-        for (int i = 0; i < NUM_CONCURRENT_APPS_PROVISIONING; i++) {
-            ListenableFuture<StartableApplication> future = executor.submit(newProvisionAppTask(managementContext, 
-                    EntitySpec.create(StartableApplication.class, SimulatedTheeTierApp.class)
-                            .configure(SimulatedTheeTierApp.SIMULATE_EXTERNAL_MONITORING, true)
-                            .displayName("Simulated app "+i)));
-            futures.add(future);
-        }
-        
-        List<StartableApplication> apps = Futures.allAsList(futures).get();
-        
-        for (StartableApplication app : apps) {
-            assertEquals(app.getAttribute(Startable.SERVICE_UP), (Boolean)true);
-        }
-    }
-    
-    /**
-     * Creates many apps, to monitor resource usage etc.
-     * 
-     * "SIMULATE_EXTERNAL_MONITORING" means that we do not poll the entities directly (over ssh, http or 
-     * whatever). Instead we simulate the metrics being injected directly to be set on the entity (e.g. 
-     * having been collected from a Graphite server).
-     * 
-     * Long-term target is 2500 VMs under management.
-     * Until we reach that point, we can partition the load across multiple (separate) brooklyn management nodes.
-     */
-    @Test(groups="Acceptance")
-    public void testLocalhostManyApps() throws Exception {
-        final int NUM_APPS = 630; // target is 2500 VMs; each blueprint has 4 (rounding up)
-        final int NUM_APPS_PER_BATCH = 10;
-        final int SLEEP_BETWEEN_BATCHES = 10*1000;
-        final boolean SKIP_SSH_ON_START = true; // getting ssh errors otherwise!
-        
-        int counter = 0;
-        
-        for (int i = 0; i < NUM_APPS / NUM_APPS_PER_BATCH; i++) {
-            List<ListenableFuture<StartableApplication>> futures = Lists.newArrayList();
-            for (int j = 0; j < NUM_APPS_PER_BATCH; j++) {
-                ListenableFuture<StartableApplication> future = executor.submit(newProvisionAppTask(
-                        managementContext, 
-                        EntitySpec.create(StartableApplication.class, SimulatedTheeTierApp.class)
-                                .configure(SimulatedTheeTierApp.SIMULATE_EXTERNAL_MONITORING, true)
-                                .configure(SimulatedTheeTierApp.SKIP_SSH_ON_START, SKIP_SSH_ON_START)
-                                .displayName("Simulated app "+(++counter))));
-                futures.add(future);
-            }
-            
-            List<StartableApplication> apps = Futures.allAsList(futures).get();
-            
-            for (StartableApplication app : apps) {
-                assertEquals(app.getAttribute(Startable.SERVICE_UP), (Boolean)true);
-            }
-
-            synchronized (provisioningTimes) {
-                LOG.info("cycle="+i+"; numApps="+counter+": provisioning times: "+provisioningTimes);
-                provisioningTimes.clear();
-            }
-
-            LOG.info("cycle="+i+"; numApps="+counter+": sleeping before next batch of apps");
-            Thread.sleep(SLEEP_BETWEEN_BATCHES);
-        }
-    }
-    
-    protected <T extends StartableApplication> Callable<T> newProvisionAppTask(final ManagementContext managementContext, final EntitySpec<T> appSpec) {
-        return new Callable<T>() {
-            public T call() {
-                Stopwatch stopwatch = Stopwatch.createStarted();
-                T app = managementContext.getEntityManager().createEntity(appSpec);
-                app.start(ImmutableList.of(localhost));
-                Duration duration = Duration.of(stopwatch.elapsed(TimeUnit.MILLISECONDS), TimeUnit.MILLISECONDS);
-                LOG.info("Provisioning time: "+duration);
-                provisioningTimes.add(duration);
-
-                return app;
-            }
-        };
-    }
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/qa/src/test/java/org/apache/brooklyn/qa/longevity/MonitorUtilsTest.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/qa/src/test/java/org/apache/brooklyn/qa/longevity/MonitorUtilsTest.java b/brooklyn-library/qa/src/test/java/org/apache/brooklyn/qa/longevity/MonitorUtilsTest.java
deleted file mode 100644
index f58963c..0000000
--- a/brooklyn-library/qa/src/test/java/org/apache/brooklyn/qa/longevity/MonitorUtilsTest.java
+++ /dev/null
@@ -1,164 +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.qa.longevity;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
-import static org.testng.Assert.assertTrue;
-import static org.testng.Assert.fail;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URL;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import org.apache.brooklyn.qa.longevity.MonitorUtils.ProcessHasStderr;
-import org.apache.brooklyn.util.os.Os;
-import org.apache.brooklyn.util.text.Strings;
-import org.testng.annotations.Test;
-
-import com.google.common.base.Charsets;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.io.Files;
-
-public class MonitorUtilsTest {
-
-    @Test(enabled=false, timeOut=1000) // Demonstrates that process.waitFor() hangs for big output streams
-    public void testExecuteAndWaitFor() throws Exception {
-        Process process = createDumpingProcess(false);
-        process.waitFor();
-        fail("Should block while waiting to consume process output");
-    }
-
-    @Test(enabled=false, timeOut=1000) // Demonstrates that process.waitFor() hangs for big err streams
-    public void testExecuteAndWaitForErr() throws Exception {
-        Process process = createDumpingProcess(true);
-        process.waitFor();
-        fail("Should block while waiting to consume process output");
-    }
-
-    @Test(timeOut=1000)
-    public void testExecuteAndWaitForConsumingOutputStream() throws Exception {
-        Process process = createDumpingProcess(false);
-        String out = MonitorUtils.waitFor(process);
-        assertTrue(out.length() > 100000, "out.size="+out.length());
-    }
-
-    @Test(timeOut=1000, expectedExceptions=IllegalStateException.class)
-    public void testExecuteAndWaitForConsumingErrorStream() throws Exception {
-        Process process = createDumpingProcess(true);
-        MonitorUtils.waitFor(process);
-    }
-
-    private Process createDumpingProcess(boolean writeToErr) throws IOException {
-        String errSuffix = writeToErr ? " >&2" : "";
-        //Windows limits the length of the arguments so echo multiple times instead
-        String bigstr = Strings.repeat("a", 8000);
-        String bigcmd = Strings.repeat(getSilentPrefix() + "echo " + bigstr + errSuffix + Os.LINE_SEPARATOR, 15);
-        File file = Os.newTempFile("test-consume", ".bat");
-        file.setExecutable(true);
-        Files.write(bigcmd, file, Charsets.UTF_8);
-        Process process = MonitorUtils.exec(file.getAbsolutePath());
-        return process;
-    }
-
-    @Test(groups="UNIX")
-    public void testFindOwnPid() throws Exception {
-        int ownpid = MonitorUtils.findOwnPid();
-        assertTrue(ownpid > 0, "ownpid=$ownpid");
-        assertTrue(MonitorUtils.isPidRunning(ownpid, "java"),"java is not running");
-    }
-
-    @Test(groups="UNIX")
-    public void testIsPidRunning() throws Exception {
-        int usedPid = MonitorUtils.findOwnPid();
-
-        //the child process will terminate freeing it PID
-        String[] cmd = new String[]{"bash", "-c", "echo $$"};
-        Process process = Runtime.getRuntime().exec(cmd);
-        String out = MonitorUtils.waitFor(process);
-        int unusedPid = Integer.parseInt(out.trim());
-
-        assertTrue(MonitorUtils.isPidRunning(usedPid));
-        assertFalse(MonitorUtils.isPidRunning(unusedPid));
-        
-        try {
-            assertFalse(MonitorUtils.isPidRunning(1234567)); // too large
-        } catch (ProcessHasStderr e) {
-            // expected on osx
-        }
-    }
-
-    @Test(groups="UNIX")
-    public void testGetRunningPids() throws Exception {
-        int ownpid = MonitorUtils.findOwnPid();
-
-        List<Integer> javapids = MonitorUtils.getRunningPids("java");
-
-        assertTrue(javapids.contains(ownpid), "javapids="+javapids+"; ownpid="+ownpid);
-    }
-
-    @Test
-    public void testIsUrlUp() throws Exception {
-        assertFalse(MonitorUtils.isUrlUp(new URL("http://localhost/thispathdoesnotexist")));
-    }
-
-    @Test(groups="UNIX")
-    public void testSearchLog() throws Exception {
-        String fileContents = "line1\nline2\nline3\n";
-        File file = File.createTempFile("monitorUtilsTest.testSearchLog", ".txt");
-        Files.write(fileContents, file, Charsets.UTF_8);
-
-        try {
-            assertEquals(MonitorUtils.searchLog(file, "line1"), Arrays.asList("line1"));
-            assertEquals(MonitorUtils.searchLog(file, "line1|line2"), Arrays.asList("line1", "line2"));
-            assertEquals(MonitorUtils.searchLog(file, "textnotthere"), Collections.emptyList());
-            assertEquals(MonitorUtils.searchLog(file, "line"), Arrays.asList("line1", "line2", "line3"));
-        } finally {
-            file.delete();
-        }
-    }
-
-    @Test(groups="Integration")
-    public void testMemoryUsage() throws Exception {
-        int ownpid = MonitorUtils.findOwnPid();
-
-        MonitorUtils.MemoryUsage memUsage = MonitorUtils.getMemoryUsage(ownpid);
-        assertTrue(memUsage.totalInstances > 0, memUsage.toString());
-        assertTrue(memUsage.totalMemoryBytes > 0, memUsage.toString());
-        assertEquals(memUsage.getInstanceCounts(), Collections.emptyMap());
-
-        MonitorUtils.MemoryUsage memUsage2 = MonitorUtils.getMemoryUsage(ownpid, MonitorUtilsTest.class.getCanonicalName(),0);
-        assertEquals(memUsage2.getInstanceCounts(), ImmutableMap.of(MonitorUtilsTest.class.getCanonicalName(), 1));
-
-        MonitorUtils.MemoryUsage memUsage3 = MonitorUtils.getMemoryUsage(ownpid, MonitorUtilsTest.class.getCanonicalName(), 2);
-        assertEquals(memUsage3.getInstanceCounts(), Collections.emptyMap());
-    }
-
-    private String getSilentPrefix() {
-        if (Os.isMicrosoftWindows()) {
-            return "@";
-        } else {
-            return "";
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/qa/src/test/java/org/apache/brooklyn/qa/longevity/webcluster/SinusoidalLoadGenerator.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/qa/src/test/java/org/apache/brooklyn/qa/longevity/webcluster/SinusoidalLoadGenerator.java b/brooklyn-library/qa/src/test/java/org/apache/brooklyn/qa/longevity/webcluster/SinusoidalLoadGenerator.java
deleted file mode 100644
index a8dd8da..0000000
--- a/brooklyn-library/qa/src/test/java/org/apache/brooklyn/qa/longevity/webcluster/SinusoidalLoadGenerator.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 org.apache.brooklyn.qa.longevity.webcluster;
-
-import java.util.concurrent.Executors;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.TimeUnit;
-
-import org.apache.brooklyn.api.entity.EntityLocal;
-import org.apache.brooklyn.api.sensor.AttributeSensor;
-import org.apache.brooklyn.config.ConfigKey;
-import org.apache.brooklyn.core.config.ConfigKeys;
-import org.apache.brooklyn.core.enricher.AbstractEnricher;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.base.Throwables;
-import com.google.common.reflect.TypeToken;
-
-/**
- * Periodically publishes values in the range of 0 to #amplitude. 
- * The value varies sinusoidally over time.
- */
-public class SinusoidalLoadGenerator extends AbstractEnricher {
-
-    private static final Logger LOG = LoggerFactory.getLogger(SinusoidalLoadGenerator.class);
-
-    public static final ConfigKey<AttributeSensor<Double>> TARGET = ConfigKeys.newConfigKey(new TypeToken<AttributeSensor<Double>>() {}, "target");
-    
-    public static final ConfigKey<Long> PUBLISH_PERIOD_MS = ConfigKeys.newLongConfigKey("publishPeriodMs");
-
-    public static final ConfigKey<Long> SIN_PERIOD_MS = ConfigKeys.newLongConfigKey("sinPeriodMs");
-
-    public static final ConfigKey<Double> SIN_AMPLITUDE = ConfigKeys.newDoubleConfigKey("sinAmplitude");
-
-    private final ScheduledExecutorService executor;
-    
-    public SinusoidalLoadGenerator() {
-        this.executor = Executors.newSingleThreadScheduledExecutor();
-    }
-    
-    public SinusoidalLoadGenerator(AttributeSensor<Double> target, long publishPeriodMs, long sinPeriodMs, double sinAmplitude) {
-        config().set(TARGET, target);
-        config().set(PUBLISH_PERIOD_MS, publishPeriodMs);
-        config().set(SIN_PERIOD_MS, sinPeriodMs);
-        config().set(SIN_AMPLITUDE, sinAmplitude);
-        this.executor = Executors.newSingleThreadScheduledExecutor();
-    }
-    
-    @Override
-    public void setEntity(final EntityLocal entity) {
-        super.setEntity(entity);
-        
-        executor.scheduleAtFixedRate(new Runnable() {
-            @Override public void run() {
-                try {
-                    long time = System.currentTimeMillis();
-                    double val = getRequiredConfig(SIN_AMPLITUDE) * (1 + Math.sin( (1.0*time) / getRequiredConfig(SIN_PERIOD_MS) * Math.PI * 2  - Math.PI/2 )) / 2;
-                    entity.sensors().set(getRequiredConfig(TARGET), val);
-                } catch (Throwable t) {
-                    LOG.warn("Error generating sinusoidal-load metric", t);
-                    throw Throwables.propagate(t);
-                }
-            }
-
-        }, 0, getRequiredConfig(PUBLISH_PERIOD_MS), TimeUnit.MILLISECONDS);
-    }
-    
-    @Override
-    public void destroy() {
-        executor.shutdownNow();
-    }
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/qa/src/test/java/org/apache/brooklyn/qa/longevity/webcluster/WebClusterApp.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/qa/src/test/java/org/apache/brooklyn/qa/longevity/webcluster/WebClusterApp.java b/brooklyn-library/qa/src/test/java/org/apache/brooklyn/qa/longevity/webcluster/WebClusterApp.java
deleted file mode 100644
index 7c11803..0000000
--- a/brooklyn-library/qa/src/test/java/org/apache/brooklyn/qa/longevity/webcluster/WebClusterApp.java
+++ /dev/null
@@ -1,101 +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.qa.longevity.webcluster;
-
-import java.util.List;
-
-import org.apache.brooklyn.api.entity.EntitySpec;
-import org.apache.brooklyn.api.sensor.AttributeSensor;
-import org.apache.brooklyn.api.sensor.EnricherSpec;
-import org.apache.brooklyn.core.entity.AbstractApplication;
-import org.apache.brooklyn.core.entity.Entities;
-import org.apache.brooklyn.core.entity.StartableApplication;
-import org.apache.brooklyn.core.internal.BrooklynProperties;
-import org.apache.brooklyn.core.sensor.Sensors;
-import org.apache.brooklyn.enricher.stock.Enrichers;
-import org.apache.brooklyn.entity.proxy.nginx.NginxController;
-import org.apache.brooklyn.entity.webapp.ControlledDynamicWebAppCluster;
-import org.apache.brooklyn.entity.webapp.jboss.JBoss7Server;
-import org.apache.brooklyn.launcher.BrooklynLauncher;
-import org.apache.brooklyn.policy.autoscaling.AutoScalerPolicy;
-import org.apache.brooklyn.util.CommandLineUtil;
-
-import com.google.common.collect.Lists;
-
-public class WebClusterApp extends AbstractApplication {
-
-    static BrooklynProperties config = BrooklynProperties.Factory.newDefault();
-
-    public static final String WAR_PATH = "classpath://hello-world.war";
-
-    private static final long loadCyclePeriodMs = 2 * 60 * 1000L;
-
-    @Override
-    public void initApp() {
-        final AttributeSensor<Double> sinusoidalLoad =
-                Sensors.newDoubleSensor("brooklyn.qa.sinusoidalLoad", "Sinusoidal server load");
-        AttributeSensor<Double> averageLoad =
-                Sensors.newDoubleSensor("brooklyn.qa.averageLoad", "Average load in cluster");
-
-        NginxController nginxController = addChild(EntitySpec.create(NginxController.class)
-                // .configure("domain", "webclusterexample.brooklyn.local")
-                .configure("port", "8000+"));
-
-        EntitySpec<JBoss7Server> jbossSpec = EntitySpec.create(JBoss7Server.class)
-                .configure("httpPort", "8080+")
-                .configure("war", WAR_PATH)
-                .enricher(EnricherSpec.create(SinusoidalLoadGenerator.class)
-                        .configure(SinusoidalLoadGenerator.TARGET, sinusoidalLoad)
-                        .configure(SinusoidalLoadGenerator.PUBLISH_PERIOD_MS, 500L)
-                        .configure(SinusoidalLoadGenerator.SIN_PERIOD_MS, loadCyclePeriodMs)
-                        .configure(SinusoidalLoadGenerator.SIN_AMPLITUDE, 1d));
-
-        ControlledDynamicWebAppCluster web = addChild(EntitySpec.create(ControlledDynamicWebAppCluster.class)
-                .displayName("WebApp cluster")
-                .configure("controller", nginxController)
-                .configure("initialSize", 1)
-                .configure("memberSpec", jbossSpec));
-
-        web.getCluster().enrichers().add(Enrichers.builder()
-                .aggregating(sinusoidalLoad)
-                .publishing(averageLoad)
-                .fromMembers()
-                .computingAverage()
-                .build());
-        web.getCluster().policies().add(AutoScalerPolicy.builder()
-                .metric(averageLoad)
-                .sizeRange(1, 3)
-                .metricRange(0.3, 0.7)
-                .build());
-    }
-    
-    public static void main(String[] argv) {
-        List<String> args = Lists.newArrayList(argv);
-        String port =  CommandLineUtil.getCommandLineOption(args, "--port", "8081+");
-        String location = CommandLineUtil.getCommandLineOption(args, "--location", "localhost");
-
-        BrooklynLauncher launcher = BrooklynLauncher.newInstance()
-                .application(EntitySpec.create(StartableApplication.class, WebClusterApp.class).displayName("Brooklyn WebApp Cluster example"))
-                .webconsolePort(port)
-                .location(location)
-                .start();
-         
-        Entities.dumpInfo(launcher.getApplications());
-    }
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/qa/src/test/projects/downstream-parent-test/README
----------------------------------------------------------------------
diff --git a/brooklyn-library/qa/src/test/projects/downstream-parent-test/README b/brooklyn-library/qa/src/test/projects/downstream-parent-test/README
deleted file mode 100644
index 3f2f574..0000000
--- a/brooklyn-library/qa/src/test/projects/downstream-parent-test/README
+++ /dev/null
@@ -1,5 +0,0 @@
-A successful build of this project (`mvn clean verify`) means that projects that
-use brooklyn-downstream-parent can be loaded into Brooklyn's catalogue by default.
-
-If the build fails there is almost certainly something wrong with the parent and
-the wider consumers of Brooklyn will probably face similar problems.

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/qa/src/test/projects/downstream-parent-test/pom.xml
----------------------------------------------------------------------
diff --git a/brooklyn-library/qa/src/test/projects/downstream-parent-test/pom.xml b/brooklyn-library/qa/src/test/projects/downstream-parent-test/pom.xml
deleted file mode 100644
index 7e3c0e0..0000000
--- a/brooklyn-library/qa/src/test/projects/downstream-parent-test/pom.xml
+++ /dev/null
@@ -1,120 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-    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.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-
-    <groupId>org.apache.brooklyn.downstream-parent-test</groupId>
-    <artifactId>catalogue-load-test</artifactId>
-    <version>0.9.0-SNAPSHOT</version> <!-- BROOKLYN_VERSION -->
-    <packaging>jar</packaging>
-
-    <name>Downstream parent catalogue load test test</name>
-
-    <parent>
-        <groupId>org.apache.brooklyn</groupId>
-        <artifactId>brooklyn-downstream-parent</artifactId>
-        <version>0.9.0-SNAPSHOT</version> <!-- BROOKLYN_VERSION -->
-    </parent>
-
-    <repositories>
-        <repository>
-            <id>apache-snapshots</id>
-            <url>https://repository.apache.org/content/repositories/snapshots/</url>
-            <snapshots>
-                <enabled>true</enabled>
-            </snapshots>
-        </repository>
-    </repositories>
-
-    <pluginRepositories>
-        <pluginRepository>
-            <id>sonatype-nexus-snapshots</id>
-            <name>Sonatype Nexus Snapshots</name>
-            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
-            <releases>
-                <enabled>false</enabled>
-            </releases>
-            <snapshots>
-                <enabled>true</enabled>
-            </snapshots>
-        </pluginRepository>
-    </pluginRepositories>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.brooklyn</groupId>
-            <artifactId>brooklyn-all</artifactId>
-            <version>0.9.0-SNAPSHOT</version> <!-- BROOKLYN_VERSION -->
-            <scope>provided</scope>
-        </dependency>
-    </dependencies>
-
-    <build>
-        <resources>
-            <resource>
-                <directory>${basedir}/src/main/resources</directory>
-                <filtering>true</filtering>
-            </resource>
-        </resources>
-        <plugins>
-            <plugin>
-                <groupId>io.brooklyn.maven</groupId>
-                <artifactId>brooklyn-maven-plugin</artifactId>
-                <version>0.3.0-SNAPSHOT</version>
-                <executions>
-                    <execution>
-                        <id>Run and deploy Brooklyn</id>
-                        <goals>
-                            <goal>start-server</goal>
-                        </goals>
-                        <configuration>
-                            <bindPort>${bindPort}</bindPort>
-                            <!--
-                            Make sure that the test entities aren't already on the classpath.
-                            -->
-                            <outputDirOnClasspath>false</outputDirOnClasspath>
-                            <arguments>
-                                <argument>--catalogInitial</argument>
-                                <argument>${project.build.outputDirectory}/catalog.bom</argument>
-                            </arguments>
-                        </configuration>
-                    </execution>
-                    <execution>
-                        <id>Deploy entity from catalogue</id>
-                        <phase>integration-test</phase>
-                        <goals>
-                            <goal>deploy</goal>
-                        </goals>
-                        <configuration>
-                            <blueprint>${project.build.outputDirectory}/blueprint.yaml</blueprint>
-                        </configuration>
-                    </execution>
-                    <execution>
-                        <id>Stop Brooklyn</id>
-                        <goals>
-                            <goal>stop-server</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-        </plugins>
-    </build>
-</project>

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/qa/src/test/projects/downstream-parent-test/src/main/java/com/example/HelloEntity.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/qa/src/test/projects/downstream-parent-test/src/main/java/com/example/HelloEntity.java b/brooklyn-library/qa/src/test/projects/downstream-parent-test/src/main/java/com/example/HelloEntity.java
deleted file mode 100644
index 242708b..0000000
--- a/brooklyn-library/qa/src/test/projects/downstream-parent-test/src/main/java/com/example/HelloEntity.java
+++ /dev/null
@@ -1,26 +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 com.example;
-
-import org.apache.brooklyn.api.entity.Entity;
-import org.apache.brooklyn.api.entity.ImplementedBy;
-
-@ImplementedBy(HelloEntityImpl.class)
-public interface HelloEntity extends Entity {
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/qa/src/test/projects/downstream-parent-test/src/main/java/com/example/HelloEntityImpl.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/qa/src/test/projects/downstream-parent-test/src/main/java/com/example/HelloEntityImpl.java b/brooklyn-library/qa/src/test/projects/downstream-parent-test/src/main/java/com/example/HelloEntityImpl.java
deleted file mode 100644
index 76d9ffd..0000000
--- a/brooklyn-library/qa/src/test/projects/downstream-parent-test/src/main/java/com/example/HelloEntityImpl.java
+++ /dev/null
@@ -1,31 +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 com.example;
-
-import org.apache.brooklyn.core.entity.AbstractEntity;
-
-public class HelloEntityImpl extends AbstractEntity implements HelloEntity {
-
-    @Override
-    public void init() {
-        super.init();
-        System.out.println("Hello from the init method of the HelloEntity");
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/qa/src/test/projects/downstream-parent-test/src/main/resources/blueprint.yaml
----------------------------------------------------------------------
diff --git a/brooklyn-library/qa/src/test/projects/downstream-parent-test/src/main/resources/blueprint.yaml b/brooklyn-library/qa/src/test/projects/downstream-parent-test/src/main/resources/blueprint.yaml
deleted file mode 100644
index 76cc82e..0000000
--- a/brooklyn-library/qa/src/test/projects/downstream-parent-test/src/main/resources/blueprint.yaml
+++ /dev/null
@@ -1,19 +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.
-#
-services:
-- type: downstream-project

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/qa/src/test/projects/downstream-parent-test/src/main/resources/catalog.bom
----------------------------------------------------------------------
diff --git a/brooklyn-library/qa/src/test/projects/downstream-parent-test/src/main/resources/catalog.bom b/brooklyn-library/qa/src/test/projects/downstream-parent-test/src/main/resources/catalog.bom
deleted file mode 100644
index c168c72..0000000
--- a/brooklyn-library/qa/src/test/projects/downstream-parent-test/src/main/resources/catalog.bom
+++ /dev/null
@@ -1,33 +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.
-#
-brooklyn.catalog:
-  version: 1.0
-
-  brooklyn.libraries:
-  - "file://${project.build.directory}/${project.build.finalName}.${project.packaging}"
-
-  items:
-
-  - id: downstream-project
-    name: Downstream project
-    itemType: template
-    description: |
-      A downstream project
-    item:
-      services:
-      - type: com.example.HelloEntity

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/qa/src/test/resources/java-web-app-and-db-with-function.yaml
----------------------------------------------------------------------
diff --git a/brooklyn-library/qa/src/test/resources/java-web-app-and-db-with-function.yaml b/brooklyn-library/qa/src/test/resources/java-web-app-and-db-with-function.yaml
deleted file mode 100644
index 0f15729..0000000
--- a/brooklyn-library/qa/src/test/resources/java-web-app-and-db-with-function.yaml
+++ /dev/null
@@ -1,36 +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.
-#
-name: java-cluster-db-example
-services:
-- serviceType: org.apache.brooklyn.entity.webapp.ControlledDynamicWebAppCluster
-  name: My Web
-  location: localhost
-  brooklyn.config:
-    wars.root: http://search.maven.org/remotecontent?filepath=io/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.7.0-M1/brooklyn-example-hello-world-sql-webapp-0.7.0-M1.war
-    http.port: 9280+
-    proxy.http.port: 9210+
-    java.sysprops: 
-      brooklyn.example.db.url: $brooklyn:formatString("jdbc:%s%s?user=%s&password=%s",
-         component("db").attributeWhenReady("datastore.url"), "visitors", "brooklyn", "br00k11n")
-- serviceType: org.apache.brooklyn.entity.database.mysql.MySqlNode
-  id: db
-  name: My DB
-  location: localhost
-  brooklyn.config:
-    datastore.creation.script.url: classpath://visitors-creation-script.sql

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/qa/src/test/resources/java-web-app-and-db-with-policy.yaml
----------------------------------------------------------------------
diff --git a/brooklyn-library/qa/src/test/resources/java-web-app-and-db-with-policy.yaml b/brooklyn-library/qa/src/test/resources/java-web-app-and-db-with-policy.yaml
deleted file mode 100644
index 10ea4e5..0000000
--- a/brooklyn-library/qa/src/test/resources/java-web-app-and-db-with-policy.yaml
+++ /dev/null
@@ -1,46 +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.
-#
-name: java-cluster-db-policy-example
-services:
-- type: org.apache.brooklyn.entity.webapp.ControlledDynamicWebAppCluster
-  name: My Web with Policy
-  location: localhost
-  brooklyn.config:
-    wars.root: http://search.maven.org/remotecontent?filepath=io/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.6.0-M2/brooklyn-example-hello-world-sql-webapp-0.6.0-M2.war
-    http.port: 9280+
-    proxy.http.port: 9210+
-    java.sysprops: 
-      brooklyn.example.db.url: $brooklyn:formatString("jdbc:%s%s?user=%s&password=%s",
-         component("db").attributeWhenReady("datastore.url"), "visitors", "brooklyn", "br00k11n")
-  brooklyn.policies:
-  - policyType: org.apache.brooklyn.policy.autoscaling.AutoScalerPolicy
-    brooklyn.config:
-      metric: $brooklyn:sensor("org.apache.brooklyn.entity.webapp.DynamicWebAppCluster", "webapp.reqs.perSec.windowed.perNode")
-      metricLowerBound: 10
-      metricUpperBound: 100
-      minPoolSize: 1
-      maxPoolSize: 5
-      
-- type: org.apache.brooklyn.entity.database.mysql.MySqlNode
-  id: db
-  name: My DB
-  location: localhost
-  brooklyn.config:
-    # this also uses the flag rather than the config key
-    creationScriptUrl: classpath://visitors-creation-script.sql

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/qa/src/test/resources/java-web-app-simple.yaml
----------------------------------------------------------------------
diff --git a/brooklyn-library/qa/src/test/resources/java-web-app-simple.yaml b/brooklyn-library/qa/src/test/resources/java-web-app-simple.yaml
deleted file mode 100644
index 526e90b..0000000
--- a/brooklyn-library/qa/src/test/resources/java-web-app-simple.yaml
+++ /dev/null
@@ -1,28 +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.
-#
-name: sample-single-jboss
-description: Single JBoss using Brooklyn
-origin: https://github.com/apache/incubator-brooklyn
-location: localhost
-services:
-- serviceType: org.apache.brooklyn.entity.webapp.tomcat.Tomcat8Server
-  name: tomcat1
-  brooklyn.config:
-    wars.root: http://search.maven.org/remotecontent?filepath=io/brooklyn/example/brooklyn-example-hello-world-webapp/0.7.0-M1/brooklyn-example-hello-world-webapp-0.7.0-M1.war
-    http.port: 9280+

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/qa/src/test/resources/test-app-with-enrichers-slightly-simpler.yaml
----------------------------------------------------------------------
diff --git a/brooklyn-library/qa/src/test/resources/test-app-with-enrichers-slightly-simpler.yaml b/brooklyn-library/qa/src/test/resources/test-app-with-enrichers-slightly-simpler.yaml
deleted file mode 100644
index 2b55237..0000000
--- a/brooklyn-library/qa/src/test/resources/test-app-with-enrichers-slightly-simpler.yaml
+++ /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.
-#
-# example showing how enrichers can be set 
-#
-name: test-app-with-enrichers
-description: Testing many enrichers
-services:
-- type: org.apache.brooklyn.entity.group.DynamicCluster
-  id: cluster
-  initialSize: 3
-  location: localhost
-  memberSpec:
-    $brooklyn:entitySpec:
-      type: org.apache.brooklyn.core.test.entity.TestEntity
-      brooklyn.enrichers:
-      - type: org.apache.brooklyn.enricher.stock.Transformer
-        # transform "ip" (which we expect a feed, not shown here, to set) to a URL;
-        # you can curl an address string to the sensors/ip endpoint an entity to trigger these enrichers 
-        brooklyn.config:
-          enricher.sourceSensor: $brooklyn:sensor("ip")
-          enricher.targetSensor: $brooklyn:sensor("url")
-          enricher.targetValue: $brooklyn:formatString("http://%s/", $brooklyn:attributeWhenReady("ip"))
-      - type: org.apache.brooklyn.enricher.stock.Propagator
-        # use propagator to duplicate one sensor as another, giving the supplied sensor mapping;
-        # the other use of Propagator is where you specify a producer (using $brooklyn:entity(...) as below)
-        # from which to take sensors; in that mode you can specify `propagate` as a list of sensors whose names are unchanged,
-        # instead of (or in addition to) this map 
-        brooklyn.config:
-          sensorMapping:
-            $brooklyn:sensor("url"): $brooklyn:sensor("org.apache.brooklyn.core.entity.Attributes", "main.uri")
-  brooklyn.enrichers:
-  - type: org.apache.brooklyn.enricher.stock.Aggregator
-    # aggregate `url` sensors from children into a list
-    brooklyn.config:
-      enricher.sourceSensor: $brooklyn:sensor("url")
-      enricher.targetSensor: $brooklyn:sensor("urls.list")
-      enricher.aggregating.fromMembers: true
-  - type: org.apache.brooklyn.enricher.stock.Joiner
-    # create a string from that list, for use e.g. in bash scripts
-    brooklyn.config:
-      enricher.sourceSensor: $brooklyn:sensor("urls.list")
-      enricher.targetSensor: $brooklyn:sensor("urls.list.comma_separated.max_2")
-      maximum: 2
-      # TODO infer uniqueTag, name etc
-      uniqueTag: urls.list.comma_separated.max_2
-  - type: org.apache.brooklyn.enricher.stock.Joiner
-    # pick one uri as the main one to use
-    brooklyn.config:
-      enricher.sourceSensor: $brooklyn:sensor("urls.list")
-      enricher.targetSensor: $brooklyn:sensor("org.apache.brooklyn.core.entity.Attributes", "main.uri")
-      quote: false
-      maximum: 1
-brooklyn.enrichers:
-- type: org.apache.brooklyn.enricher.stock.Propagator
-  # if nothing specified for `propagating` or `sensorMapping` then 
-  # Propagator will do all but the usual lifecycle defaults, handy at the root!
-  brooklyn.config:
-    producer: $brooklyn:entity("cluster")

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/qa/src/test/resources/test-tomcat-cluster.yaml
----------------------------------------------------------------------
diff --git a/brooklyn-library/qa/src/test/resources/test-tomcat-cluster.yaml b/brooklyn-library/qa/src/test/resources/test-tomcat-cluster.yaml
deleted file mode 100644
index e3087b8..0000000
--- a/brooklyn-library/qa/src/test/resources/test-tomcat-cluster.yaml
+++ /dev/null
@@ -1,30 +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.
-#
-name: Test Tomcat cluster
-location: localhost
-services:
-- serviceType: org.apache.brooklyn.entity.webapp.ControlledDynamicWebAppCluster
-  name: tomcat-cluster
-  initialSize: 2
-  memberSpec:
-    $brooklyn:entitySpec:
-      type: org.apache.brooklyn.entity.webapp.tomcat.TomcatServer
-      brooklyn.config:
-        dynamiccluster.quarantineFailedEntities: false
-        cluster.initial.quorumSize: 2
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/qa/src/test/resources/test-webapp-with-averaging-enricher.yaml
----------------------------------------------------------------------
diff --git a/brooklyn-library/qa/src/test/resources/test-webapp-with-averaging-enricher.yaml b/brooklyn-library/qa/src/test/resources/test-webapp-with-averaging-enricher.yaml
deleted file mode 100644
index 9a508cb..0000000
--- a/brooklyn-library/qa/src/test/resources/test-webapp-with-averaging-enricher.yaml
+++ /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.
-#
-# example showing how enrichers can be set 
-#
-name: test-webapp-with-averaging-enricher
-description: Testing many enrichers
-services:
-- type: org.apache.brooklyn.entity.webapp.ControlledDynamicWebAppCluster
-  initialSize: 3
-  location: localhost
-  
-  # define the web cluster, adding an averaging enricher to the cluster.
-  # this assumes the test fixture will set the "my.load" sensor on the member-specs in here. 
-  webClusterSpec:
-    $brooklyn:entitySpec:
-      type: org.apache.brooklyn.entity.webapp.DynamicWebAppCluster
-      id: cluster
-      brooklyn.enrichers:
-      - type: org.apache.brooklyn.enricher.stock.Aggregator
-        brooklyn.config:
-          enricher.sourceSensor: $brooklyn:sensor("my.load")
-          enricher.targetSensor: $brooklyn:sensor("my.load.averaged")
-          enricher.aggregating.fromMembers: true
-          transformation: average
-            
-  brooklyn.enrichers:
-  - type: org.apache.brooklyn.enricher.stock.Propagator
-    brooklyn.config:
-      producer: $brooklyn:entity("cluster")
-      propagating:
-      - $brooklyn:sensor("my.load.averaged")

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/qa/start-monitor.sh
----------------------------------------------------------------------
diff --git a/brooklyn-library/qa/start-monitor.sh b/brooklyn-library/qa/start-monitor.sh
deleted file mode 100755
index 0fa8247..0000000
--- a/brooklyn-library/qa/start-monitor.sh
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/bash
-#
-# 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.
-#
-#
-# Brooklyn Management
-#
-# Run this, then you should see the Brooklyn mgmt webapp at localhost:8081/
-#
-#set -x # debug
-
-CLASS=org.apache.brooklyn.qa.longevity.Monitor
-VERSION=0.9.0-SNAPSHOT # BROOKLYN_VERSION
-
-ROOT=$(cd $(dirname $0) && pwd)
-cd $ROOT
-
-JAVA_OPTS="-Xms256m -Xmx1g -XX:MaxPermSize=256m"
-export CP="./target/brooklyn-qa-$VERSION.jar:./target/lib/*"
-
-echo running Brooklyn Web Console using $CLASS from $CP with $*
-
-echo java $JAVA_OPTS -cp "$CP" $CLASS $*
-java $JAVA_OPTS -cp "$CP" $CLASS $*

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/qa/start-webcluster.sh
----------------------------------------------------------------------
diff --git a/brooklyn-library/qa/start-webcluster.sh b/brooklyn-library/qa/start-webcluster.sh
deleted file mode 100755
index 7aa678a..0000000
--- a/brooklyn-library/qa/start-webcluster.sh
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/bash
-#
-# 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.
-#
-#
-# Brooklyn Management
-#
-# Run this, then you should see the Brooklyn mgmt webapp at localhost:8081/
-#
-#set -x # debug
-
-CLASS=org.apache.brooklyn.qa.longevity.webcluster.WebClusterApp
-VERSION=0.9.0-SNAPSHOT # BROOKLYN_VERSION
-
-ROOT=$(cd $(dirname $0) && pwd)
-cd $ROOT
-
-JAVA_OPTS="-Xms256m -Xmx1g -XX:MaxPermSize=256m"
-export CP="./target/brooklyn-qa-$VERSION.jar:./target/lib/*"
-
-echo running Brooklyn Web Console using $CLASS from $CP at $LOCATIONS
-
-echo java $JAVA_OPTS -cp "$CP" $CLASS $LOCATIONS $@
-java $JAVA_OPTS -cp "$CP" $CLASS $LOCATIONS $@

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/sandbox/cassandra-multicloud-snitch/pom.xml
----------------------------------------------------------------------
diff --git a/brooklyn-library/sandbox/cassandra-multicloud-snitch/pom.xml b/brooklyn-library/sandbox/cassandra-multicloud-snitch/pom.xml
deleted file mode 100644
index 0030abc..0000000
--- a/brooklyn-library/sandbox/cassandra-multicloud-snitch/pom.xml
+++ /dev/null
@@ -1,64 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-    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.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>brooklyn-sandbox-cassandra-multicloud-snitch</artifactId>
-    <packaging>jar</packaging>
-    <name>Custom Cassandra MultiCloud Snitch</name>
-    <description>
-        A custom snitch for Cassandra, to run a cluster across multiple clouds
-    </description>
-
-    <parent>
-        <groupId>org.apache.brooklyn</groupId>
-        <artifactId>brooklyn-library</artifactId>
-        <version>0.9.0-SNAPSHOT</version>  <!-- BROOKLYN_VERSION -->
-        <relativePath>../../pom.xml</relativePath>
-    </parent>
-
-    <properties>
-        <cassandra.version>1.2.2</cassandra.version>
-    </properties>
-
-    <dependencies>
-        <!-- for cassandra custom snitch -->
-        <dependency>
-            <groupId>org.apache.cassandra</groupId>
-            <artifactId>cassandra-all</artifactId>
-            <version>${cassandra.version}</version> <!--  note astyanax 1.56.24 pulls in 1.1.1 -->
-            <!-- scope>test</scope -->
-            <exclusions>
-                <exclusion>
-                    <artifactId>slf4j-log4j12</artifactId>
-                    <groupId>org.slf4j</groupId>
-                </exclusion>
-                <exclusion>
-                    <artifactId>log4j</artifactId>
-                    <groupId>log4j</groupId>
-                </exclusion>
-                <exclusion>
-                <artifactId>commons-codec</artifactId>
-                    <groupId>commons-codec</groupId>
-                </exclusion>
-            </exclusions>
-        </dependency>
-    </dependencies>
-
-</project>

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/sandbox/cassandra-multicloud-snitch/src/main/java/org/apache/brooklyn/entity/nosql/cassandra/customsnitch/MultiCloudSnitch.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/sandbox/cassandra-multicloud-snitch/src/main/java/org/apache/brooklyn/entity/nosql/cassandra/customsnitch/MultiCloudSnitch.java b/brooklyn-library/sandbox/cassandra-multicloud-snitch/src/main/java/org/apache/brooklyn/entity/nosql/cassandra/customsnitch/MultiCloudSnitch.java
deleted file mode 100644
index 0199290..0000000
--- a/brooklyn-library/sandbox/cassandra-multicloud-snitch/src/main/java/org/apache/brooklyn/entity/nosql/cassandra/customsnitch/MultiCloudSnitch.java
+++ /dev/null
@@ -1,222 +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.cassandra.customsnitch;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.io.InputStream;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.HashMap;
-import java.util.Properties;
-
-import org.apache.cassandra.exceptions.ConfigurationException;
-import org.apache.cassandra.gms.ApplicationState;
-import org.apache.cassandra.gms.EndpointState;
-import org.apache.cassandra.gms.Gossiper;
-import org.apache.cassandra.gms.IEndpointStateChangeSubscriber;
-import org.apache.cassandra.gms.VersionedValue;
-import org.apache.cassandra.io.util.FileUtils;
-import org.apache.cassandra.locator.AbstractNetworkTopologySnitch;
-import org.apache.cassandra.net.MessagingService;
-import org.apache.cassandra.service.StorageService;
-import org.apache.cassandra.utils.FBUtilities;
-import org.apache.cassandra.utils.ResourceWatcher;
-import org.apache.cassandra.utils.WrappedRunnable;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * A snitch that can be configured to work across clouds. It uses and
- * extends the cassandra-rackdc.properties (which is used by the 
- * GossipingPropertyFileSnitch) to add a publicip and privateip 
- * configuration.
- * <p>
- * The code is very similar to Ec2MultiRegionSnitch, except that it uses
- * the the config file rather than querying EC2 to get the IPs.
- * <p>
- * If two nodes are in the same datacenter, they will attempt to communicate
- * using the privateip. If they are in different datacenters, they will use
- * the publicip.
- */
-public class MultiCloudSnitch extends AbstractNetworkTopologySnitch implements IEndpointStateChangeSubscriber
-{
-    // FIXME Need to submit a pull request to Cassandra (1.2.x branch) for this snitch.
-    // Or could enhance GossipingPropertyFileSnitch instead, and submit PR for that.
-    
-    protected static final Logger logger = LoggerFactory.getLogger(MultiCloudSnitch.class);
-    
-    public static final String SNITCH_PROPERTIES_FILENAME = "cassandra-rackdc.properties";
-
-    private static final String DEFAULT_DC = "UNKNOWN-DC";
-    private static final String DEFAULT_RACK = "UNKNOWN-RACK";
-    
-    protected String rack;
-    protected String datacenter;
-    protected InetAddress public_ip;
-    protected String private_ip;
-
-    private volatile boolean gossipStarted;
-
-    public MultiCloudSnitch() throws ConfigurationException
-    {
-        reloadConfiguration();
-        logger.info("CustomSnitch using datacenter: " + datacenter + ", rack: " + rack + ", publicip: " + public_ip + ", privateip: " + private_ip);
-
-        try
-        {
-            FBUtilities.resourceToFile(SNITCH_PROPERTIES_FILENAME);
-            Runnable runnable = new WrappedRunnable()
-            {
-                protected void runMayThrow() throws ConfigurationException
-                {
-                    reloadConfiguration();
-                }
-            };
-            ResourceWatcher.watch(SNITCH_PROPERTIES_FILENAME, runnable, 60 * 1000);
-        }
-        catch (ConfigurationException ex)
-        {
-            logger.debug(SNITCH_PROPERTIES_FILENAME + " found, but does not look like a plain file. Will not watch it for changes");
-        }
-    }
-
-    public void reloadConfiguration() throws ConfigurationException
-    {
-        HashMap<InetAddress, String[]> reloadedMap = new HashMap<InetAddress, String[]>();
-        String DC_PROPERTY = "dc";
-        String RACK_PROPERTY = "rack";
-        String PUBLIC_IP_PROPERTY = "publicip";
-        String PRIVATE_IP_PROPERTY = "privateip";
-
-        Properties properties = new Properties();
-        InputStream stream = null;
-        try
-        {
-            stream = getClass().getClassLoader().getResourceAsStream(SNITCH_PROPERTIES_FILENAME);
-            properties.load(stream);
-        }
-        catch (Exception e)
-        {
-            throw new ConfigurationException("Unable to read " + SNITCH_PROPERTIES_FILENAME, e);
-        }
-        finally
-        {
-            FileUtils.closeQuietly(stream);
-        }
-
-        datacenter = properties.getProperty(DC_PROPERTY);
-        rack = properties.getProperty(RACK_PROPERTY);
-        private_ip = checkNotNull(properties.getProperty(PRIVATE_IP_PROPERTY), "%s in %s", PRIVATE_IP_PROPERTY, SNITCH_PROPERTIES_FILENAME);
-        String public_ip_str = checkNotNull(properties.getProperty(PUBLIC_IP_PROPERTY), "%s in %s", PUBLIC_IP_PROPERTY, SNITCH_PROPERTIES_FILENAME);
-        try {
-            public_ip = InetAddress.getByName(public_ip_str);
-        }
-        catch (UnknownHostException e)
-        {
-            throw new ConfigurationException("Unknown host " + public_ip_str, e);
-        }
-        
-        logger.debug("CustomSnitch reloaded, using datacenter: " + datacenter + ", rack: " + rack + ", publicip: " + public_ip + ", privateip: " + private_ip);
-
-        if (StorageService.instance != null) // null check tolerates circular dependency; see CASSANDRA-4145
-            StorageService.instance.getTokenMetadata().invalidateCaches();
-
-        if (gossipStarted)
-            StorageService.instance.gossipSnitchInfo();
-    }
-
-
-    public String getRack(InetAddress endpoint)
-    {
-        if (endpoint.equals(FBUtilities.getBroadcastAddress()))
-            return rack;
-        EndpointState state = Gossiper.instance.getEndpointStateForEndpoint(endpoint);
-        if (state == null || state.getApplicationState(ApplicationState.RACK) == null)
-            return DEFAULT_RACK;
-        return state.getApplicationState(ApplicationState.RACK).value;
-    }
-
-    public String getDatacenter(InetAddress endpoint)
-    {
-        if (endpoint.equals(FBUtilities.getBroadcastAddress()))
-            return datacenter;
-        EndpointState state = Gossiper.instance.getEndpointStateForEndpoint(endpoint);
-        if (state == null || state.getApplicationState(ApplicationState.DC) == null)
-            return DEFAULT_DC;
-        return state.getApplicationState(ApplicationState.DC).value;
-    }
-    
-    public void onJoin(InetAddress endpoint, EndpointState epState)
-    {
-        if (epState.getApplicationState(ApplicationState.INTERNAL_IP) != null)
-            reConnect(endpoint, epState.getApplicationState(ApplicationState.INTERNAL_IP));
-    }
-
-    public void onChange(InetAddress endpoint, ApplicationState state, VersionedValue value)
-    {
-        if (state == ApplicationState.INTERNAL_IP)
-            reConnect(endpoint, value);
-    }
-
-    public void onAlive(InetAddress endpoint, EndpointState state)
-    {
-        if (state.getApplicationState(ApplicationState.INTERNAL_IP) != null)
-            reConnect(endpoint, state.getApplicationState(ApplicationState.INTERNAL_IP));
-    }
-
-    public void onDead(InetAddress endpoint, EndpointState state)
-    {
-        // do nothing
-    }
-
-    public void onRestart(InetAddress endpoint, EndpointState state)
-    {
-        // do nothing
-    }
-
-    public void onRemove(InetAddress endpoint)
-    {
-        // do nothing.
-    }
-
-    private void reConnect(InetAddress endpoint, VersionedValue versionedValue)
-    {
-        if (!getDatacenter(endpoint).equals(getDatacenter(public_ip)))
-            return; // do nothing return back...
-
-        try
-        {
-            InetAddress remoteIP = InetAddress.getByName(versionedValue.value);
-            MessagingService.instance().getConnectionPool(endpoint).reset(remoteIP);
-            logger.debug(String.format("Intiated reconnect to an Internal IP %s for the %s", remoteIP, endpoint));
-        } catch (UnknownHostException e)
-        {
-            logger.error("Error in getting the IP address resolved: ", e);
-        }
-    }
-
-    @Override
-    public void gossiperStarting()
-    {
-        super.gossiperStarting();
-        Gossiper.instance.addLocalApplicationState(ApplicationState.INTERNAL_IP, StorageService.instance.valueFactory.internalIP(private_ip));
-        Gossiper.instance.register(this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/sandbox/database/pom.xml
----------------------------------------------------------------------
diff --git a/brooklyn-library/sandbox/database/pom.xml b/brooklyn-library/sandbox/database/pom.xml
deleted file mode 100644
index 28ef7a0..0000000
--- a/brooklyn-library/sandbox/database/pom.xml
+++ /dev/null
@@ -1,66 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-    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.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-    <groupId>org.apache.brooklyn.sandbox</groupId>
-    <artifactId>brooklyn-sandbox-software-database</artifactId>
-    <packaging>jar</packaging>
-    <name>Brooklyn Database Software Entities</name>
-    <description>
-		Brooklyn entitites for database software processes
-	</description>
-
-    <parent>
-        <groupId>org.apache.brooklyn</groupId>
-        <artifactId>brooklyn-library</artifactId>
-        <version>0.9.0-SNAPSHOT</version>  <!-- BROOKLYN_VERSION -->
-        <relativePath>../../pom.xml</relativePath>
-    </parent>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.brooklyn</groupId>
-            <artifactId>brooklyn-software-base</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.brooklyn</groupId>
-            <artifactId>brooklyn-test-support</artifactId>
-            <version>${project.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.brooklyn</groupId>
-            <artifactId>brooklyn-core</artifactId>
-            <version>${project.version}</version>
-            <classifier>tests</classifier>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.brooklyn</groupId>
-            <artifactId>brooklyn-software-base</artifactId>
-            <version>${project.version}</version>
-            <classifier>tests</classifier>
-            <scope>test</scope>
-        </dependency>
-    </dependencies>
-</project>

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/sandbox/database/src/main/java/org/apache/brooklyn/entity/database/Database.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/sandbox/database/src/main/java/org/apache/brooklyn/entity/database/Database.java b/brooklyn-library/sandbox/database/src/main/java/org/apache/brooklyn/entity/database/Database.java
deleted file mode 100644
index fccb760..0000000
--- a/brooklyn-library/sandbox/database/src/main/java/org/apache/brooklyn/entity/database/Database.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.database;
-
-import java.util.Collection;
-import java.util.Map;
-
-import org.apache.brooklyn.config.ConfigKey;
-import org.apache.brooklyn.core.config.ConfigKeys;
-
-/**
- * Intended to represent a SQL relational database service.
- *
- * TODO work in progress
- */
-public interface Database {
-    ConfigKey<String> SQL_VERSION = ConfigKeys.newStringConfigKey("database.sql.version", "SQL version");
-
-    Collection<Schema> getSchemas();
-
-    void createSchema(String name, Map properties);
-
-    void addSchema(Schema schema);
-
-    void removeSchema(String schemaName);
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/sandbox/database/src/main/java/org/apache/brooklyn/entity/database/Schema.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/sandbox/database/src/main/java/org/apache/brooklyn/entity/database/Schema.java b/brooklyn-library/sandbox/database/src/main/java/org/apache/brooklyn/entity/database/Schema.java
deleted file mode 100644
index a032adc..0000000
--- a/brooklyn-library/sandbox/database/src/main/java/org/apache/brooklyn/entity/database/Schema.java
+++ /dev/null
@@ -1,37 +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.database;
-
-import org.apache.brooklyn.config.ConfigKey;
-import org.apache.brooklyn.core.config.ConfigKeys;
-
-/**
- * Intended to represent a SQL database schema.
- *
- * TODO work in progress
- */
-public interface Schema {
-    ConfigKey<String> SCHEMA_NAME = ConfigKeys.newStringConfigKey("database.schema", "Database schema name");
-
-    void create();
-
-    void remove();
-
-    String getName();
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/sandbox/database/src/main/java/org/apache/brooklyn/entity/database/derby/DerbyDatabase.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/sandbox/database/src/main/java/org/apache/brooklyn/entity/database/derby/DerbyDatabase.java b/brooklyn-library/sandbox/database/src/main/java/org/apache/brooklyn/entity/database/derby/DerbyDatabase.java
deleted file mode 100644
index 7cd3bd4..0000000
--- a/brooklyn-library/sandbox/database/src/main/java/org/apache/brooklyn/entity/database/derby/DerbyDatabase.java
+++ /dev/null
@@ -1,172 +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.database.derby;
-
-import java.util.Collection;
-import java.util.Map;
-
-import javax.management.ObjectName;
-
-import org.apache.brooklyn.util.core.flags.SetFromFlag;
-import org.apache.brooklyn.entity.database.Database;
-import org.apache.brooklyn.entity.database.Schema;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.apache.brooklyn.config.ConfigKey;
-import org.apache.brooklyn.api.entity.Entity;
-import org.apache.brooklyn.core.config.ConfigKeys;
-import org.apache.brooklyn.core.sensor.BasicAttributeSensorAndConfigKey;
-import org.apache.brooklyn.core.sensor.PortAttributeSensorAndConfigKey;
-import org.apache.brooklyn.entity.software.base.SoftwareProcess;
-import org.apache.brooklyn.entity.software.base.SoftwareProcessImpl;
-import org.apache.brooklyn.feed.jmx.JmxHelper;
-import org.apache.brooklyn.entity.java.UsesJava;
-import org.apache.brooklyn.entity.java.UsesJmx;
-import org.apache.brooklyn.core.config.BasicConfigKey;
-import org.apache.brooklyn.util.collections.MutableMap;
-
-import com.google.common.base.Objects.ToStringHelper;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-
-/**
- * An {@link Entity} that represents a single Derby SQL database server instance.
- *
- * TODO work in progress
- */
-public class DerbyDatabase extends SoftwareProcessImpl implements Database, UsesJava, UsesJmx {
-    private static final Logger log = LoggerFactory.getLogger(DerbyDatabase.class);
-
-    @SetFromFlag("version")
-    public static final ConfigKey<String> SUGGESTED_VERSION =
-            ConfigKeys.newConfigKeyWithDefault(SoftwareProcess.SUGGESTED_VERSION, "10.8.1.2");
-
-    public static final PortAttributeSensorAndConfigKey JDBC_PORT = new PortAttributeSensorAndConfigKey(
-            "derby.jdbcPort", "Suggested JDBC port");
-    
-    public static final ConfigKey<String> VIRTUAL_HOST_NAME = new BasicConfigKey<String>(
-            String.class, "derby.virtualHost", "Derby virtual host name", "localhost");
-
-    public static final BasicAttributeSensorAndConfigKey<String> JMX_USER = new BasicAttributeSensorAndConfigKey<String>(
-            UsesJmx.JMX_USER, "admin");
-    
-    public static final BasicAttributeSensorAndConfigKey<String> JMX_PASSWORD = new BasicAttributeSensorAndConfigKey<String>(
-            UsesJmx.JMX_PASSWORD, "admin");
-
-    @SetFromFlag
-    protected Collection<String> schemaNames;
-    
-    @SetFromFlag
-    protected Map<String, DerbySchema> schemas;
-
-    protected transient JmxHelper jmxHelper;
-    
-    public DerbyDatabase() {
-        this(MutableMap.of(), null);
-    }
-    public DerbyDatabase(Map properties) {
-        this(properties, null);
-    }
-    public DerbyDatabase(Entity parent) {
-        this(MutableMap.of(), parent);
-    }
-    public DerbyDatabase(Map properties, Entity parent) {
-        super(properties, parent);
-
-        if (schemaNames == null) schemaNames = Lists.newArrayList();
-        if (schemas == null) schemas = Maps.newLinkedHashMap();
-    }
-
-    @Override
-    public Class<? extends DerbyDatabaseDriver> getDriverInterface() {
-        return DerbyDatabaseDriver.class;
-    }
-
-    @Override
-    public void connectSensors() {
-        super.connectSensors();
-        connectServiceUpIsRunning();
-    }
-
-    @Override
-    public void disconnectSensors() {
-        super.disconnectSensors();
-        disconnectServiceUpIsRunning();
-    }
-
-    @Override
-    public void postStart() {
-        super.postStart();
-        for (String name : schemaNames) {
-            createSchema(name);
-        }
-    }
-
-    @Override
-    public void preStop() {
-        super.preStop();
-        for (DerbySchema schema : schemas.values()) {
-            schema.destroy();
-        }
-        if (jmxHelper != null) jmxHelper.terminate();
-    }
-
-    public void createSchema(String name) {
-        createSchema(name, ImmutableMap.of());
-    }
-    
-    public void createSchema(String name, Map properties) {
-        Map allprops = MutableMap.builder().putAll(properties).put("name", name).build();
-        DerbySchema schema = new DerbySchema(allprops);
-        schema.init();
-        schema.create();
-        schemas.put(name, schema);
-    }
-
-    public Collection<Schema> getSchemas() {
-        return ImmutableList.<Schema>copyOf(schemas.values());
-    }
-    
-    public void addSchema(Schema schema) {
-        schemas.put(schema.getName(), (DerbySchema) schema);
-    }
-    
-    public void removeSchema(String schemaName) {
-        schemas.remove(schemaName);
-    }
-
-    @Override
-    protected ToStringHelper toStringHelper() {
-        return super.toStringHelper().add("jdbcPort", getAttribute(JDBC_PORT));
-    }
-
-    protected boolean computeNodeUp() {
-        // FIXME Use the JmxAdapter.reachable() stuff instead of getAttribute
-        try {
-            ObjectName serverInfoObjectName = ObjectName.getInstance("org.apache.derby:type=ServerInformation,name=ServerInformation");
-            String productVersion = (String) jmxHelper.getAttribute(serverInfoObjectName, "ProductVersion");
-            return (productVersion != null);
-        } catch (Exception e) {
-            return false;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/sandbox/database/src/main/java/org/apache/brooklyn/entity/database/derby/DerbyDatabaseDriver.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/sandbox/database/src/main/java/org/apache/brooklyn/entity/database/derby/DerbyDatabaseDriver.java b/brooklyn-library/sandbox/database/src/main/java/org/apache/brooklyn/entity/database/derby/DerbyDatabaseDriver.java
deleted file mode 100644
index b8594be..0000000
--- a/brooklyn-library/sandbox/database/src/main/java/org/apache/brooklyn/entity/database/derby/DerbyDatabaseDriver.java
+++ /dev/null
@@ -1,25 +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.database.derby;
-
-import org.apache.brooklyn.entity.java.JavaSoftwareProcessDriver;
-
-public interface DerbyDatabaseDriver extends JavaSoftwareProcessDriver {
-
-}


Mime
View raw message