http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/software/webapp/src/test/java/org/apache/brooklyn/entity/webapp/tomcat/TomcatServerEc2LiveTest.java ---------------------------------------------------------------------- diff --git a/software/webapp/src/test/java/org/apache/brooklyn/entity/webapp/tomcat/TomcatServerEc2LiveTest.java b/software/webapp/src/test/java/org/apache/brooklyn/entity/webapp/tomcat/TomcatServerEc2LiveTest.java new file mode 100644 index 0000000..3affe29 --- /dev/null +++ b/software/webapp/src/test/java/org/apache/brooklyn/entity/webapp/tomcat/TomcatServerEc2LiveTest.java @@ -0,0 +1,71 @@ +/* + * 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.webapp.tomcat; + +import static com.google.common.base.Preconditions.checkNotNull; +import static org.testng.Assert.assertNotNull; + +import java.net.URL; + +import org.apache.brooklyn.entity.webapp.tomcat.TomcatServer; +import org.apache.brooklyn.test.HttpTestUtils; +import org.apache.brooklyn.test.TestResourceUnavailableException; +import org.testng.annotations.Test; + +import brooklyn.entity.AbstractEc2LiveTest; +import brooklyn.entity.proxying.EntitySpec; +import brooklyn.location.Location; +import brooklyn.test.Asserts; + +import com.google.common.collect.ImmutableList; + +/** + * A simple test of installing+running on AWS-EC2, using various OS distros and versions. + */ +public class TomcatServerEc2LiveTest extends AbstractEc2LiveTest { + + public String getTestWar() { + TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), "/hello-world.war"); + return "classpath://hello-world.war"; + } + + @Override + protected void doTest(Location loc) throws Exception { + final TomcatServer server = app.createAndManageChild(EntitySpec.create(TomcatServer.class) + .configure(TomcatServer.OPEN_IPTABLES, true) + .configure("war", getTestWar())); + + app.start(ImmutableList.of(loc)); + + String url = server.getAttribute(TomcatServer.ROOT_URL); + + HttpTestUtils.assertHttpStatusCodeEventuallyEquals(url, 200); + HttpTestUtils.assertContentContainsText(url, "Hello"); + + Asserts.succeedsEventually(new Runnable() { + @Override public void run() { + assertNotNull(server.getAttribute(TomcatServer.REQUEST_COUNT)); + assertNotNull(server.getAttribute(TomcatServer.ERROR_COUNT)); + assertNotNull(server.getAttribute(TomcatServer.TOTAL_PROCESSING_TIME)); + }}); + } + + @Test(enabled=false) + public void testDummy() {} // Convince testng IDE integration that this really does have test methods +}
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/software/webapp/src/test/java/org/apache/brooklyn/entity/webapp/tomcat/TomcatServerRestartIntegrationTest.java ---------------------------------------------------------------------- diff --git a/software/webapp/src/test/java/org/apache/brooklyn/entity/webapp/tomcat/TomcatServerRestartIntegrationTest.java b/software/webapp/src/test/java/org/apache/brooklyn/entity/webapp/tomcat/TomcatServerRestartIntegrationTest.java new file mode 100644 index 0000000..eb7465d --- /dev/null +++ b/software/webapp/src/test/java/org/apache/brooklyn/entity/webapp/tomcat/TomcatServerRestartIntegrationTest.java @@ -0,0 +1,45 @@ +/* + * 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.webapp.tomcat; + +import org.apache.brooklyn.entity.webapp.tomcat.TomcatServer; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.testng.annotations.Test; + +import brooklyn.entity.basic.AbstractSoftwareProcessRestartIntegrationTest; +import brooklyn.entity.basic.SoftwareProcess; +import brooklyn.entity.proxying.EntitySpec; + +/** + * Tests restart of the software *process* (as opposed to the VM). + */ +@Test(groups="Integration") +public class TomcatServerRestartIntegrationTest extends AbstractSoftwareProcessRestartIntegrationTest { + + // TODO Remove duplication from MySqlRestartIntegrationTest + + @SuppressWarnings("unused") + private static final Logger LOG = LoggerFactory.getLogger(TomcatServerRestartIntegrationTest.class); + + @Override + protected EntitySpec<? extends SoftwareProcess> newEntitySpec() { + return EntitySpec.create(TomcatServer.class); + } +} http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/software/webapp/src/test/java/org/apache/brooklyn/entity/webapp/tomcat/TomcatServerSoftlayerLiveTest.java ---------------------------------------------------------------------- diff --git a/software/webapp/src/test/java/org/apache/brooklyn/entity/webapp/tomcat/TomcatServerSoftlayerLiveTest.java b/software/webapp/src/test/java/org/apache/brooklyn/entity/webapp/tomcat/TomcatServerSoftlayerLiveTest.java new file mode 100644 index 0000000..e7e7667 --- /dev/null +++ b/software/webapp/src/test/java/org/apache/brooklyn/entity/webapp/tomcat/TomcatServerSoftlayerLiveTest.java @@ -0,0 +1,79 @@ +/* + * 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.webapp.tomcat; + +import static com.google.common.base.Preconditions.checkNotNull; +import static org.testng.Assert.assertNotNull; + +import java.net.URL; + +import org.apache.brooklyn.entity.webapp.tomcat.TomcatServer; +import org.apache.brooklyn.test.HttpTestUtils; +import org.apache.brooklyn.test.TestResourceUnavailableException; +import org.testng.annotations.Test; + +import brooklyn.entity.AbstractSoftlayerLiveTest; +import brooklyn.entity.proxying.EntitySpec; +import brooklyn.location.Location; +import brooklyn.test.Asserts; + +import com.google.common.collect.ImmutableList; + +/** + * A simple test of installing+running on Softlayer, using various OS distros and versions. + */ +public class TomcatServerSoftlayerLiveTest extends AbstractSoftlayerLiveTest { + + public String getTestWar() { + TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), "/hello-world.war"); + return "classpath://hello-world.war"; + } + + @Override + protected void doTest(Location loc) throws Exception { + final TomcatServer server = app.createAndManageChild(EntitySpec.create(TomcatServer.class) + .configure("war", getTestWar())); + + app.start(ImmutableList.of(loc)); + + String url = server.getAttribute(TomcatServer.ROOT_URL); + + HttpTestUtils.assertHttpStatusCodeEventuallyEquals(url, 200); + HttpTestUtils.assertContentContainsText(url, "Hello"); + + Asserts.succeedsEventually(new Runnable() { + @Override public void run() { + assertNotNull(server.getAttribute(TomcatServer.REQUEST_COUNT)); + assertNotNull(server.getAttribute(TomcatServer.ERROR_COUNT)); + assertNotNull(server.getAttribute(TomcatServer.TOTAL_PROCESSING_TIME)); + + // TODO These appear not to be set in TomcatServerImpl.connectSensors + // See TomcatServerEc2LiveTest, where these are also not included. +// assertNotNull(server.getAttribute(TomcatServer.MAX_PROCESSING_TIME)); +// assertNotNull(server.getAttribute(TomcatServer.BYTES_RECEIVED)); +// assertNotNull(server.getAttribute(TomcatServer.BYTES_SENT)); + }}); + } + + @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/incubator-brooklyn/blob/77dff880/software/webapp/src/test/java/org/apache/brooklyn/entity/webapp/tomcat/TomcatServerWebAppFixtureIntegrationTest.java ---------------------------------------------------------------------- diff --git a/software/webapp/src/test/java/org/apache/brooklyn/entity/webapp/tomcat/TomcatServerWebAppFixtureIntegrationTest.java b/software/webapp/src/test/java/org/apache/brooklyn/entity/webapp/tomcat/TomcatServerWebAppFixtureIntegrationTest.java new file mode 100644 index 0000000..b2d6174 --- /dev/null +++ b/software/webapp/src/test/java/org/apache/brooklyn/entity/webapp/tomcat/TomcatServerWebAppFixtureIntegrationTest.java @@ -0,0 +1,176 @@ +/* + * 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.webapp.tomcat; + +import java.io.File; +import java.net.InetAddress; +import java.net.Socket; +import java.net.SocketException; +import java.util.List; +import java.util.concurrent.Callable; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicReference; + +import org.apache.brooklyn.entity.webapp.AbstractWebAppFixtureIntegrationTest; +import org.apache.brooklyn.entity.webapp.HttpsSslConfig; +import org.apache.brooklyn.entity.webapp.JavaWebAppSoftwareProcess; +import org.apache.brooklyn.entity.webapp.tomcat.TomcatServer; +import org.apache.brooklyn.test.TestResourceUnavailableException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.testng.Assert; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +import brooklyn.entity.basic.SoftwareProcess; +import brooklyn.entity.proxying.EntitySpec; +import brooklyn.location.basic.PortRanges; +import brooklyn.test.entity.TestApplication; +import brooklyn.util.exceptions.Exceptions; +import brooklyn.util.repeat.Repeater; + +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; + +public class TomcatServerWebAppFixtureIntegrationTest extends AbstractWebAppFixtureIntegrationTest { + + @SuppressWarnings("unused") + private static final Logger log = LoggerFactory.getLogger(TomcatServerWebAppFixtureIntegrationTest.class); + + @DataProvider(name = "basicEntities") + public Object[][] basicEntities() { + TestApplication tomcatApp = newTestApplication(); + TomcatServer tomcat = tomcatApp.createAndManageChild(EntitySpec.create(TomcatServer.class) + .configure(TomcatServer.HTTP_PORT, PortRanges.fromString(DEFAULT_HTTP_PORT))); + + + File keystoreFile; + try { + keystoreFile = createTemporaryKeyStore("myname", "mypass"); + keystoreFile.deleteOnExit(); + } catch (Exception e) { + throw Exceptions.propagate(e); + } + + TestApplication tomcatHttpsApp = newTestApplication(); + TomcatServer httpsTomcat = tomcatHttpsApp.createAndManageChild(EntitySpec.create(TomcatServer.class) + .configure(TomcatServer.ENABLED_PROTOCOLS, ImmutableSet.of("https")) + .configure(TomcatServer.HTTPS_SSL_CONFIG, + new HttpsSslConfig().keyAlias("myname").keystorePassword("mypass").keystoreUrl(keystoreFile.getAbsolutePath()))); + + return new JavaWebAppSoftwareProcess[][] { + new JavaWebAppSoftwareProcess[] { tomcat }, + new JavaWebAppSoftwareProcess[] { httpsTomcat } + }; + } + + // exists to be able to test on this class from GUI in Eclipse IDE + @Test(groups = "Integration", dataProvider = "basicEntities") + public void canStartAndStop(final SoftwareProcess entity) { + super.canStartAndStop(entity); + } + @Test(groups = "Integration", dataProvider = "basicEntities") + public void testReportsServiceDownWhenKilled(final SoftwareProcess entity) throws Exception { + super.testReportsServiceDownWhenKilled(entity); + } + + @Override + // as parent, but with spring travel + @DataProvider(name = "entitiesWithWarAndURL") + public Object[][] entitiesWithWar() { + TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), "/hello-world.war"); + List<Object[]> result = Lists.newArrayList(); + + for (Object[] entity : basicEntities()) { + result.add(new Object[] { + entity[0], + "hello-world.war", + "hello-world/", + "" // no sub-page path + }); + } + + // TODO would be nice to test against spring web framework stock booking example + // but we'd need an external URL for that (we removed the binary from here for apache compliance reasons) +// TestApplication tomcatApp = newTestApplication(); +// TomcatServer tomcat = tomcatApp.createAndManageChild(EntitySpec.create(TomcatServer.class) +// .configure(TomcatServer.HTTP_PORT, PortRanges.fromString(DEFAULT_HTTP_PORT))); +// result.add(new Object[] { +// tomcat, +// "swf-booking-mvc.war", +// "swf-booking-mvc/", +// "spring/intro", +// }); + + return result.toArray(new Object[][] {}); + } + + @AfterMethod(alwaysRun=true, dependsOnMethods="shutdownApp") + public void ensureIsShutDown() throws Exception { + final AtomicReference<Socket> shutdownSocket = new AtomicReference<Socket>(); + final AtomicReference<SocketException> gotException = new AtomicReference<SocketException>(); + final Integer shutdownPort = (entity != null) ? entity.getAttribute(TomcatServer.SHUTDOWN_PORT) : null; + + if (shutdownPort != null) { + boolean socketClosed = Repeater.create("Checking WebApp has shut down") + .repeat(new Callable<Void>() { + public Void call() throws Exception { + if (shutdownSocket.get() != null) shutdownSocket.get().close(); + try { + shutdownSocket.set(new Socket(InetAddress.getLocalHost(), shutdownPort)); + gotException.set(null); + } catch (SocketException e) { + gotException.set(e); + } + return null; + }}) + .every(100, TimeUnit.MILLISECONDS) + .until(new Callable<Boolean>() { + public Boolean call() { + return (gotException.get() != null); + }}) + .limitIterationsTo(25) + .run(); + + if (socketClosed == false) { +// log.error("WebApp did not shut down - this is a failure of the last test run"); +// log.warn("I'm sending a message to the shutdown port {}", shutdownPort); +// OutputStreamWriter writer = new OutputStreamWriter(shutdownSocket.getOutputStream()); +// writer.write("SHUTDOWN\r\n"); +// writer.flush(); +// writer.close(); +// shutdownSocket.close(); + throw new Exception("Last test run did not shut down WebApp entity "+entity+" (port "+shutdownPort+")"); + } + } else { + Assert.fail("Cannot shutdown, because shutdown-port not set for "+entity); + } + } + + public static void main(String ...args) throws Exception { + TomcatServerWebAppFixtureIntegrationTest t = new TomcatServerWebAppFixtureIntegrationTest(); + t.setUp(); + t.testReportsServiceDownWhenKilled((SoftwareProcess) t.basicEntities()[0][0]); + t.shutdownApp(); + t.ensureIsShutDown(); + t.shutdownMgmt(); + } + +} http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/software/webapp/src/test/java/org/apache/brooklyn/test/entity/TestJavaWebAppEntity.java ---------------------------------------------------------------------- diff --git a/software/webapp/src/test/java/org/apache/brooklyn/test/entity/TestJavaWebAppEntity.java b/software/webapp/src/test/java/org/apache/brooklyn/test/entity/TestJavaWebAppEntity.java new file mode 100644 index 0000000..a24b74c --- /dev/null +++ b/software/webapp/src/test/java/org/apache/brooklyn/test/entity/TestJavaWebAppEntity.java @@ -0,0 +1,78 @@ +/* + * 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.test.entity; + +import org.apache.brooklyn.entity.webapp.WebAppService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import brooklyn.config.ConfigKey; +import brooklyn.entity.basic.Attributes; +import brooklyn.entity.basic.ConfigKeys; +import brooklyn.entity.basic.Lifecycle; +import brooklyn.entity.basic.ServiceStateLogic; +import brooklyn.entity.basic.SoftwareProcess; +import brooklyn.entity.basic.SoftwareProcessDriverLifecycleEffectorTasks; +import brooklyn.entity.basic.EntityLocal; +import brooklyn.entity.java.VanillaJavaApp; +import brooklyn.entity.proxying.ImplementedBy; +import brooklyn.location.Location; +import brooklyn.util.config.ConfigBag; + +/** + * Mock web application server entity for testing. + */ +@ImplementedBy(TestJavaWebAppEntityImpl.class) +public interface TestJavaWebAppEntity extends VanillaJavaApp, WebAppService, EntityLocal { + + /** + * Injects the test entity's customised lifecycle tasks. + */ + ConfigKey<SoftwareProcessDriverLifecycleEffectorTasks> LIFECYCLE_EFFECTOR_TASKS = ConfigKeys.newConfigKeyWithDefault( + SoftwareProcess.LIFECYCLE_EFFECTOR_TASKS, + new TestJavaWebAppEntityLifecycleTasks()); + + void spoofRequest(); + int getA(); + int getB(); + int getC(); + + static class TestJavaWebAppEntityLifecycleTasks extends SoftwareProcessDriverLifecycleEffectorTasks { + private static final Logger LOG = LoggerFactory.getLogger(TestJavaWebAppEntityLifecycleTasks.class); + + @Override + public void start(java.util.Collection<? extends Location> locations) { + ServiceStateLogic.setExpectedState(entity(), Lifecycle.STARTING); + LOG.trace("Starting {}", this); + entity().setAttribute(SERVICE_PROCESS_IS_RUNNING, true); + entity().setAttribute(Attributes.SERVICE_UP, true); + ServiceStateLogic.setExpectedState(entity(), Lifecycle.RUNNING); + } + + @Override + public void stop(ConfigBag parameters) { + ServiceStateLogic.setExpectedState(entity(), Lifecycle.STOPPING); + LOG.trace("Stopping {}", this); + entity().setAttribute(Attributes.SERVICE_UP, false); + entity().setAttribute(SERVICE_PROCESS_IS_RUNNING, false); + ServiceStateLogic.setExpectedState(entity(), Lifecycle.STOPPED); + } + } + +} http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/software/webapp/src/test/java/org/apache/brooklyn/test/entity/TestJavaWebAppEntityImpl.java ---------------------------------------------------------------------- diff --git a/software/webapp/src/test/java/org/apache/brooklyn/test/entity/TestJavaWebAppEntityImpl.java b/software/webapp/src/test/java/org/apache/brooklyn/test/entity/TestJavaWebAppEntityImpl.java new file mode 100644 index 0000000..c89a097 --- /dev/null +++ b/software/webapp/src/test/java/org/apache/brooklyn/test/entity/TestJavaWebAppEntityImpl.java @@ -0,0 +1,62 @@ +/* + * 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.test.entity; + +import java.util.Map; + +import org.apache.brooklyn.entity.webapp.WebAppServiceConstants; + +import brooklyn.entity.Entity; +import brooklyn.entity.java.VanillaJavaAppImpl; +import brooklyn.util.flags.SetFromFlag; + +public class TestJavaWebAppEntityImpl extends VanillaJavaAppImpl implements TestJavaWebAppEntity { + + @SetFromFlag public int a; + @SetFromFlag public int b; + @SetFromFlag public int c; + + public TestJavaWebAppEntityImpl() {} + + // constructor required for use in DynamicCluster.factory + public TestJavaWebAppEntityImpl(@SuppressWarnings("rawtypes") Map flags, Entity parent) { super(flags, parent); } + + @Override + public synchronized void spoofRequest() { + Integer rc = getAttribute(WebAppServiceConstants.REQUEST_COUNT); + if (rc==null) rc = 0; + setAttribute(WebAppServiceConstants.REQUEST_COUNT, rc+1); + } + + @Override + public int getA() { + return a; + } + + @Override + public int getB() { + return b; + } + + @Override + public int getC() { + return c; + } + +} http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/software/webapp/src/test/resources/brooklyn/entity/dns/geoscaling/expectedScript.php ---------------------------------------------------------------------- diff --git a/software/webapp/src/test/resources/brooklyn/entity/dns/geoscaling/expectedScript.php b/software/webapp/src/test/resources/brooklyn/entity/dns/geoscaling/expectedScript.php deleted file mode 100644 index dbf03aa..0000000 --- a/software/webapp/src/test/resources/brooklyn/entity/dns/geoscaling/expectedScript.php +++ /dev/null @@ -1,79 +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. -*/ - -/************************************************************************************** - ** DO NOT modify this script, as your changes will likely be overwritten. - ** Auto-generated by Brooklyn on 1970-01-01 00:00:00 UTC - **************************************************************************************/ - - -/* Returns the approximate distance (in km) between 2 points on the Earth's surface, - * specified as latitude and longitude in decimal degrees. Derived from the spherical - * law of cosines. - */ -function distanceBetween($lat1_deg, $long1_deg, $lat2_deg, $long2_deg) { - define("RADIUS_KM", 6372.8); // approx - $lat1_rad = deg2rad($lat1_deg); - $lat2_rad = deg2rad($lat2_deg); - $long_delta_rad = deg2rad($long1_deg - $long2_deg); - $distance_km = RADIUS_KM * acos( (sin($lat1_rad) * sin($lat2_rad)) + - (cos($lat1_rad) * cos($lat2_rad) * cos($long_delta_rad)) ); - return $distance_km; -} - -function findClosestHost($lat_deg, $long_deg, $available_hosts) { - $minimum_distance = PHP_INT_MAX; - for ($i = 0 ; $i < sizeof($available_hosts); $i++) { - $host = $available_hosts[$i]; - $distance_km = distanceBetween($lat_deg, $long_deg, $host['latitude'], $host['longitude']); - if ($distance_km < $minimum_distance) { - $minimum_distance = $distance_km; - $closest_host = $host; - } - } - return $closest_host; -} - - -$hosts = array( - array('name' => 'Server 1', - 'latitude' => 40.0, - 'longitude' => -80.0, - 'ip' => '1.2.3.100'), - - array('name' => 'Server 2', - 'latitude' => 30.0, - 'longitude' => 20.0, - 'ip' => '1.2.3.101') -); - - -$closest_host = findClosestHost($city_info['latitude'], $city_info['longitude'], $hosts); - -if (isset($closest_host)) { - $output[] = array("TXT", "Request from [".$city_info['latitude'].",".$city_info['longitude']."]-".$city_info['city']."(".strtoupper($city_info['country']).") directed to ".$closest_host['name']); - $output[] = array("TXT", "GeoScaling config auto-updated by Brooklyn 1970-01-01 00:00:00 UTC"); - if (filter_var($closest_host['ip'], FILTER_VALIDATE_IP)) { - $output[] = array("A", $closest_host['ip']); - } else { - $output[] = array("CNAME", $closest_host['ip']); - } -} else { - $output[] = array("fail"); -} http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/software/webapp/src/test/resources/brooklyn/entity/webapp/nodejs/nodejs-hello-world.yaml ---------------------------------------------------------------------- diff --git a/software/webapp/src/test/resources/brooklyn/entity/webapp/nodejs/nodejs-hello-world.yaml b/software/webapp/src/test/resources/brooklyn/entity/webapp/nodejs/nodejs-hello-world.yaml deleted file mode 100644 index 0ac274e..0000000 --- a/software/webapp/src/test/resources/brooklyn/entity/webapp/nodejs/nodejs-hello-world.yaml +++ /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. - -id: nodejs-hello-world-application -name: "Node.JS Hello World Application" -origin: "https://github.com/grkvlt/node-hello-world.git/" -locations: -- jclouds:softlayer:ams01 -services: -- serviceType: brooklyn.entity.webapp.nodejs.NodeJsWebAppService - id: nodejs - name: "Node.JS" - brooklyn.config: - gitRepoUrl: - "https://github.com/grkvlt/node-hello-world.git" - appFileName: app.js - appName: node-hello-world \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/software/webapp/src/test/resources/org/apache/brooklyn/entity/dns/geoscaling/expectedScript.php ---------------------------------------------------------------------- diff --git a/software/webapp/src/test/resources/org/apache/brooklyn/entity/dns/geoscaling/expectedScript.php b/software/webapp/src/test/resources/org/apache/brooklyn/entity/dns/geoscaling/expectedScript.php new file mode 100644 index 0000000..dbf03aa --- /dev/null +++ b/software/webapp/src/test/resources/org/apache/brooklyn/entity/dns/geoscaling/expectedScript.php @@ -0,0 +1,79 @@ +/* + * 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. +*/ + +/************************************************************************************** + ** DO NOT modify this script, as your changes will likely be overwritten. + ** Auto-generated by Brooklyn on 1970-01-01 00:00:00 UTC + **************************************************************************************/ + + +/* Returns the approximate distance (in km) between 2 points on the Earth's surface, + * specified as latitude and longitude in decimal degrees. Derived from the spherical + * law of cosines. + */ +function distanceBetween($lat1_deg, $long1_deg, $lat2_deg, $long2_deg) { + define("RADIUS_KM", 6372.8); // approx + $lat1_rad = deg2rad($lat1_deg); + $lat2_rad = deg2rad($lat2_deg); + $long_delta_rad = deg2rad($long1_deg - $long2_deg); + $distance_km = RADIUS_KM * acos( (sin($lat1_rad) * sin($lat2_rad)) + + (cos($lat1_rad) * cos($lat2_rad) * cos($long_delta_rad)) ); + return $distance_km; +} + +function findClosestHost($lat_deg, $long_deg, $available_hosts) { + $minimum_distance = PHP_INT_MAX; + for ($i = 0 ; $i < sizeof($available_hosts); $i++) { + $host = $available_hosts[$i]; + $distance_km = distanceBetween($lat_deg, $long_deg, $host['latitude'], $host['longitude']); + if ($distance_km < $minimum_distance) { + $minimum_distance = $distance_km; + $closest_host = $host; + } + } + return $closest_host; +} + + +$hosts = array( + array('name' => 'Server 1', + 'latitude' => 40.0, + 'longitude' => -80.0, + 'ip' => '1.2.3.100'), + + array('name' => 'Server 2', + 'latitude' => 30.0, + 'longitude' => 20.0, + 'ip' => '1.2.3.101') +); + + +$closest_host = findClosestHost($city_info['latitude'], $city_info['longitude'], $hosts); + +if (isset($closest_host)) { + $output[] = array("TXT", "Request from [".$city_info['latitude'].",".$city_info['longitude']."]-".$city_info['city']."(".strtoupper($city_info['country']).") directed to ".$closest_host['name']); + $output[] = array("TXT", "GeoScaling config auto-updated by Brooklyn 1970-01-01 00:00:00 UTC"); + if (filter_var($closest_host['ip'], FILTER_VALIDATE_IP)) { + $output[] = array("A", $closest_host['ip']); + } else { + $output[] = array("CNAME", $closest_host['ip']); + } +} else { + $output[] = array("fail"); +} http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/software/webapp/src/test/resources/org/apache/brooklyn/entity/webapp/nodejs/nodejs-hello-world.yaml ---------------------------------------------------------------------- diff --git a/software/webapp/src/test/resources/org/apache/brooklyn/entity/webapp/nodejs/nodejs-hello-world.yaml b/software/webapp/src/test/resources/org/apache/brooklyn/entity/webapp/nodejs/nodejs-hello-world.yaml new file mode 100644 index 0000000..2baba85 --- /dev/null +++ b/software/webapp/src/test/resources/org/apache/brooklyn/entity/webapp/nodejs/nodejs-hello-world.yaml @@ -0,0 +1,31 @@ +# 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. + +id: nodejs-hello-world-application +name: "Node.JS Hello World Application" +origin: "https://github.com/grkvlt/node-hello-world.git/" +locations: +- jclouds:softlayer:ams01 +services: +- serviceType: org.apache.brooklyn.entity.webapp.nodejs.NodeJsWebAppService + id: nodejs + name: "Node.JS" + brooklyn.config: + gitRepoUrl: + "https://github.com/grkvlt/node-hello-world.git" + appFileName: app.js + appName: node-hello-world \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/usage/camp/src/main/java/org/apache/brooklyn/camp/brooklyn/spi/creation/service/CatalogServiceTypeResolver.java ---------------------------------------------------------------------- diff --git a/usage/camp/src/main/java/org/apache/brooklyn/camp/brooklyn/spi/creation/service/CatalogServiceTypeResolver.java b/usage/camp/src/main/java/org/apache/brooklyn/camp/brooklyn/spi/creation/service/CatalogServiceTypeResolver.java index e569183..8fed2f8 100644 --- a/usage/camp/src/main/java/org/apache/brooklyn/camp/brooklyn/spi/creation/service/CatalogServiceTypeResolver.java +++ b/usage/camp/src/main/java/org/apache/brooklyn/camp/brooklyn/spi/creation/service/CatalogServiceTypeResolver.java @@ -52,7 +52,7 @@ public class CatalogServiceTypeResolver extends BrooklynServiceTypeResolver { .put("software-process", VanillaSoftwareProcess.class.getName()) .put("java-app", VanillaJavaApp.class.getName()) .put("brooklyn-node", BrooklynNode.class.getName()) - .put("web-app-cluster","brooklyn.entity.webapp.ControlledDynamicWebAppCluster") + .put("web-app-cluster","org.apache.brooklyn.entity.webapp.ControlledDynamicWebAppCluster") .build(); // Allow catalog-type or CatalogType as service type string http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/AppYamlTest.java ---------------------------------------------------------------------- diff --git a/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/AppYamlTest.java b/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/AppYamlTest.java index 44d9780..6e81431 100644 --- a/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/AppYamlTest.java +++ b/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/AppYamlTest.java @@ -42,7 +42,7 @@ public class AppYamlTest extends AbstractYamlTest { public void testAutoWrapsEntityInApp() throws Exception { String yaml = Joiner.on("\n").join( "services:", - "- serviceType: brooklyn.test.entity.TestEntity"); + "- serviceType: org.apache.brooklyn.test.entity.TestEntity"); BasicApplication app = (BasicApplication) createStartWaitAndLogApplication(new StringReader(yaml)); @SuppressWarnings("unused") @@ -53,7 +53,7 @@ public class AppYamlTest extends AbstractYamlTest { public void testDoesNotAutoWrapApp() throws Exception { String yaml = Joiner.on("\n").join( "services:", - "- serviceType: brooklyn.test.entity.TestApplication"); + "- serviceType: org.apache.brooklyn.test.entity.TestApplication"); TestApplication app = (TestApplication) createStartWaitAndLogApplication(new StringReader(yaml)); assertTrue(app.getChildren().isEmpty()); @@ -64,7 +64,7 @@ public class AppYamlTest extends AbstractYamlTest { String yaml = Joiner.on("\n").join( "name: myTopLevelName", "services:", - "- serviceType: brooklyn.test.entity.TestApplication", + "- serviceType: org.apache.brooklyn.test.entity.TestApplication", " name: myEntityName"); BasicApplication app = (BasicApplication) createStartWaitAndLogApplication(new StringReader(yaml)); @@ -78,7 +78,7 @@ public class AppYamlTest extends AbstractYamlTest { String yaml = Joiner.on("\n").join( "name: myTopLevelName", "services:", - "- serviceType: brooklyn.test.entity.TestApplication"); + "- serviceType: org.apache.brooklyn.test.entity.TestApplication"); TestApplication app = (TestApplication) createStartWaitAndLogApplication(new StringReader(yaml)); assertTrue(app.getChildren().isEmpty()); @@ -90,7 +90,7 @@ public class AppYamlTest extends AbstractYamlTest { String yaml = Joiner.on("\n").join( "name: myTopLevelName", "services:", - "- serviceType: brooklyn.test.entity.TestApplication", + "- serviceType: org.apache.brooklyn.test.entity.TestApplication", " brooklyn.config:", " defaultDisplayName: myDefaultEntityName"); @@ -103,7 +103,7 @@ public class AppYamlTest extends AbstractYamlTest { public void testUsesDefaultDisplayNameIfNoOther() throws Exception { String yaml = Joiner.on("\n").join( "services:", - "- serviceType: brooklyn.test.entity.TestApplication", + "- serviceType: org.apache.brooklyn.test.entity.TestApplication", " brooklyn.config:", " defaultDisplayName: myDefaultEntityName"); http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/EnrichersSlightlySimplerYamlTest.java ---------------------------------------------------------------------- diff --git a/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/EnrichersSlightlySimplerYamlTest.java b/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/EnrichersSlightlySimplerYamlTest.java index e231432..20e4275 100644 --- a/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/EnrichersSlightlySimplerYamlTest.java +++ b/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/EnrichersSlightlySimplerYamlTest.java @@ -23,6 +23,7 @@ import java.util.Collection; import java.util.Iterator; import java.util.List; +import org.apache.brooklyn.entity.webapp.JavaWebAppSoftwareProcess; import org.apache.brooklyn.test.EntityTestUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -34,7 +35,6 @@ import brooklyn.entity.basic.Attributes; import brooklyn.entity.basic.Entities; import brooklyn.entity.basic.EntityInternal; import brooklyn.entity.group.DynamicCluster; -import brooklyn.entity.webapp.JavaWebAppSoftwareProcess; import brooklyn.event.basic.Sensors; import brooklyn.util.collections.CollectionFunctionals; import brooklyn.util.collections.MutableList; http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/EnrichersYamlTest.java ---------------------------------------------------------------------- diff --git a/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/EnrichersYamlTest.java b/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/EnrichersYamlTest.java index 76f2293..ba288cf 100644 --- a/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/EnrichersYamlTest.java +++ b/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/EnrichersYamlTest.java @@ -134,7 +134,7 @@ public class EnrichersYamlTest extends AbstractYamlTest { " enricher.producer: $brooklyn:component(\"childId\")", " enricher.propagating.propagatingAll: true", " brooklyn.children:", - " - serviceType: brooklyn.test.entity.TestEntity", + " - serviceType: org.apache.brooklyn.test.entity.TestEntity", " id: childId", " brooklyn.config:", " test.confName: Child Name")); http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/EntitiesYamlIntegrationTest.java ---------------------------------------------------------------------- diff --git a/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/EntitiesYamlIntegrationTest.java b/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/EntitiesYamlIntegrationTest.java index 4933e5d..712ae85 100644 --- a/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/EntitiesYamlIntegrationTest.java +++ b/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/EntitiesYamlIntegrationTest.java @@ -20,6 +20,9 @@ package org.apache.brooklyn.camp.brooklyn; import static org.testng.Assert.*; +import org.apache.brooklyn.entity.proxy.nginx.NginxController; +import org.apache.brooklyn.entity.webapp.ControlledDynamicWebAppCluster; +import org.apache.brooklyn.entity.webapp.tomcat.TomcatServer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.testng.annotations.Test; @@ -29,10 +32,7 @@ import com.google.common.collect.Iterables; import brooklyn.entity.Entity; import brooklyn.entity.group.DynamicCluster; -import brooklyn.entity.proxy.nginx.NginxController; import brooklyn.entity.proxying.EntitySpec; -import brooklyn.entity.webapp.ControlledDynamicWebAppCluster; -import brooklyn.entity.webapp.tomcat.TomcatServer; public class EntitiesYamlIntegrationTest extends AbstractYamlTest { http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/EntitiesYamlTest.java ---------------------------------------------------------------------- diff --git a/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/EntitiesYamlTest.java b/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/EntitiesYamlTest.java index 5691dba..18feb2b 100644 --- a/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/EntitiesYamlTest.java +++ b/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/EntitiesYamlTest.java @@ -270,7 +270,7 @@ public class EntitiesYamlTest extends AbstractYamlTest { public void testSensor() throws Exception { Entity app = createAndStartApplication(loadYaml("test-entity-basic-template.yaml", " brooklyn.config:", - " test.confObject: $brooklyn:sensor(\"brooklyn.test.entity.TestEntity\", \"test.sequence\")")); + " test.confObject: $brooklyn:sensor(\"org.apache.brooklyn.test.entity.TestEntity\", \"test.sequence\")")); waitForApplicationTasks(app); Assert.assertEquals(app.getDisplayName(), "test-entity-basic-template"); @@ -312,7 +312,7 @@ public class EntitiesYamlTest extends AbstractYamlTest { " brooklyn.config:", " test.confName: first entity", " id: te1", - "- serviceType: brooklyn.test.entity.TestEntity", + "- serviceType: org.apache.brooklyn.test.entity.TestEntity", " name: second entity", " brooklyn.config:", " test.confObject: $brooklyn:component(\"te1\")")); @@ -343,16 +343,16 @@ public class EntitiesYamlTest extends AbstractYamlTest { " brooklyn.config:", " test.confName: first entity", " brooklyn.children:", - " - serviceType: brooklyn.test.entity.TestEntity", + " - serviceType: org.apache.brooklyn.test.entity.TestEntity", " name: Child Entity", " brooklyn.config:", " test.confName: Name of the first Child", " brooklyn.children:", - " - serviceType: brooklyn.test.entity.TestEntity", + " - serviceType: org.apache.brooklyn.test.entity.TestEntity", " name: Grandchild Entity", " brooklyn.config:", " test.confName: Name of the Grandchild", - " - serviceType: brooklyn.test.entity.TestEntity", + " - serviceType: org.apache.brooklyn.test.entity.TestEntity", " name: Second Child", " brooklyn.config:", " test.confName: Name of the second Child")); @@ -624,11 +624,11 @@ public class EntitiesYamlTest extends AbstractYamlTest { public void testEntitySpecConfig() throws Exception { String yaml = "services:\n"+ - "- serviceType: brooklyn.test.entity.TestEntity\n"+ + "- serviceType: org.apache.brooklyn.test.entity.TestEntity\n"+ " brooklyn.config:\n"+ " test.childSpec:\n"+ " $brooklyn:entitySpec:\n"+ - " type: brooklyn.test.entity.TestEntity\n"+ + " type: org.apache.brooklyn.test.entity.TestEntity\n"+ " brooklyn.config:\n"+ " test.confName: inchildspec\n"; @@ -643,12 +643,12 @@ public class EntitiesYamlTest extends AbstractYamlTest { public void testEntitySpecFlags() throws Exception { String yaml = "services:\n"+ - "- serviceType: brooklyn.test.entity.TestEntity\n"+ + "- serviceType: org.apache.brooklyn.test.entity.TestEntity\n"+ " confName: inParent\n"+ " brooklyn.config:\n"+ " test.childSpec:\n"+ " $brooklyn:entitySpec:\n"+ - " type: brooklyn.test.entity.TestEntity\n"+ + " type: org.apache.brooklyn.test.entity.TestEntity\n"+ " confName: inchildspec\n"; Application app = (Application) createStartWaitAndLogApplication(new StringReader(yaml)); @@ -662,13 +662,13 @@ public class EntitiesYamlTest extends AbstractYamlTest { public void testEntitySpecExplicitFlags() throws Exception { String yaml = "services:\n"+ - "- serviceType: brooklyn.test.entity.TestEntity\n"+ + "- serviceType: org.apache.brooklyn.test.entity.TestEntity\n"+ " brooklyn.flags:\n"+ " confName: inParent\n"+ " brooklyn.config:\n"+ " test.childSpec:\n"+ " $brooklyn:entitySpec:\n"+ - " type: brooklyn.test.entity.TestEntity\n"+ + " type: org.apache.brooklyn.test.entity.TestEntity\n"+ " brooklyn.flags:\n"+ " confName: inchildspec\n"; @@ -683,19 +683,19 @@ public class EntitiesYamlTest extends AbstractYamlTest { public void testEntitySpecWithChildren() throws Exception { String yaml = "services:\n"+ - "- serviceType: brooklyn.test.entity.TestEntity\n"+ + "- serviceType: org.apache.brooklyn.test.entity.TestEntity\n"+ " brooklyn.config:\n"+ " test.childSpec:\n"+ " $brooklyn:entitySpec:\n"+ - " type: brooklyn.test.entity.TestEntity\n"+ + " type: org.apache.brooklyn.test.entity.TestEntity\n"+ " brooklyn.config:\n"+ " test.confName: child\n"+ " brooklyn.children:\n"+ - " - type: brooklyn.test.entity.TestEntity\n" + + " - type: org.apache.brooklyn.test.entity.TestEntity\n" + " brooklyn.config:\n" + " test.confName: grandchild\n" + " brooklyn.children:\n"+ - " - type: brooklyn.test.entity.TestEntity\n" + + " - type: org.apache.brooklyn.test.entity.TestEntity\n" + " brooklyn.config:\n" + " test.confName: greatgrandchild\n"; @@ -718,16 +718,16 @@ public class EntitiesYamlTest extends AbstractYamlTest { public void testNestedEntitySpecConfigs() throws Exception { String yaml = "services:\n"+ - "- serviceType: brooklyn.test.entity.TestEntity\n"+ + "- serviceType: org.apache.brooklyn.test.entity.TestEntity\n"+ " brooklyn.config:\n"+ " test.childSpec:\n"+ " $brooklyn:entitySpec:\n"+ - " type: brooklyn.test.entity.TestEntity\n"+ + " type: org.apache.brooklyn.test.entity.TestEntity\n"+ " brooklyn.config:\n"+ " test.confName: inchildspec\n"+ " test.childSpec:\n"+ " $brooklyn:entitySpec:\n"+ - " type: brooklyn.test.entity.TestEntity\n"+ + " type: org.apache.brooklyn.test.entity.TestEntity\n"+ " brooklyn.config:\n"+ " test.confName: ingrandchildspec\n"; @@ -745,11 +745,11 @@ public class EntitiesYamlTest extends AbstractYamlTest { public void testEntitySpecInUnmatchedConfig() throws Exception { String yaml = "services:\n"+ - "- serviceType: brooklyn.test.entity.TestEntity\n"+ + "- serviceType: org.apache.brooklyn.test.entity.TestEntity\n"+ " brooklyn.config:\n"+ " key.does.not.match:\n"+ " $brooklyn:entitySpec:\n"+ - " type: brooklyn.test.entity.TestEntity\n"+ + " type: org.apache.brooklyn.test.entity.TestEntity\n"+ " brooklyn.config:\n"+ " test.confName: inchildspec\n"; @@ -783,7 +783,7 @@ public class EntitiesYamlTest extends AbstractYamlTest { public void testEntityImplExposesAllInterfacesIncludingStartable() throws Exception { String yaml = "services:\n"+ - "- serviceType: brooklyn.test.entity.TestEntityImpl\n"; + "- serviceType: org.apache.brooklyn.test.entity.TestEntityImpl\n"; Application app = (Application) createStartWaitAndLogApplication(new StringReader(yaml)); TestEntity entity = (TestEntity) Iterables.getOnlyElement(app.getChildren()); http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/JavaWebAppsIntegrationTest.java ---------------------------------------------------------------------- diff --git a/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/JavaWebAppsIntegrationTest.java b/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/JavaWebAppsIntegrationTest.java index b95b188..b82db14 100644 --- a/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/JavaWebAppsIntegrationTest.java +++ b/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/JavaWebAppsIntegrationTest.java @@ -34,6 +34,9 @@ import java.util.concurrent.atomic.AtomicInteger; import org.apache.brooklyn.camp.brooklyn.BrooklynCampPlatform; import org.apache.brooklyn.camp.brooklyn.BrooklynCampPlatformLauncherNoServer; +import org.apache.brooklyn.entity.webapp.DynamicWebAppCluster; +import org.apache.brooklyn.entity.webapp.JavaWebAppService; +import org.apache.brooklyn.entity.webapp.WebAppService; import org.apache.brooklyn.management.ManagementContext; import org.apache.brooklyn.management.Task; import org.apache.brooklyn.policy.Policy; @@ -50,9 +53,6 @@ import brooklyn.entity.basic.Attributes; import brooklyn.entity.basic.BrooklynTaskTags; import brooklyn.entity.basic.Entities; import brooklyn.entity.basic.Lifecycle; -import brooklyn.entity.webapp.DynamicWebAppCluster; -import brooklyn.entity.webapp.JavaWebAppService; -import brooklyn.entity.webapp.WebAppService; import brooklyn.policy.autoscaling.AutoScalerPolicy; import brooklyn.test.Asserts; import brooklyn.util.ResourceUtils; http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/LocationsYamlTest.java ---------------------------------------------------------------------- diff --git a/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/LocationsYamlTest.java b/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/LocationsYamlTest.java index 6f79471..71aeb01 100644 --- a/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/LocationsYamlTest.java +++ b/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/LocationsYamlTest.java @@ -50,7 +50,7 @@ public class LocationsYamlTest extends AbstractYamlTest { String yaml = "location: localhost\n"+ "services:\n"+ - "- serviceType: brooklyn.test.entity.TestEntity\n"; + "- serviceType: org.apache.brooklyn.test.entity.TestEntity\n"; Entity app = createStartWaitAndLogApplication(new StringReader(yaml)); LocalhostMachineProvisioningLocation loc = (LocalhostMachineProvisioningLocation) Iterables.getOnlyElement(app.getLocations()); @@ -62,7 +62,7 @@ public class LocationsYamlTest extends AbstractYamlTest { String yaml = "location: localhost:(name=myname)\n"+ "services:\n"+ - "- serviceType: brooklyn.test.entity.TestEntity\n"; + "- serviceType: org.apache.brooklyn.test.entity.TestEntity\n"; Entity app = createStartWaitAndLogApplication(new StringReader(yaml)); LocalhostMachineProvisioningLocation loc = (LocalhostMachineProvisioningLocation) Iterables.getOnlyElement(app.getLocations()); @@ -75,7 +75,7 @@ public class LocationsYamlTest extends AbstractYamlTest { "location:\n"+ " localhost\n"+ "services:\n"+ - "- serviceType: brooklyn.test.entity.TestEntity\n"; + "- serviceType: org.apache.brooklyn.test.entity.TestEntity\n"; Entity app = createStartWaitAndLogApplication(new StringReader(yaml)); LocalhostMachineProvisioningLocation loc = (LocalhostMachineProvisioningLocation) Iterables.getOnlyElement(app.getLocations()); @@ -89,7 +89,7 @@ public class LocationsYamlTest extends AbstractYamlTest { "- localhost:(name=loc1)\n"+ "- localhost:(name=loc2)\n"+ "services:\n"+ - "- serviceType: brooklyn.test.entity.TestEntity\n"; + "- serviceType: org.apache.brooklyn.test.entity.TestEntity\n"; Entity app = createStartWaitAndLogApplication(new StringReader(yaml)); List<Location> locs = ImmutableList.copyOf(app.getLocations()); @@ -108,7 +108,7 @@ public class LocationsYamlTest extends AbstractYamlTest { " displayName: myname\n"+ " myconfkey: myconfval\n"+ "services:\n"+ - "- serviceType: brooklyn.test.entity.TestEntity\n"; + "- serviceType: org.apache.brooklyn.test.entity.TestEntity\n"; Entity app = createStartWaitAndLogApplication(new StringReader(yaml)); LocalhostMachineProvisioningLocation loc = (LocalhostMachineProvisioningLocation) Iterables.getOnlyElement(app.getLocations()); @@ -127,7 +127,7 @@ public class LocationsYamlTest extends AbstractYamlTest { " displayName: myname2\n"+ " myconfkey: myconfval2\n"+ "services:\n"+ - "- serviceType: brooklyn.test.entity.TestEntity\n"; + "- serviceType: org.apache.brooklyn.test.entity.TestEntity\n"; Entity app = createStartWaitAndLogApplication(new StringReader(yaml)); List<Location> locs = ImmutableList.copyOf(app.getLocations()); @@ -146,7 +146,7 @@ public class LocationsYamlTest extends AbstractYamlTest { String yaml = "location: \n"+ "services:\n"+ - "- serviceType: brooklyn.test.entity.TestEntity\n"; + "- serviceType: org.apache.brooklyn.test.entity.TestEntity\n"; Entity app = createStartWaitAndLogApplication(new StringReader(yaml)); assertTrue(app.getLocations().isEmpty(), "locs="+app.getLocations()); @@ -159,7 +159,7 @@ public class LocationsYamlTest extends AbstractYamlTest { "locations:\n"+ "- localhost\n"+ "services:\n"+ - "- serviceType: brooklyn.test.entity.TestEntity\n"; + "- serviceType: org.apache.brooklyn.test.entity.TestEntity\n"; try { createStartWaitAndLogApplication(new StringReader(yaml)); @@ -175,7 +175,7 @@ public class LocationsYamlTest extends AbstractYamlTest { "location:\n"+ "- localhost\n"+ "services:\n"+ - "- serviceType: brooklyn.test.entity.TestEntity\n"; + "- serviceType: org.apache.brooklyn.test.entity.TestEntity\n"; try { createStartWaitAndLogApplication(new StringReader(yaml)); @@ -190,7 +190,7 @@ public class LocationsYamlTest extends AbstractYamlTest { "locations:\n"+ "- localhost:(name=loc1)\n"+ "services:\n"+ - "- serviceType: brooklyn.test.entity.TestEntity\n"; + "- serviceType: org.apache.brooklyn.test.entity.TestEntity\n"; Entity app = createStartWaitAndLogApplication(new StringReader(yaml)); Entity child = Iterables.getOnlyElement(app.getChildren()); @@ -209,7 +209,7 @@ public class LocationsYamlTest extends AbstractYamlTest { " - 127.0.0.1\n"+ " - [email protected]\n"+ "services:\n"+ - "- serviceType: brooklyn.test.entity.TestEntity\n"; + "- serviceType: org.apache.brooklyn.test.entity.TestEntity\n"; Entity app = createStartWaitAndLogApplication(new StringReader(yaml)); Entity child = Iterables.getOnlyElement(app.getChildren()); @@ -230,7 +230,7 @@ public class LocationsYamlTest extends AbstractYamlTest { " user: root\n"+ " hosts: \"{127.0.{0,127}.{1-2},[email protected]}\"\n"+ "services:\n"+ - "- serviceType: brooklyn.test.entity.TestEntity\n"; + "- serviceType: org.apache.brooklyn.test.entity.TestEntity\n"; Entity app = createStartWaitAndLogApplication(new StringReader(yaml)); Entity child = Iterables.getOnlyElement(app.getChildren()); @@ -258,7 +258,7 @@ public class LocationsYamlTest extends AbstractYamlTest { " hosts:\n"+ " - 127.0.0.127\n"+ "services:\n"+ - "- serviceType: brooklyn.test.entity.TestEntity\n"; + "- serviceType: org.apache.brooklyn.test.entity.TestEntity\n"; Entity app = createStartWaitAndLogApplication(new StringReader(yaml)); Entity child = Iterables.getOnlyElement(app.getChildren()); http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/MapReferenceYamlTest.java ---------------------------------------------------------------------- diff --git a/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/MapReferenceYamlTest.java b/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/MapReferenceYamlTest.java index bd000e9..ad2efc9 100644 --- a/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/MapReferenceYamlTest.java +++ b/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/MapReferenceYamlTest.java @@ -21,6 +21,7 @@ package org.apache.brooklyn.camp.brooklyn; import java.util.Map; import java.util.concurrent.Callable; +import org.apache.brooklyn.entity.proxy.ProxySslConfig; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.testng.Assert; @@ -29,7 +30,6 @@ import org.testng.annotations.Test; import brooklyn.entity.Entity; import brooklyn.entity.basic.BasicEntity; import brooklyn.entity.basic.Entities; -import brooklyn.entity.proxy.ProxySslConfig; import brooklyn.test.entity.TestEntity; import brooklyn.util.task.Tasks; @@ -70,7 +70,7 @@ public class MapReferenceYamlTest extends AbstractYamlTest { " frog: $brooklyn:formatString(\"%s\", \"frog\")", " object:", " $brooklyn:object:", - " type: brooklyn.entity.proxy.ProxySslConfig", + " type: org.apache.brooklyn.entity.proxy.ProxySslConfig", " one: $brooklyn:entity(\"one\")", " two: $brooklyn:entity(\"two\")"); @@ -100,7 +100,7 @@ public class MapReferenceYamlTest extends AbstractYamlTest { " frog: $brooklyn:formatString(\"%s\", \"frog\")", " object:", " $brooklyn:object:", - " type: brooklyn.entity.proxy.ProxySslConfig", + " type: org.apache.brooklyn.entity.proxy.ProxySslConfig", " one: $brooklyn:entity(\"one\")", " two: $brooklyn:entity(\"two\")"); http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/ObjectsYamlTest.java ---------------------------------------------------------------------- diff --git a/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/ObjectsYamlTest.java b/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/ObjectsYamlTest.java index b31fdef..5bef5b5 100644 --- a/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/ObjectsYamlTest.java +++ b/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/ObjectsYamlTest.java @@ -21,6 +21,7 @@ package org.apache.brooklyn.camp.brooklyn; import java.util.List; import java.util.concurrent.atomic.AtomicBoolean; +import org.apache.brooklyn.entity.proxy.ProxySslConfig; import org.apache.brooklyn.management.ManagementContext; import org.apache.brooklyn.management.Task; import org.slf4j.Logger; @@ -33,7 +34,6 @@ import brooklyn.config.ConfigKey.HasConfigKey; import brooklyn.entity.Entity; import brooklyn.entity.basic.ConfigKeys; import brooklyn.entity.basic.Entities; -import brooklyn.entity.proxy.ProxySslConfig; import brooklyn.entity.trait.Configurable; import brooklyn.management.ManagementContextInjectable; import brooklyn.test.entity.TestEntity; @@ -182,7 +182,7 @@ public class ObjectsYamlTest extends AbstractYamlTest { " number: 7", " object:", " $brooklyn:object:", - " type: brooklyn.entity.proxy.ProxySslConfig", + " type: org.apache.brooklyn.entity.proxy.ProxySslConfig", " string: \"frog\""); Object testObject = testEntity.getConfig(TestEntity.CONF_OBJECT); @@ -210,7 +210,7 @@ public class ObjectsYamlTest extends AbstractYamlTest { " config.number: 7", " object:", " $brooklyn:object:", - " type: brooklyn.entity.proxy.ProxySslConfig"); + " type: org.apache.brooklyn.entity.proxy.ProxySslConfig"); Object testObject = testEntity.getConfig(TestEntity.CONF_OBJECT); @@ -232,11 +232,11 @@ public class ObjectsYamlTest extends AbstractYamlTest { " brooklyn.config:", " test.confListPlain:", " - $brooklyn:object:", - " objectType: brooklyn.entity.proxy.ProxySslConfig", + " objectType: org.apache.brooklyn.entity.proxy.ProxySslConfig", " - $brooklyn:object:", - " object_type: brooklyn.entity.proxy.ProxySslConfig", + " object_type: org.apache.brooklyn.entity.proxy.ProxySslConfig", " - $brooklyn:object:", - " type: brooklyn.entity.proxy.ProxySslConfig"); + " type: org.apache.brooklyn.entity.proxy.ProxySslConfig"); List<?> testList = testEntity.getConfig(TestEntity.CONF_LIST_PLAIN); @@ -257,7 +257,7 @@ public class ObjectsYamlTest extends AbstractYamlTest { " number: 7", " object:", " $brooklyn:object:", - " type: brooklyn.entity.proxy.ProxySslConfig", + " type: org.apache.brooklyn.entity.proxy.ProxySslConfig", " string:", " $brooklyn:formatString(\"%s\", \"frog\")"); http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/PoliciesYamlTest.java ---------------------------------------------------------------------- diff --git a/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/PoliciesYamlTest.java b/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/PoliciesYamlTest.java index 11d1d69..fae685d 100644 --- a/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/PoliciesYamlTest.java +++ b/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/PoliciesYamlTest.java @@ -94,13 +94,13 @@ public class PoliciesYamlTest extends AbstractYamlTest { " brooklyn.config:", " test.confName: parent entity", " brooklyn.children:", - " - serviceType: brooklyn.test.entity.TestEntity", + " - serviceType: org.apache.brooklyn.test.entity.TestEntity", " name: Child Entity", " brooklyn.policies:", " - policyType: brooklyn.test.policy.TestPolicy", " brooklyn.config:", " test.confName: Name from YAML", - " test.attributeSensor: $brooklyn:sensor(\"brooklyn.test.entity.TestEntity\", \"test.name\")")); + " test.attributeSensor: $brooklyn:sensor(\"org.apache.brooklyn.test.entity.TestEntity\", \"test.name\")")); waitForApplicationTasks(app); Assert.assertEquals(app.getChildren().size(), 1); http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/WrapAppTest.java ---------------------------------------------------------------------- diff --git a/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/WrapAppTest.java b/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/WrapAppTest.java index e94e8c5..b8175c4 100644 --- a/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/WrapAppTest.java +++ b/usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/WrapAppTest.java @@ -29,30 +29,30 @@ public class WrapAppTest extends AbstractYamlTest { private static final String NO_WRAP_APP_IMPLICIT = "name: Empty App\n" + "services:\n" + - " - type: brooklyn.test.entity.TestApplication"; + " - type: org.apache.brooklyn.test.entity.TestApplication"; private static final String NO_WRAP_APP_EXPLICIT = "name: Empty App\n" + "wrappedApp: false\n" + "services:\n" + - " - type: brooklyn.test.entity.TestApplication"; + " - type: org.apache.brooklyn.test.entity.TestApplication"; private static final String WRAP_APP_IMPLICIT = "name: Empty App\n" + "services:\n" + - " - type: brooklyn.test.entity.TestApplication\n" + - " - type: brooklyn.test.entity.TestApplication"; + " - type: org.apache.brooklyn.test.entity.TestApplication\n" + + " - type: org.apache.brooklyn.test.entity.TestApplication"; private static final String WRAP_APP_EXPLICIT = "name: Empty App\n" + "wrappedApp: true\n" + "services:\n" + - " - type: brooklyn.test.entity.TestApplication"; + " - type: org.apache.brooklyn.test.entity.TestApplication"; private static final String WRAP_ENTITY = "name: Empty App\n" + "services:\n" + - " - type: brooklyn.test.entity.TestEntity"; + " - type: org.apache.brooklyn.test.entity.TestEntity"; @Test public void testNoWrapAppImplicit() throws Exception { http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/usage/camp/src/test/resources/example-with-function.yaml ---------------------------------------------------------------------- diff --git a/usage/camp/src/test/resources/example-with-function.yaml b/usage/camp/src/test/resources/example-with-function.yaml index ebc26d7..918db2b 100644 --- a/usage/camp/src/test/resources/example-with-function.yaml +++ b/usage/camp/src/test/resources/example-with-function.yaml @@ -22,7 +22,7 @@ description: | origin: https://github.com/apache/incubator-brooklyn location: localhost services: -- serviceType: brooklyn.entity.webapp.jboss.JBoss7Server +- serviceType: org.apache.brooklyn.entity.webapp.jboss.JBoss7Server brooklyn.config: # test the various ways to use literals, either a function literalValue1: '$brooklyn:literal("$brooklyn: is a fun place")' http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/usage/camp/src/test/resources/java-web-app-and-db-with-function-2.yaml ---------------------------------------------------------------------- diff --git a/usage/camp/src/test/resources/java-web-app-and-db-with-function-2.yaml b/usage/camp/src/test/resources/java-web-app-and-db-with-function-2.yaml index 9583ac9..bf90092 100644 --- a/usage/camp/src/test/resources/java-web-app-and-db-with-function-2.yaml +++ b/usage/camp/src/test/resources/java-web-app-and-db-with-function-2.yaml @@ -19,7 +19,7 @@ name: java-cluster-db-example location: localhost services: -- serviceType: brooklyn.entity.webapp.ControlledDynamicWebAppCluster +- serviceType: org.apache.brooklyn.entity.webapp.ControlledDynamicWebAppCluster name: My Web 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://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/usage/camp/src/test/resources/java-web-app-and-db-with-function.yaml ---------------------------------------------------------------------- diff --git a/usage/camp/src/test/resources/java-web-app-and-db-with-function.yaml b/usage/camp/src/test/resources/java-web-app-and-db-with-function.yaml index cb9a00e..249ab32 100644 --- a/usage/camp/src/test/resources/java-web-app-and-db-with-function.yaml +++ b/usage/camp/src/test/resources/java-web-app-and-db-with-function.yaml @@ -18,7 +18,7 @@ # name: java-cluster-db-example services: -- serviceType: brooklyn.entity.webapp.ControlledDynamicWebAppCluster +- serviceType: org.apache.brooklyn.entity.webapp.ControlledDynamicWebAppCluster name: My Web location: localhost brooklyn.config: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/usage/camp/src/test/resources/java-web-app-and-db-with-policy.yaml ---------------------------------------------------------------------- diff --git a/usage/camp/src/test/resources/java-web-app-and-db-with-policy.yaml b/usage/camp/src/test/resources/java-web-app-and-db-with-policy.yaml index 107686c..671f64a 100644 --- a/usage/camp/src/test/resources/java-web-app-and-db-with-policy.yaml +++ b/usage/camp/src/test/resources/java-web-app-and-db-with-policy.yaml @@ -18,7 +18,7 @@ # name: java-cluster-db-policy-example services: -- type: brooklyn.entity.webapp.ControlledDynamicWebAppCluster +- type: org.apache.brooklyn.entity.webapp.ControlledDynamicWebAppCluster name: My Web with Policy location: localhost brooklyn.config: @@ -31,7 +31,7 @@ services: brooklyn.policies: - policyType: brooklyn.policy.autoscaling.AutoScalerPolicy brooklyn.config: - metric: $brooklyn:sensor("brooklyn.entity.webapp.DynamicWebAppCluster", "webapp.reqs.perSec.windowed.perNode") + metric: $brooklyn:sensor("org.apache.brooklyn.entity.webapp.DynamicWebAppCluster", "webapp.reqs.perSec.windowed.perNode") metricLowerBound: 10 metricUpperBound: 100 minPoolSize: 1 http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/usage/camp/src/test/resources/java-web-app-simple.yaml ---------------------------------------------------------------------- diff --git a/usage/camp/src/test/resources/java-web-app-simple.yaml b/usage/camp/src/test/resources/java-web-app-simple.yaml index 558b272..526e90b 100644 --- a/usage/camp/src/test/resources/java-web-app-simple.yaml +++ b/usage/camp/src/test/resources/java-web-app-simple.yaml @@ -21,7 +21,7 @@ description: Single JBoss using Brooklyn origin: https://github.com/apache/incubator-brooklyn location: localhost services: -- serviceType: brooklyn.entity.webapp.tomcat.Tomcat8Server +- 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://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/usage/camp/src/test/resources/test-app-with-enrichers-slightly-simpler.yaml ---------------------------------------------------------------------- diff --git a/usage/camp/src/test/resources/test-app-with-enrichers-slightly-simpler.yaml b/usage/camp/src/test/resources/test-app-with-enrichers-slightly-simpler.yaml index df725e3..6d8c7e5 100644 --- a/usage/camp/src/test/resources/test-app-with-enrichers-slightly-simpler.yaml +++ b/usage/camp/src/test/resources/test-app-with-enrichers-slightly-simpler.yaml @@ -27,7 +27,7 @@ services: location: localhost memberSpec: $brooklyn:entitySpec: - type: brooklyn.test.entity.TestEntity + type: org.apache.brooklyn.test.entity.TestEntity brooklyn.enrichers: - type: brooklyn.enricher.basic.Transformer # transform "ip" (which we expect a feed, not shown here, to set) to a URL; http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/usage/camp/src/test/resources/test-cluster-with-member-spec.yaml ---------------------------------------------------------------------- diff --git a/usage/camp/src/test/resources/test-cluster-with-member-spec.yaml b/usage/camp/src/test/resources/test-cluster-with-member-spec.yaml index ce4e8ff..1176478 100644 --- a/usage/camp/src/test/resources/test-cluster-with-member-spec.yaml +++ b/usage/camp/src/test/resources/test-cluster-with-member-spec.yaml @@ -27,6 +27,6 @@ services: initialSize: 2 memberSpec: $brooklyn:entitySpec: - type: brooklyn.test.entity.TestEntity + type: org.apache.brooklyn.test.entity.TestEntity brooklyn.config: test.confName: yamlTest \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/usage/camp/src/test/resources/test-entity-basic-template.yaml ---------------------------------------------------------------------- diff --git a/usage/camp/src/test/resources/test-entity-basic-template.yaml b/usage/camp/src/test/resources/test-entity-basic-template.yaml index db88d23..42762d4 100644 --- a/usage/camp/src/test/resources/test-entity-basic-template.yaml +++ b/usage/camp/src/test/resources/test-entity-basic-template.yaml @@ -19,6 +19,6 @@ name: test-entity-basic-template description: TestEntity with templated brooklyn.config and additional config (such as services) origin: https://github.com/apache/incubator-brooklyn services: -- serviceType: brooklyn.test.entity.TestEntity +- serviceType: org.apache.brooklyn.test.entity.TestEntity name: testentity # should have nothing below here as the test appends things underneath http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/usage/camp/src/test/resources/test-entity-reference-map-template.yaml ---------------------------------------------------------------------- diff --git a/usage/camp/src/test/resources/test-entity-reference-map-template.yaml b/usage/camp/src/test/resources/test-entity-reference-map-template.yaml index f03abbd..cf786bd 100644 --- a/usage/camp/src/test/resources/test-entity-reference-map-template.yaml +++ b/usage/camp/src/test/resources/test-entity-reference-map-template.yaml @@ -23,6 +23,6 @@ services: id: one - serviceType: brooklyn.entity.basic.BasicEntity id: two -- serviceType: brooklyn.test.entity.TestEntity +- serviceType: org.apache.brooklyn.test.entity.TestEntity name: testentity # should have nothing below here as the test appends things underneath http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/usage/camp/src/test/resources/test-entity-with-enricher.yaml ---------------------------------------------------------------------- diff --git a/usage/camp/src/test/resources/test-entity-with-enricher.yaml b/usage/camp/src/test/resources/test-entity-with-enricher.yaml index fd0ae1e..d09d298 100644 --- a/usage/camp/src/test/resources/test-entity-with-enricher.yaml +++ b/usage/camp/src/test/resources/test-entity-with-enricher.yaml @@ -33,4 +33,4 @@ services: enricherLiteralValue2: World test.confName: Name from YAML test.confFromFunction: "$brooklyn:formatString(\"%s: is a fun place\", \"$brooklyn\")" - test.attributeSensor: $brooklyn:sensor("brooklyn.test.entity.TestEntity", "test.name") + test.attributeSensor: $brooklyn:sensor("org.apache.brooklyn.test.entity.TestEntity", "test.name") http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/usage/camp/src/test/resources/test-entity-with-init-config.yaml ---------------------------------------------------------------------- diff --git a/usage/camp/src/test/resources/test-entity-with-init-config.yaml b/usage/camp/src/test/resources/test-entity-with-init-config.yaml index f288363..2718268 100644 --- a/usage/camp/src/test/resources/test-entity-with-init-config.yaml +++ b/usage/camp/src/test/resources/test-entity-with-init-config.yaml @@ -20,7 +20,7 @@ name: test-entity-with-init-config description: Creates a TestEntityWithInitConfig entity that references a 2nd test entity during its init() origin: https://github.com/apache/incubator-brooklyn services: -- serviceType: brooklyn.test.entity.TestEntity +- serviceType: org.apache.brooklyn.test.entity.TestEntity id: te1 name: testentity brooklyn.config: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/usage/camp/src/test/resources/test-entity-with-policy.yaml ---------------------------------------------------------------------- diff --git a/usage/camp/src/test/resources/test-entity-with-policy.yaml b/usage/camp/src/test/resources/test-entity-with-policy.yaml index 84b0c9a..e374d2a 100644 --- a/usage/camp/src/test/resources/test-entity-with-policy.yaml +++ b/usage/camp/src/test/resources/test-entity-with-policy.yaml @@ -33,4 +33,4 @@ services: policyLiteralValue2: World test.confName: Name from YAML test.confFromFunction: "$brooklyn:formatString(\"%s: is a fun place\", \"$brooklyn\")" - test.attributeSensor: $brooklyn:sensor("brooklyn.test.entity.TestEntity", "test.name") + test.attributeSensor: $brooklyn:sensor("org.apache.brooklyn.test.entity.TestEntity", "test.name") http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/usage/camp/src/test/resources/test-java-web-app-spec-and-db-with-function.yaml ---------------------------------------------------------------------- diff --git a/usage/camp/src/test/resources/test-java-web-app-spec-and-db-with-function.yaml b/usage/camp/src/test/resources/test-java-web-app-spec-and-db-with-function.yaml index 7eb4e50..eb63758 100644 --- a/usage/camp/src/test/resources/test-java-web-app-spec-and-db-with-function.yaml +++ b/usage/camp/src/test/resources/test-java-web-app-spec-and-db-with-function.yaml @@ -19,14 +19,14 @@ name: java-cluster-db-example location: localhost services: -- serviceType: brooklyn.entity.webapp.ControlledDynamicWebAppCluster +- serviceType: org.apache.brooklyn.entity.webapp.ControlledDynamicWebAppCluster name: My Web brooklyn.config: proxy.http.port: 9210+ http.port: 9280+ memberSpec: $brooklyn:entitySpec: - type: brooklyn.entity.webapp.jboss.JBoss7Server + type: org.apache.brooklyn.entity.webapp.jboss.JBoss7Server brooklyn.config: wars.root: http://search.maven.org/remotecontent?filepath=io/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.6.0/brooklyn-example-hello-world-sql-webapp-0.6.0.war java.sysprops: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/usage/camp/src/test/resources/test-propagating-enricher.yaml ---------------------------------------------------------------------- diff --git a/usage/camp/src/test/resources/test-propagating-enricher.yaml b/usage/camp/src/test/resources/test-propagating-enricher.yaml index 7dfd1f1..e141c3e 100644 --- a/usage/camp/src/test/resources/test-propagating-enricher.yaml +++ b/usage/camp/src/test/resources/test-propagating-enricher.yaml @@ -20,7 +20,7 @@ name: test-propagating-enricher description: TestEntity with Propagating Enricher at application-level using Brooklyn origin: https://github.com/apache/incubator-brooklyn services: -- serviceType: brooklyn.test.entity.TestEntity +- serviceType: org.apache.brooklyn.test.entity.TestEntity id: te1 name: testentity brooklyn.config: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/usage/camp/src/test/resources/test-tomcat-cluster.yaml ---------------------------------------------------------------------- diff --git a/usage/camp/src/test/resources/test-tomcat-cluster.yaml b/usage/camp/src/test/resources/test-tomcat-cluster.yaml index 778a136..e3087b8 100644 --- a/usage/camp/src/test/resources/test-tomcat-cluster.yaml +++ b/usage/camp/src/test/resources/test-tomcat-cluster.yaml @@ -19,12 +19,12 @@ name: Test Tomcat cluster location: localhost services: -- serviceType: brooklyn.entity.webapp.ControlledDynamicWebAppCluster +- serviceType: org.apache.brooklyn.entity.webapp.ControlledDynamicWebAppCluster name: tomcat-cluster initialSize: 2 memberSpec: $brooklyn:entitySpec: - type: brooklyn.entity.webapp.tomcat.TomcatServer + 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/incubator-brooklyn/blob/77dff880/usage/camp/src/test/resources/test-tomcat-https.yaml ---------------------------------------------------------------------- diff --git a/usage/camp/src/test/resources/test-tomcat-https.yaml b/usage/camp/src/test/resources/test-tomcat-https.yaml index c8173fb..83a0fc6 100644 --- a/usage/camp/src/test/resources/test-tomcat-https.yaml +++ b/usage/camp/src/test/resources/test-tomcat-https.yaml @@ -19,10 +19,10 @@ name: Test Tomcat HTTPS location: localhost services: -- type: brooklyn.entity.webapp.tomcat.TomcatServer +- type: org.apache.brooklyn.entity.webapp.tomcat.TomcatServer war: http://search.maven.org/remotecontent?filepath=io/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.6.0/brooklyn-example-hello-world-sql-webapp-0.6.0.war enabledProtocols: [https] httpsSsl: - url: classpath://brooklyn/entity/webapp/sample-java-keystore.jks + url: classpath://org/apache/brooklyn/entity/webapp/sample-java-keystore.jks alias: myname password: mypass http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/usage/camp/src/test/resources/test-webapp-with-averaging-enricher.yaml ---------------------------------------------------------------------- diff --git a/usage/camp/src/test/resources/test-webapp-with-averaging-enricher.yaml b/usage/camp/src/test/resources/test-webapp-with-averaging-enricher.yaml index d4fc6ee..c2770d7 100644 --- a/usage/camp/src/test/resources/test-webapp-with-averaging-enricher.yaml +++ b/usage/camp/src/test/resources/test-webapp-with-averaging-enricher.yaml @@ -21,7 +21,7 @@ name: test-webapp-with-averaging-enricher description: Testing many enrichers services: -- type: brooklyn.entity.webapp.ControlledDynamicWebAppCluster +- type: org.apache.brooklyn.entity.webapp.ControlledDynamicWebAppCluster initialSize: 3 location: localhost @@ -29,7 +29,7 @@ services: # this assumes the test fixture will set the "my.load" sensor on the member-specs in here. webClusterSpec: $brooklyn:entitySpec: - type: brooklyn.entity.webapp.DynamicWebAppCluster + type: org.apache.brooklyn.entity.webapp.DynamicWebAppCluster id: cluster brooklyn.enrichers: - type: brooklyn.enricher.basic.Aggregator
