You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by he...@apache.org on 2016/02/01 18:48:00 UTC
[24/51] [abbrv] [partial] brooklyn-library git commit: move subdir
from incubator up a level as it is promoted to its own repo (first
non-incubator commit!)
http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/software/database/src/test/java/org/apache/brooklyn/entity/database/postgresql/PostgreSqlRestartIntegrationTest.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/software/database/src/test/java/org/apache/brooklyn/entity/database/postgresql/PostgreSqlRestartIntegrationTest.java b/brooklyn-library/software/database/src/test/java/org/apache/brooklyn/entity/database/postgresql/PostgreSqlRestartIntegrationTest.java
deleted file mode 100644
index 185fec3..0000000
--- a/brooklyn-library/software/database/src/test/java/org/apache/brooklyn/entity/database/postgresql/PostgreSqlRestartIntegrationTest.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.brooklyn.entity.database.postgresql;
-
-import org.apache.brooklyn.api.entity.EntitySpec;
-import org.apache.brooklyn.entity.software.base.AbstractSoftwareProcessRestartIntegrationTest;
-import org.apache.brooklyn.entity.software.base.SoftwareProcess;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testng.annotations.Test;
-
-/**
- * Tests restart of the software *process* (as opposed to the VM).
- */
-@Test(groups="Integration")
-public class PostgreSqlRestartIntegrationTest extends AbstractSoftwareProcessRestartIntegrationTest {
-
- @SuppressWarnings("unused")
- private static final Logger LOG = LoggerFactory.getLogger(PostgreSqlRestartIntegrationTest.class);
-
- @Override
- protected EntitySpec<? extends SoftwareProcess> newEntitySpec() {
- return EntitySpec.create(PostgreSqlNode.class);
- }
-
- // TODO The second start() will fail because customize operations forbidden while there is existing data:
- // "If you want to create a new database system, either remove or empty".
- // I haven't checked whether it damaged the data in the database though!
- @Test(enabled=false, groups={"Integration", "WIP"})
- public void testStopProcessAndStart() throws Exception {
- super.testStopProcessAndStart();
- }
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/software/database/src/test/java/org/apache/brooklyn/entity/database/rubyrep/RubyRepEc2LiveTest.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/software/database/src/test/java/org/apache/brooklyn/entity/database/rubyrep/RubyRepEc2LiveTest.java b/brooklyn-library/software/database/src/test/java/org/apache/brooklyn/entity/database/rubyrep/RubyRepEc2LiveTest.java
deleted file mode 100644
index 8ded942..0000000
--- a/brooklyn-library/software/database/src/test/java/org/apache/brooklyn/entity/database/rubyrep/RubyRepEc2LiveTest.java
+++ /dev/null
@@ -1,73 +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.rubyrep;
-
-import org.apache.brooklyn.api.entity.EntitySpec;
-import org.apache.brooklyn.api.location.Location;
-import org.apache.brooklyn.core.location.PortRanges;
-import org.testng.annotations.Test;
-import org.apache.brooklyn.entity.AbstractEc2LiveTest;
-import org.apache.brooklyn.entity.database.DatastoreMixins.DatastoreCommon;
-import org.apache.brooklyn.entity.database.postgresql.PostgreSqlIntegrationTest;
-import org.apache.brooklyn.entity.database.postgresql.PostgreSqlNode;
-
-public class RubyRepEc2LiveTest extends AbstractEc2LiveTest {
-
- @Override
- protected void doTest(Location loc) throws Exception {
- PostgreSqlNode db1 = app.createAndManageChild(EntitySpec.create(PostgreSqlNode.class)
- .configure(DatastoreCommon.CREATION_SCRIPT_CONTENTS, PostgreSqlIntegrationTest.CREATION_SCRIPT)
- .configure(PostgreSqlNode.POSTGRESQL_PORT, PortRanges.fromInteger(9111)));
-
- PostgreSqlNode db2 = app.createAndManageChild(EntitySpec.create(PostgreSqlNode.class)
- .configure(DatastoreCommon.CREATION_SCRIPT_CONTENTS, PostgreSqlIntegrationTest.CREATION_SCRIPT)
- .configure(PostgreSqlNode.POSTGRESQL_PORT, PortRanges.fromInteger(9111)));
-
- RubyRepIntegrationTest.startInLocation(app, db1, db2, loc);
- RubyRepIntegrationTest.testReplication(db1, db2);
- }
-
- @Override
- @Test(enabled=false, groups = "Live")
- public void test_Debian_6() throws Exception { } // Disabled because PostgreSql 9.1 not available
-
- @Override
- @Test(enabled=false, groups = "Live")
- public void test_Ubuntu_10_0() throws Exception { } // Disabled because PostgreSql 9.1 not available
-
- @Override
- @Test(enabled=false, groups = "Live")
- public void test_Debian_7_2() throws Exception { } // Diabling all except Ubuntu 12.0 temporarily
-
- @Override
- @Test(enabled=false, groups = "Live")
- public void test_CentOS_6_3() throws Exception { } // Diabling all except Ubuntu 12.0 temporarily
-
- @Override
- @Test(enabled=false, groups = "Live")
- public void test_CentOS_5() throws Exception { } // Diabling all except Ubuntu 12.0 temporarily
-
- @Override
- @Test(enabled=false, groups = "Live")
- public void test_Red_Hat_Enterprise_Linux_6() throws Exception { } // Diabling all except Ubuntu 12.0 temporarily
-
- @Test(enabled=false)
- public void testDummy() {} // Convince testng IDE integration that this really does have test methods
-}
-
http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/software/database/src/test/java/org/apache/brooklyn/entity/database/rubyrep/RubyRepIntegrationTest.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/software/database/src/test/java/org/apache/brooklyn/entity/database/rubyrep/RubyRepIntegrationTest.java b/brooklyn-library/software/database/src/test/java/org/apache/brooklyn/entity/database/rubyrep/RubyRepIntegrationTest.java
deleted file mode 100644
index 7127334..0000000
--- a/brooklyn-library/software/database/src/test/java/org/apache/brooklyn/entity/database/rubyrep/RubyRepIntegrationTest.java
+++ /dev/null
@@ -1,470 +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.rubyrep;
-
-import static org.testng.Assert.assertEquals;
-
-import java.util.Arrays;
-import java.util.List;
-
-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.core.entity.Entities;
-import org.apache.brooklyn.core.entity.factory.ApplicationBuilder;
-import org.apache.brooklyn.core.internal.BrooklynProperties;
-import org.apache.brooklyn.core.location.PortRanges;
-import org.apache.brooklyn.core.mgmt.internal.LocalManagementContext;
-import org.apache.brooklyn.core.test.entity.TestApplication;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-import org.apache.brooklyn.entity.database.DatastoreMixins.DatastoreCommon;
-import org.apache.brooklyn.entity.database.VogellaExampleAccess;
-import org.apache.brooklyn.entity.database.mysql.MySqlIntegrationTest;
-import org.apache.brooklyn.entity.database.mysql.MySqlNode;
-import org.apache.brooklyn.entity.database.postgresql.PostgreSqlIntegrationTest;
-import org.apache.brooklyn.entity.database.postgresql.PostgreSqlNode;
-import org.apache.brooklyn.location.localhost.LocalhostMachineProvisioningLocation;
-
-public class RubyRepIntegrationTest {
-
- public static final Logger log = LoggerFactory.getLogger(RubyRepIntegrationTest.class);
- protected BrooklynProperties brooklynProperties;
- protected ManagementContext managementContext;
- protected TestApplication tapp;
-
- @BeforeMethod(alwaysRun = true)
- public void setUp() {
- brooklynProperties = BrooklynProperties.Factory.newDefault();
- managementContext = new LocalManagementContext(brooklynProperties);
- tapp = ApplicationBuilder.newManagedApp(TestApplication.class, managementContext);
- }
-
- @AfterMethod(alwaysRun = true)
- public void tearDown() {
- Entities.destroyAllCatching(managementContext);
- }
-
- /*
- Exception org.apache.brooklyn.util.exceptions.PropagatedRuntimeException
-
- Message: (none)
- Stacktrace:
-
- at org.apache.brooklyn.util.exceptions.Exceptions.propagate(Exceptions.java:103)
- at org.apache.brooklyn.util.core.task.BasicTask.getUnchecked(BasicTask.java:353)
- at org.apache.brooklyn.util.core.task.DynamicTasks$TaskQueueingResult.andWaitForSuccess(DynamicTasks.java:159)
- at org.apache.brooklyn.core.objs.proxy.EntityProxyImpl.invoke(EntityProxyImpl.java:211)
- at com.sun.proxy.$Proxy49.start(Unknown Source)
- at org.apache.brooklyn.entity.database.rubyrep.RubyRepIntegrationTest.startInLocation(RubyRepIntegrationTest.java:139)
- at org.apache.brooklyn.entity.database.rubyrep.RubyRepIntegrationTest.startInLocation(RubyRepIntegrationTest.java:119)
- at org.apache.brooklyn.entity.database.rubyrep.RubyRepIntegrationTest.test_localhost_mysql(RubyRepIntegrationTest.java:80)
- at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
- at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
- at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
- at java.lang.reflect.Method.invoke(Method.java:606)
- at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
- at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
- at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
- at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
- at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
- at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
- at org.testng.TestRunner.privateRun(TestRunner.java:767)
- at org.testng.TestRunner.run(TestRunner.java:617)
- at org.testng.SuiteRunner.runTest(SuiteRunner.java:348)
- at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:343)
- at org.testng.SuiteRunner.privateRun(SuiteRunner.java:305)
- at org.testng.SuiteRunner.run(SuiteRunner.java:254)
- at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
- at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
- at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
- at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
- at org.testng.TestNG.run(TestNG.java:1057)
- at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:115)
- at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeMulti(TestNGDirectoryTestSuite.java:205)
- at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:108)
- at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:111)
- at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
- at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
- at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
- Caused by: java.util.concurrent.ExecutionException: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: Error invoking start at Application[r1CKCG7x]: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: 1 of 3 parallel child tasks failed: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: Error invoking start at RubyRepNodeImpl{id=pePPOzBw}: java.lang.IllegalStateException: Software process entity RubyRepNodeImpl{id=pePPOzBw} did not pass is-running check within the required 2m limit (2m 2s elapsed)
- at java.util.concurrent.FutureTask.report(FutureTask.java:122)
- at java.util.concurrent.FutureTask.get(FutureTask.java:188)
- at com.google.common.util.concurrent.ForwardingFuture.get(ForwardingFuture.java:63)
- at org.apache.brooklyn.util.core.task.BasicTask.get(BasicTask.java:342)
- at org.apache.brooklyn.util.core.task.BasicTask.getUnchecked(BasicTask.java:351)
- ... 34 more
- Caused by: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: Error invoking start at Application[r1CKCG7x]: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: 1 of 3 parallel child tasks failed: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: Error invoking start at RubyRepNodeImpl{id=pePPOzBw}: java.lang.IllegalStateException: Software process entity RubyRepNodeImpl{id=pePPOzBw} did not pass is-running check within the required 2m limit (2m 2s elapsed)
- at org.apache.brooklyn.core.mgmt.internal.EffectorUtils.handleEffectorException(EffectorUtils.java:270)
- at org.apache.brooklyn.core.mgmt.internal.EffectorUtils.invokeMethodEffector(EffectorUtils.java:255)
- at org.apache.brooklyn.core.effector.MethodEffector.call(MethodEffector.java:149)
- at org.apache.brooklyn.core.entity.trait.Startable$StartEffectorBody.call(Startable.java:56)
- at org.apache.brooklyn.core.entity.trait.Startable$StartEffectorBody.call(Startable.java:50)
- at org.apache.brooklyn.core.effector.EffectorTasks$EffectorBodyTaskFactory$1.call(EffectorTasks.java:82)
- at org.apache.brooklyn.util.core.task.DynamicSequentialTask$DstJob.call(DynamicSequentialTask.java:342)
- at org.apache.brooklyn.util.core.task.BasicExecutionManager$SubmissionCallable.call(BasicExecutionManager.java:468)
- at java.util.concurrent.FutureTask.run(FutureTask.java:262)
- at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
- at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
- at java.lang.Thread.run(Thread.java:745)
- Caused by: java.util.concurrent.ExecutionException: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: 1 of 3 parallel child tasks failed: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: Error invoking start at RubyRepNodeImpl{id=pePPOzBw}: java.lang.IllegalStateException: Software process entity RubyRepNodeImpl{id=pePPOzBw} did not pass is-running check within the required 2m limit (2m 2s elapsed)
- at org.apache.brooklyn.core.mgmt.internal.AbstractManagementContext.invokeEffectorMethodSync(AbstractManagementContext.java:332)
- at org.apache.brooklyn.core.mgmt.internal.EffectorUtils.invokeMethodEffector(EffectorUtils.java:250)
- ... 10 more
- Caused by: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: 1 of 3 parallel child tasks failed: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: Error invoking start at RubyRepNodeImpl{id=pePPOzBw}: java.lang.IllegalStateException: Software process entity RubyRepNodeImpl{id=pePPOzBw} did not pass is-running check within the required 2m limit (2m 2s elapsed)
- at org.apache.brooklyn.util.exceptions.Exceptions.propagate(Exceptions.java:103)
- at org.apache.brooklyn.util.core.task.BasicTask.getUnchecked(BasicTask.java:353)
- at org.apache.brooklyn.core.entity.trait.StartableMethods.start(StartableMethods.java:53)
- at org.apache.brooklyn.core.entity.AbstractApplication.doStart(AbstractApplication.java:178)
- at org.apache.brooklyn.core.entity.AbstractApplication.start(AbstractApplication.java:155)
- at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
- at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
- at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
- at java.lang.reflect.Method.invoke(Method.java:606)
- at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
- at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
- at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1085)
- at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909)
- at groovy.lang.DelegatingMetaClass.invokeMethod(DelegatingMetaClass.java:149)
- at groovy.lang.MetaObjectProtocol$invokeMethod.call(Unknown Source)
- at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
- at groovy.lang.MetaObjectProtocol$invokeMethod.call(Unknown Source)
- at org.apache.brooklyn.util.groovy.GroovyJavaMethods.invokeMethodOnMetaClass(GroovyJavaMethods.java:191)
- at org.apache.brooklyn.core.mgmt.internal.AbstractManagementContext.invokeEffectorMethodLocal(AbstractManagementContext.java:304)
- at org.apache.brooklyn.core.mgmt.internal.AbstractManagementContext.invokeEffectorMethodSync(AbstractManagementContext.java:328)
- ... 11 more
- Caused by: java.util.concurrent.ExecutionException: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: 1 of 3 parallel child tasks failed: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: Error invoking start at RubyRepNodeImpl{id=pePPOzBw}: java.lang.IllegalStateException: Software process entity RubyRepNodeImpl{id=pePPOzBw} did not pass is-running check within the required 2m limit (2m 2s elapsed)
- at java.util.concurrent.FutureTask.report(FutureTask.java:122)
- at java.util.concurrent.FutureTask.get(FutureTask.java:188)
- at com.google.common.util.concurrent.ForwardingFuture.get(ForwardingFuture.java:63)
- at org.apache.brooklyn.util.core.task.BasicTask.get(BasicTask.java:342)
- at org.apache.brooklyn.util.core.task.BasicTask.getUnchecked(BasicTask.java:351)
- ... 29 more
- Caused by: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: 1 of 3 parallel child tasks failed: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: Error invoking start at RubyRepNodeImpl{id=pePPOzBw}: java.lang.IllegalStateException: Software process entity RubyRepNodeImpl{id=pePPOzBw} did not pass is-running check within the required 2m limit (2m 2s elapsed)
- at org.apache.brooklyn.util.exceptions.Exceptions.create(Exceptions.java:299)
- at org.apache.brooklyn.util.exceptions.Exceptions.propagate(Exceptions.java:287)
- at org.apache.brooklyn.util.core.task.ParallelTask.runJobs(ParallelTask.java:81)
- at org.apache.brooklyn.util.core.task.CompoundTask$1.call(CompoundTask.java:81)
- at org.apache.brooklyn.util.core.task.CompoundTask$1.call(CompoundTask.java:79)
- ... 5 more
- Caused by: java.util.concurrent.ExecutionException: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: Error invoking start at RubyRepNodeImpl{id=pePPOzBw}: java.lang.IllegalStateException: Software process entity RubyRepNodeImpl{id=pePPOzBw} did not pass is-running check within the required 2m limit (2m 2s elapsed)
- at java.util.concurrent.FutureTask.report(FutureTask.java:122)
- at java.util.concurrent.FutureTask.get(FutureTask.java:188)
- at com.google.common.util.concurrent.ForwardingFuture.get(ForwardingFuture.java:63)
- at org.apache.brooklyn.util.core.task.BasicTask.get(BasicTask.java:342)
- at org.apache.brooklyn.util.core.task.ParallelTask.runJobs(ParallelTask.java:63)
- ... 7 more
- Caused by: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: Error invoking start at RubyRepNodeImpl{id=pePPOzBw}: java.lang.IllegalStateException: Software process entity RubyRepNodeImpl{id=pePPOzBw} did not pass is-running check within the required 2m limit (2m 2s elapsed)
- at org.apache.brooklyn.core.mgmt.internal.EffectorUtils.handleEffectorException(EffectorUtils.java:270)
- at org.apache.brooklyn.core.effector.EffectorTasks$EffectorBodyTaskFactory$2.handleException(EffectorTasks.java:90)
- at org.apache.brooklyn.util.core.task.DynamicSequentialTask.handleException(DynamicSequentialTask.java:452)
- at org.apache.brooklyn.util.core.task.DynamicSequentialTask$DstJob.call(DynamicSequentialTask.java:400)
- ... 5 more
- Caused by: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: java.lang.IllegalStateException: Software process entity RubyRepNodeImpl{id=pePPOzBw} did not pass is-running check within the required 2m limit (2m 2s elapsed)
- at org.apache.brooklyn.util.exceptions.Exceptions.propagate(Exceptions.java:103)
- at org.apache.brooklyn.util.core.task.BasicTask.getUnchecked(BasicTask.java:353)
- at org.apache.brooklyn.util.core.task.DynamicSequentialTask.drain(DynamicSequentialTask.java:475)
- at org.apache.brooklyn.util.core.task.DynamicTasks.drain(DynamicTasks.java:313)
- at org.apache.brooklyn.util.core.task.DynamicTasks.waitForLast(DynamicTasks.java:302)
- at org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks.start(MachineLifecycleEffectorTasks.java:314)
- at org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks$StartEffectorBody.call(MachineLifecycleEffectorTasks.java:214)
- at org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks$StartEffectorBody.call(MachineLifecycleEffectorTasks.java:201)
- at org.apache.brooklyn.core.effector.EffectorTasks$EffectorBodyTaskFactory$1.call(EffectorTasks.java:82)
- at org.apache.brooklyn.util.core.task.DynamicSequentialTask$DstJob.call(DynamicSequentialTask.java:342)
- ... 5 more
- Caused by: java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Software process entity RubyRepNodeImpl{id=pePPOzBw} did not pass is-running check within the required 2m limit (2m 2s elapsed)
- at java.util.concurrent.FutureTask.report(FutureTask.java:122)
- at java.util.concurrent.FutureTask.get(FutureTask.java:188)
- at com.google.common.util.concurrent.ForwardingFuture.get(ForwardingFuture.java:63)
- at org.apache.brooklyn.util.core.task.BasicTask.get(BasicTask.java:342)
- at org.apache.brooklyn.util.core.task.BasicTask.getUnchecked(BasicTask.java:351)
- ... 13 more
- Caused by: java.lang.IllegalStateException: Software process entity RubyRepNodeImpl{id=pePPOzBw} did not pass is-running check within the required 2m limit (2m 2s elapsed)
- at org.apache.brooklyn.entity.software.base.SoftwareProcessImpl.waitForEntityStart(SoftwareProcessImpl.java:592)
- at org.apache.brooklyn.entity.software.base.SoftwareProcessImpl.postDriverStart(SoftwareProcessImpl.java:266)
- at org.apache.brooklyn.entity.software.base.SoftwareProcessDriverLifecycleEffectorTasks.postStartCustom(SoftwareProcessDriverLifecycleEffectorTasks.java:169)
- at org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks$PostStartTask.run(MachineLifecycleEffectorTasks.java:572)
- at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
- ... 6 more
- */
- @Test(groups = {"Integration","Broken"})
- public void test_localhost_mysql() throws Exception {
- MySqlNode db1 = tapp.createAndManageChild(EntitySpec.create(MySqlNode.class)
- .configure(DatastoreCommon.CREATION_SCRIPT_CONTENTS, MySqlIntegrationTest.CREATION_SCRIPT)
- .configure("test.table.name", "COMMENTS")
- .configure(MySqlNode.MYSQL_PORT, PortRanges.fromInteger(9111)));
-
- MySqlNode db2 = tapp.createAndManageChild(EntitySpec.create(MySqlNode.class)
- .configure(DatastoreCommon.CREATION_SCRIPT_CONTENTS, MySqlIntegrationTest.CREATION_SCRIPT)
- .configure("test.table.name", "COMMENTS")
- .configure(MySqlNode.MYSQL_PORT, PortRanges.fromInteger(9112)));
-
-
- startInLocation(tapp, db1, db2, new LocalhostMachineProvisioningLocation());
- testReplication(db1, db2);
- }
-
- /*
- Exception org.apache.brooklyn.util.exceptions.PropagatedRuntimeException
-
- Message: (none)
- Stacktrace:
-
- at org.apache.brooklyn.util.exceptions.Exceptions.propagate(Exceptions.java:103)
- at org.apache.brooklyn.util.core.task.BasicTask.getUnchecked(BasicTask.java:353)
- at org.apache.brooklyn.util.core.task.DynamicTasks$TaskQueueingResult.andWaitForSuccess(DynamicTasks.java:159)
- at org.apache.brooklyn.core.objs.proxy.EntityProxyImpl.invoke(EntityProxyImpl.java:211)
- at com.sun.proxy.$Proxy53.start(Unknown Source)
- at org.apache.brooklyn.entity.database.rubyrep.RubyRepIntegrationTest.startInLocation(RubyRepIntegrationTest.java:139)
- at org.apache.brooklyn.entity.database.rubyrep.RubyRepIntegrationTest.test_localhost_postgres(RubyRepIntegrationTest.java:98)
- at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
- at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
- at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
- at java.lang.reflect.Method.invoke(Method.java:606)
- at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
- at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
- at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
- at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
- at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
- at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
- at org.testng.TestRunner.privateRun(TestRunner.java:767)
- at org.testng.TestRunner.run(TestRunner.java:617)
- at org.testng.SuiteRunner.runTest(SuiteRunner.java:348)
- at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:343)
- at org.testng.SuiteRunner.privateRun(SuiteRunner.java:305)
- at org.testng.SuiteRunner.run(SuiteRunner.java:254)
- at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
- at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
- at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
- at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
- at org.testng.TestNG.run(TestNG.java:1057)
- at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:115)
- at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeMulti(TestNGDirectoryTestSuite.java:205)
- at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:108)
- at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:111)
- at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
- at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
- at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
- Caused by: java.util.concurrent.ExecutionException: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: Error invoking start at Application[OTSda29h]: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: 1 of 2 parallel child tasks failed: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: Error invoking start at RubyRepNodeImpl{id=VhsCCM9k}: java.lang.IllegalStateException: Software process entity RubyRepNodeImpl{id=VhsCCM9k} did not pass is-running check within the required 2m limit (2m 1s elapsed)
- at java.util.concurrent.FutureTask.report(FutureTask.java:122)
- at java.util.concurrent.FutureTask.get(FutureTask.java:188)
- at com.google.common.util.concurrent.ForwardingFuture.get(ForwardingFuture.java:63)
- at org.apache.brooklyn.util.core.task.BasicTask.get(BasicTask.java:342)
- at org.apache.brooklyn.util.core.task.BasicTask.getUnchecked(BasicTask.java:351)
- ... 33 more
- Caused by: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: Error invoking start at Application[OTSda29h]: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: 1 of 2 parallel child tasks failed: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: Error invoking start at RubyRepNodeImpl{id=VhsCCM9k}: java.lang.IllegalStateException: Software process entity RubyRepNodeImpl{id=VhsCCM9k} did not pass is-running check within the required 2m limit (2m 1s elapsed)
- at org.apache.brooklyn.core.mgmt.internal.EffectorUtils.handleEffectorException(EffectorUtils.java:270)
- at org.apache.brooklyn.core.mgmt.internal.EffectorUtils.invokeMethodEffector(EffectorUtils.java:255)
- at org.apache.brooklyn.core.effector.MethodEffector.call(MethodEffector.java:149)
- at org.apache.brooklyn.core.entity.trait.Startable$StartEffectorBody.call(Startable.java:56)
- at org.apache.brooklyn.core.entity.trait.Startable$StartEffectorBody.call(Startable.java:50)
- at org.apache.brooklyn.core.effector.EffectorTasks$EffectorBodyTaskFactory$1.call(EffectorTasks.java:82)
- at org.apache.brooklyn.util.core.task.DynamicSequentialTask$DstJob.call(DynamicSequentialTask.java:342)
- at org.apache.brooklyn.util.core.task.BasicExecutionManager$SubmissionCallable.call(BasicExecutionManager.java:468)
- at java.util.concurrent.FutureTask.run(FutureTask.java:262)
- at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
- at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
- at java.lang.Thread.run(Thread.java:745)
- Caused by: java.util.concurrent.ExecutionException: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: 1 of 2 parallel child tasks failed: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: Error invoking start at RubyRepNodeImpl{id=VhsCCM9k}: java.lang.IllegalStateException: Software process entity RubyRepNodeImpl{id=VhsCCM9k} did not pass is-running check within the required 2m limit (2m 1s elapsed)
- at org.apache.brooklyn.core.mgmt.internal.AbstractManagementContext.invokeEffectorMethodSync(AbstractManagementContext.java:332)
- at org.apache.brooklyn.core.mgmt.internal.EffectorUtils.invokeMethodEffector(EffectorUtils.java:250)
- ... 10 more
- Caused by: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: 1 of 2 parallel child tasks failed: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: Error invoking start at RubyRepNodeImpl{id=VhsCCM9k}: java.lang.IllegalStateException: Software process entity RubyRepNodeImpl{id=VhsCCM9k} did not pass is-running check within the required 2m limit (2m 1s elapsed)
- at org.apache.brooklyn.util.exceptions.Exceptions.propagate(Exceptions.java:103)
- at org.apache.brooklyn.util.core.task.BasicTask.getUnchecked(BasicTask.java:353)
- at org.apache.brooklyn.core.entity.trait.StartableMethods.start(StartableMethods.java:53)
- at org.apache.brooklyn.core.entity.AbstractApplication.doStart(AbstractApplication.java:178)
- at org.apache.brooklyn.core.entity.AbstractApplication.start(AbstractApplication.java:155)
- at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
- at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
- at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
- at java.lang.reflect.Method.invoke(Method.java:606)
- at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
- at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
- at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1085)
- at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909)
- at groovy.lang.DelegatingMetaClass.invokeMethod(DelegatingMetaClass.java:149)
- at groovy.lang.MetaObjectProtocol$invokeMethod.call(Unknown Source)
- at org.apache.brooklyn.util.groovy.GroovyJavaMethods.invokeMethodOnMetaClass(GroovyJavaMethods.java:191)
- at org.apache.brooklyn.core.mgmt.internal.AbstractManagementContext.invokeEffectorMethodLocal(AbstractManagementContext.java:304)
- at org.apache.brooklyn.core.mgmt.internal.AbstractManagementContext.invokeEffectorMethodSync(AbstractManagementContext.java:328)
- ... 11 more
- Caused by: java.util.concurrent.ExecutionException: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: 1 of 2 parallel child tasks failed: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: Error invoking start at RubyRepNodeImpl{id=VhsCCM9k}: java.lang.IllegalStateException: Software process entity RubyRepNodeImpl{id=VhsCCM9k} did not pass is-running check within the required 2m limit (2m 1s elapsed)
- at java.util.concurrent.FutureTask.report(FutureTask.java:122)
- at java.util.concurrent.FutureTask.get(FutureTask.java:188)
- at com.google.common.util.concurrent.ForwardingFuture.get(ForwardingFuture.java:63)
- at org.apache.brooklyn.util.core.task.BasicTask.get(BasicTask.java:342)
- at org.apache.brooklyn.util.core.task.BasicTask.getUnchecked(BasicTask.java:351)
- ... 27 more
- Caused by: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: 1 of 2 parallel child tasks failed: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: Error invoking start at RubyRepNodeImpl{id=VhsCCM9k}: java.lang.IllegalStateException: Software process entity RubyRepNodeImpl{id=VhsCCM9k} did not pass is-running check within the required 2m limit (2m 1s elapsed)
- at org.apache.brooklyn.util.exceptions.Exceptions.create(Exceptions.java:299)
- at org.apache.brooklyn.util.exceptions.Exceptions.propagate(Exceptions.java:287)
- at org.apache.brooklyn.util.core.task.ParallelTask.runJobs(ParallelTask.java:81)
- at org.apache.brooklyn.util.core.task.CompoundTask$1.call(CompoundTask.java:81)
- at org.apache.brooklyn.util.core.task.CompoundTask$1.call(CompoundTask.java:79)
- ... 5 more
- Caused by: java.util.concurrent.ExecutionException: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: Error invoking start at RubyRepNodeImpl{id=VhsCCM9k}: java.lang.IllegalStateException: Software process entity RubyRepNodeImpl{id=VhsCCM9k} did not pass is-running check within the required 2m limit (2m 1s elapsed)
- at java.util.concurrent.FutureTask.report(FutureTask.java:122)
- at java.util.concurrent.FutureTask.get(FutureTask.java:188)
- at com.google.common.util.concurrent.ForwardingFuture.get(ForwardingFuture.java:63)
- at org.apache.brooklyn.util.core.task.BasicTask.get(BasicTask.java:342)
- at org.apache.brooklyn.util.core.task.ParallelTask.runJobs(ParallelTask.java:63)
- ... 7 more
- Caused by: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: Error invoking start at RubyRepNodeImpl{id=VhsCCM9k}: java.lang.IllegalStateException: Software process entity RubyRepNodeImpl{id=VhsCCM9k} did not pass is-running check within the required 2m limit (2m 1s elapsed)
- at org.apache.brooklyn.core.mgmt.internal.EffectorUtils.handleEffectorException(EffectorUtils.java:270)
- at org.apache.brooklyn.core.effector.EffectorTasks$EffectorBodyTaskFactory$2.handleException(EffectorTasks.java:90)
- at org.apache.brooklyn.util.core.task.DynamicSequentialTask.handleException(DynamicSequentialTask.java:452)
- at org.apache.brooklyn.util.core.task.DynamicSequentialTask$DstJob.call(DynamicSequentialTask.java:400)
- ... 5 more
- Caused by: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: java.lang.IllegalStateException: Software process entity RubyRepNodeImpl{id=VhsCCM9k} did not pass is-running check within the required 2m limit (2m 1s elapsed)
- at org.apache.brooklyn.util.exceptions.Exceptions.propagate(Exceptions.java:103)
- at org.apache.brooklyn.util.core.task.BasicTask.getUnchecked(BasicTask.java:353)
- at org.apache.brooklyn.util.core.task.DynamicSequentialTask.drain(DynamicSequentialTask.java:475)
- at org.apache.brooklyn.util.core.task.DynamicTasks.drain(DynamicTasks.java:313)
- at org.apache.brooklyn.util.core.task.DynamicTasks.waitForLast(DynamicTasks.java:302)
- at org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks.start(MachineLifecycleEffectorTasks.java:314)
- at org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks$StartEffectorBody.call(MachineLifecycleEffectorTasks.java:214)
- at org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks$StartEffectorBody.call(MachineLifecycleEffectorTasks.java:201)
- at org.apache.brooklyn.core.effector.EffectorTasks$EffectorBodyTaskFactory$1.call(EffectorTasks.java:82)
- at org.apache.brooklyn.util.core.task.DynamicSequentialTask$DstJob.call(DynamicSequentialTask.java:342)
- ... 5 more
- Caused by: java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Software process entity RubyRepNodeImpl{id=VhsCCM9k} did not pass is-running check within the required 2m limit (2m 1s elapsed)
- at java.util.concurrent.FutureTask.report(FutureTask.java:122)
- at java.util.concurrent.FutureTask.get(FutureTask.java:188)
- at com.google.common.util.concurrent.ForwardingFuture.get(ForwardingFuture.java:63)
- at org.apache.brooklyn.util.core.task.BasicTask.get(BasicTask.java:342)
- at org.apache.brooklyn.util.core.task.BasicTask.getUnchecked(BasicTask.java:351)
- ... 13 more
- Caused by: java.lang.IllegalStateException: Software process entity RubyRepNodeImpl{id=VhsCCM9k} did not pass is-running check within the required 2m limit (2m 1s elapsed)
- at org.apache.brooklyn.entity.software.base.SoftwareProcessImpl.waitForEntityStart(SoftwareProcessImpl.java:592)
- at org.apache.brooklyn.entity.software.base.SoftwareProcessImpl.postDriverStart(SoftwareProcessImpl.java:266)
- at org.apache.brooklyn.entity.software.base.SoftwareProcessDriverLifecycleEffectorTasks.postStartCustom(SoftwareProcessDriverLifecycleEffectorTasks.java:169)
- at org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks$PostStartTask.run(MachineLifecycleEffectorTasks.java:572)
- at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
- ... 6 more
- */
- /**
- * Altered to use a single postgresql server to avoid issues with shared memory limits
- */
- @Test(groups = {"Integration","Broken"})
- public void test_localhost_postgres() throws Exception {
- String createTwoDbsScript = PostgreSqlIntegrationTest.CREATION_SCRIPT +
- PostgreSqlIntegrationTest.CREATION_SCRIPT.replaceAll("CREATE USER.*", "").replaceAll(" feedback", " feedback1");
-
- PostgreSqlNode db1 = tapp.createAndManageChild(EntitySpec.create(PostgreSqlNode.class)
- .configure(DatastoreCommon.CREATION_SCRIPT_CONTENTS, createTwoDbsScript)
- .configure(PostgreSqlNode.POSTGRESQL_PORT, PortRanges.fromInteger(9113))
- .configure(PostgreSqlNode.MAX_CONNECTIONS, 10)
- .configure(PostgreSqlNode.SHARED_MEMORY, "512kB")); // Very low so kernel configuration not needed
-
- startInLocation(tapp, db1, "feedback", db1, "feedback1", new LocalhostMachineProvisioningLocation());
- testReplication(db1, "feedback", db1, "feedback1");
- }
-
- @Test(enabled = false, groups = "Integration") // TODO this doesn't appear to be supported by RubyRep
- public void test_localhost_postgres_mysql() throws Exception {
- PostgreSqlNode db1 = tapp.createAndManageChild(EntitySpec.create(PostgreSqlNode.class)
- .configure(DatastoreCommon.CREATION_SCRIPT_CONTENTS, PostgreSqlIntegrationTest.CREATION_SCRIPT)
- .configure(PostgreSqlNode.POSTGRESQL_PORT, PortRanges.fromInteger(9115))
- .configure(PostgreSqlNode.MAX_CONNECTIONS, 10)
- .configure(PostgreSqlNode.SHARED_MEMORY, "512kB")); // Very low so kernel configuration not needed
-
- MySqlNode db2 = tapp.createAndManageChild(EntitySpec.create(MySqlNode.class)
- .configure(DatastoreCommon.CREATION_SCRIPT_CONTENTS, MySqlIntegrationTest.CREATION_SCRIPT)
- .configure(MySqlNode.MYSQL_PORT, PortRanges.fromInteger(9116)));
-
- startInLocation(tapp, db1, db2, new LocalhostMachineProvisioningLocation());
- testReplication(db1, db2);
- }
-
- public static void startInLocation(TestApplication tapp, DatastoreCommon db1, DatastoreCommon db2, Location... locations) throws Exception {
- startInLocation(tapp, db1, "feedback", db2, "feedback", locations);
- }
-
- /**
- * Configures rubyrep to connect to the two databases and starts the app
- */
- public static void startInLocation(TestApplication tapp, DatastoreCommon db1, String dbName1, DatastoreCommon db2, String dbName2, Location... locations) throws Exception {
- tapp.createAndManageChild(EntitySpec.create(RubyRepNode.class)
- .configure("startupTimeout", 300)
- .configure("leftDatabase", db1)
- .configure("rightDatabase", db2)
- .configure("leftUsername", "sqluser")
- .configure("rightUsername", "sqluser")
- .configure("rightPassword", "sqluserpw")
- .configure("leftPassword", "sqluserpw")
- .configure("leftDatabaseName", dbName1)
- .configure("rightDatabaseName", dbName2)
- .configure("replicationInterval", 1)
- );
-
- tapp.start(Arrays.asList(locations));
- }
-
- public static void testReplication(DatastoreCommon db1, DatastoreCommon db2) throws Exception {
- testReplication(db1, "feedback", db2, "feedback");
- }
-
- /**
- * Tests replication between the two databases by altering the first and checking the change is applied to the second
- */
- public static void testReplication(DatastoreCommon db1, String dbName1, DatastoreCommon db2, String dbName2) throws Exception {
- String db1Url = db1.getAttribute(DatastoreCommon.DATASTORE_URL);
- String db2Url = db2.getAttribute(DatastoreCommon.DATASTORE_URL);
-
- log.info("Testing replication between " + db1Url + " and " + db2Url);
-
- VogellaExampleAccess vea1 = new VogellaExampleAccess(db1 instanceof MySqlNode ? "com.mysql.jdbc.Driver" : "org.postgresql.Driver", db1Url, dbName1);
- VogellaExampleAccess vea2 = new VogellaExampleAccess(db2 instanceof MySqlNode ? "com.mysql.jdbc.Driver" : "org.postgresql.Driver", db2Url, dbName2);
-
- try {
- vea1.connect();
- List<List<String>> rs = vea1.readDataBase();
- assertEquals(rs.size(), 1);
-
- vea2.connect();
- rs = vea2.readDataBase();
- assertEquals(rs.size(), 1);
-
- log.info("Modifying left database");
- vea1.modifyDataBase();
-
- log.info("Reading left database");
- rs = vea1.readDataBase();
- assertEquals(rs.size(), 2);
-
- log.info("Reading right database");
- rs = vea2.readDataBase();
-
- for (int i = 0; i < 60 && rs.size() != 2; i++) {
- log.info("Sleeping for a second");
- Thread.sleep(1000);
- rs = vea2.readDataBase();
- }
-
- assertEquals(rs.size(), 2);
- } finally {
- vea1.close();
- vea2.close();
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/software/database/src/test/java/org/apache/brooklyn/entity/database/rubyrep/RubyRepRackspaceLiveTest.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/software/database/src/test/java/org/apache/brooklyn/entity/database/rubyrep/RubyRepRackspaceLiveTest.java b/brooklyn-library/software/database/src/test/java/org/apache/brooklyn/entity/database/rubyrep/RubyRepRackspaceLiveTest.java
deleted file mode 100644
index f6a77b0..0000000
--- a/brooklyn-library/software/database/src/test/java/org/apache/brooklyn/entity/database/rubyrep/RubyRepRackspaceLiveTest.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.brooklyn.entity.database.rubyrep;
-
-import java.util.Arrays;
-
-import org.apache.brooklyn.api.entity.EntitySpec;
-import org.apache.brooklyn.api.location.Location;
-import org.apache.brooklyn.core.location.PortRanges;
-import org.testng.annotations.Test;
-import org.apache.brooklyn.entity.database.DatastoreMixins.DatastoreCommon;
-import org.apache.brooklyn.entity.database.postgresql.PostgreSqlIntegrationTest;
-import org.apache.brooklyn.entity.database.postgresql.PostgreSqlNode;
-import org.apache.brooklyn.location.ssh.SshMachineLocation;
-import org.apache.brooklyn.util.net.Protocol;
-import org.apache.brooklyn.util.ssh.IptablesCommands;
-import org.apache.brooklyn.util.ssh.IptablesCommands.Chain;
-import org.apache.brooklyn.util.ssh.IptablesCommands.Policy;
-
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableSet;
-
-/**
- * The RubyRepRackspaceLiveTest installs RubyRep on various operating systems like Ubuntu, CentOS, Red Hat etc. To make sure that
- * RubyRep and PostgreSql works like expected on these Operating Systems.
- */
-public class RubyRepRackspaceLiveTest extends RubyRepIntegrationTest {
-
- @Test(groups = "Live")
- public void test_Debian_6() throws Exception {
- test("Debian 6");
- }
-
- @Test(groups = "Live")
- public void test_Ubuntu_10_0() throws Exception {
- test("Ubuntu 10.0");
- }
-
- @Test(groups = "Live")
- public void test_Ubuntu_12_0() throws Exception {
- test("Ubuntu 12.0");
- }
-
- @Test(groups = "Live")
- public void test_Ubuntu_13() throws Exception {
- test("Ubuntu 13");
- }
-
- @Test(groups = "Live")
- public void test_CentOS_6() throws Exception {
- test("CentOS 6");
- }
-
- @Test(groups = "Live")
- public void test_CentOS_5() throws Exception {
- test("CentOS 5");
- }
-
- @Test(groups = "Live")
- public void test_Fedora() throws Exception {
- test("Fedora ");
- }
-
- @Test(groups = "Live")
- public void test_Red_Hat_Enterprise_Linux_6() throws Exception {
- test("Red Hat Enterprise Linux 6");
- }
-
- public void test(String osRegex) throws Exception {
- PostgreSqlNode db1 = tapp.createAndManageChild(EntitySpec.create(PostgreSqlNode.class)
- .configure(DatastoreCommon.CREATION_SCRIPT_CONTENTS, PostgreSqlIntegrationTest.CREATION_SCRIPT)
- .configure(PostgreSqlNode.POSTGRESQL_PORT, PortRanges.fromInteger(9111)));
- PostgreSqlNode db2 = tapp.createAndManageChild(EntitySpec.create(PostgreSqlNode.class)
- .configure(DatastoreCommon.CREATION_SCRIPT_CONTENTS, PostgreSqlIntegrationTest.CREATION_SCRIPT)
- .configure(PostgreSqlNode.POSTGRESQL_PORT, PortRanges.fromInteger(9111)));
-
- brooklynProperties.put("brooklyn.location.jclouds.rackspace-cloudservers-uk.imageNameRegex", osRegex);
- brooklynProperties.remove("brooklyn.location.jclouds.rackspace-cloudservers-uk.image-id");
- brooklynProperties.remove("brooklyn.location.jclouds.rackspace-cloudservers-uk.imageId");
- brooklynProperties.put("brooklyn.location.jclouds.rackspace-cloudservers-uk.inboundPorts", Arrays.asList(22, 9111));
- Location loc = managementContext.getLocationRegistry().resolve("jclouds:rackspace-cloudservers-uk");
-
- startInLocation(tapp, db1, db2, loc);
-
- //hack to get the port for mysql open; is the inbounds property not respected on rackspace??
- for (DatastoreCommon node : ImmutableSet.of(db1, db2)) {
- SshMachineLocation l = (SshMachineLocation) node.getLocations().iterator().next();
- l.execCommands("add iptables rule", ImmutableList.of(IptablesCommands.insertIptablesRule(Chain.INPUT, Protocol.TCP, 9111, Policy.ACCEPT)));
- }
-
- testReplication(db1, db2);
- }
-
- // disable inherited non-live tests
- @Test(enabled = false, groups = "Integration")
- public void test_localhost_mysql() throws Exception {
- super.test_localhost_mysql();
- }
-
- // disable inherited non-live tests
- @Test(enabled = false, groups = "Integration")
- public void test_localhost_postgres() throws Exception {
- super.test_localhost_postgres();
- }
-
- // disable inherited non-live tests
- @Test(enabled = false, groups = "Integration")
- public void test_localhost_postgres_mysql() throws Exception {
- super.test_localhost_postgres_mysql();
- }
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/software/messaging/pom.xml
----------------------------------------------------------------------
diff --git a/brooklyn-library/software/messaging/pom.xml b/brooklyn-library/software/messaging/pom.xml
deleted file mode 100644
index 57b2ff0..0000000
--- a/brooklyn-library/software/messaging/pom.xml
+++ /dev/null
@@ -1,306 +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-software-messaging</artifactId>
- <packaging>jar</packaging>
- <name>Brooklyn Messaging Software Entities</name>
- <description>
- Brooklyn entities for messaging 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>
-
- <repositories>
- <repository>
- <id>clojars.org</id>
- <url>http://clojars.org/repo</url>
- </repository>
- </repositories>
-
- <build>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.rat</groupId>
- <artifactId>apache-rat-plugin</artifactId>
- <configuration>
- <excludes combine.children="append">
- <!--
- Configuration artifacts (for installations) are based on templated defaults for
- the given components. These are files "without any degree of creativity" from the
- perspective of the Brooklyn/Apache contribution.
- -->
- <exclude>src/main/resources/org/apache/brooklyn/entity/messaging/activemq/activemq.xml</exclude>
- <exclude>src/main/resources/org/apache/brooklyn/entity/messaging/kafka/server.properties</exclude>
- <exclude>src/main/resources/org/apache/brooklyn/entity/messaging/kafka/zookeeper.properties</exclude>
- <exclude>src/main/resources/org/apache/brooklyn/entity/messaging/storm/storm.yaml</exclude>
- <exclude>src/main/resources/org/apache/brooklyn/entity/messaging/rabbit/rabbitmq.config</exclude>
- </excludes>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
- </build>
-
- <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-api</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.brooklyn</groupId>
- <artifactId>brooklyn-core</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </dependency>
-
- <!-- test dependencies -->
- <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>
- <dependency>
- <groupId>org.apache.brooklyn</groupId>
- <artifactId>brooklyn-locations-jclouds</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.testng</groupId>
- <artifactId>testng</artifactId>
- <scope>test</scope>
- </dependency>
-
- <!-- for qpid -->
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- <version>${geronimo-jms_1.1_spec.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid-client</artifactId>
- <version>${qpid.version}</version>
- <scope>test</scope>
- </dependency>
-
- <!-- for activemq -->
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>activemq-broker</artifactId>
- <version>${activemq.version}</version>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <!-- for rabbit -->
- <dependency>
- <groupId>com.rabbitmq</groupId>
- <artifactId>amqp-client</artifactId>
- <version>${rabbitmq-version}</version>
- <scope>test</scope>
- </dependency>
-
- <!-- for kafka -->
- <dependency>
- <groupId>org.apache.kafka</groupId>
- <artifactId>kafka-clients</artifactId>
- <version>${kafka.version}</version>
- <scope>test</scope>
- <exclusions>
- <!-- Dependency versions mismatch between transitive dependencies, declare explicitly -->
- <exclusion>
- <groupId>org.apache.zookeeper</groupId>
- <artifactId>zookeeper</artifactId>
- </exclusion>
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <!-- for storm -->
- <dependency>
- <groupId>storm</groupId>
- <artifactId>storm-core</artifactId>
- <version>${storm.version}</version>
- <!-- keep storm out of the jar-with-dependencies -->
- <scope>test</scope>
- <exclusions>
- <!-- Dependency versions mismatch between transitive dependencies, declare explicitly -->
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.clojure</groupId>
- <artifactId>clojure</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.zookeeper</groupId>
- <artifactId>zookeeper</artifactId>
- </exclusion>
- <exclusion>
- <groupId>ring</groupId>
- <artifactId>ring-core</artifactId>
- </exclusion>
- <exclusion>
- <groupId>clj-time</groupId>
- <artifactId>clj-time</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- </exclusion>
- <exclusion>
- <groupId>storm</groupId>
- <artifactId>carbonite</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <!-- Transitive dependencies, declared explicitly due to version mismatch -->
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>${log4j.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <version>${slf4j.version}</version>
- <scope>test</scope>
- <exclusions>
- <!-- Dependency versions mismatch between transitive dependencies, declare explicitly -->
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.clojure</groupId>
- <artifactId>clojure</artifactId>
- <version>${clojure.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.zookeeper</groupId>
- <artifactId>zookeeper</artifactId>
- <version>${zookeeper.version}</version>
- <scope>test</scope>
- <exclusions>
- <!-- Dependency versions mismatch between transitive dependencies, declare explicitly -->
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>ring</groupId>
- <artifactId>ring-core</artifactId>
- <version>${ring-core.version}</version>
- <scope>test</scope>
- <exclusions>
- <!-- Dependency versions mismatch between transitive dependencies, declare explicitly -->
- <exclusion>
- <groupId>org.clojure</groupId>
- <artifactId>clojure</artifactId>
- </exclusion>
- <exclusion>
- <groupId>clj-time</groupId>
- <artifactId>clj-time</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>clj-time</groupId>
- <artifactId>clj-time</artifactId>
- <version>${clj-time.version}</version>
- <scope>test</scope>
- <exclusions>
- <!-- Dependency versions mismatch between transitive dependencies, declare explicitly -->
- <exclusion>
- <groupId>org.clojure</groupId>
- <artifactId>clojure</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- <version>${commons-codec.version}</version>
- </dependency>
- <!-- End of transitive dependencies -->
- </dependencies>
-
-</project>
http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/software/messaging/src/main/java/org/apache/brooklyn/entity/messaging/MessageBroker.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/software/messaging/src/main/java/org/apache/brooklyn/entity/messaging/MessageBroker.java b/brooklyn-library/software/messaging/src/main/java/org/apache/brooklyn/entity/messaging/MessageBroker.java
deleted file mode 100644
index 23260d2..0000000
--- a/brooklyn-library/software/messaging/src/main/java/org/apache/brooklyn/entity/messaging/MessageBroker.java
+++ /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.
- */
-package org.apache.brooklyn.entity.messaging;
-
-import org.apache.brooklyn.api.entity.Entity;
-import org.apache.brooklyn.api.sensor.AttributeSensor;
-import org.apache.brooklyn.core.sensor.Sensors;
-
-/**
- * Marker interface identifying message brokers.
- */
-public interface MessageBroker extends Entity {
- AttributeSensor<String> BROKER_URL = Sensors.newStringSensor("broker.url", "Broker Connection URL");
-
- /** Setup the URL for external connections to the broker. */
- void setBrokerUrl();
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/software/messaging/src/main/java/org/apache/brooklyn/entity/messaging/Queue.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/software/messaging/src/main/java/org/apache/brooklyn/entity/messaging/Queue.java b/brooklyn-library/software/messaging/src/main/java/org/apache/brooklyn/entity/messaging/Queue.java
deleted file mode 100644
index 190d5bf..0000000
--- a/brooklyn-library/software/messaging/src/main/java/org/apache/brooklyn/entity/messaging/Queue.java
+++ /dev/null
@@ -1,50 +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.messaging;
-
-import org.apache.brooklyn.api.sensor.AttributeSensor;
-import org.apache.brooklyn.core.sensor.BasicAttributeSensorAndConfigKey;
-import org.apache.brooklyn.core.sensor.Sensors;
-
-/**
- * An interface that describes a messaging queue.
- */
-public interface Queue {
- BasicAttributeSensorAndConfigKey<String> QUEUE_NAME = new BasicAttributeSensorAndConfigKey<String>(String.class, "queue.name", "Queue name");
-
- AttributeSensor<Integer> QUEUE_DEPTH_BYTES = Sensors.newIntegerSensor("queue.depth.bytes", "Queue depth in bytes");
- AttributeSensor<Integer> QUEUE_DEPTH_MESSAGES = Sensors.newIntegerSensor("queue.depth.messages", "Queue depth in messages");
-
- /**
- * Create the queue.
- *
- * TODO make this an effector
- */
- abstract void create();
-
- /**
- * Delete the queue.
- *
- * TODO make this an effector
- */
- abstract void delete();
-
- String getQueueName();
-
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/software/messaging/src/main/java/org/apache/brooklyn/entity/messaging/Topic.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/software/messaging/src/main/java/org/apache/brooklyn/entity/messaging/Topic.java b/brooklyn-library/software/messaging/src/main/java/org/apache/brooklyn/entity/messaging/Topic.java
deleted file mode 100644
index c4ed3b7..0000000
--- a/brooklyn-library/software/messaging/src/main/java/org/apache/brooklyn/entity/messaging/Topic.java
+++ /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.
- */
-package org.apache.brooklyn.entity.messaging;
-
-import org.apache.brooklyn.core.sensor.BasicAttributeSensorAndConfigKey;
-
-/**
- * An interface that describes a messaging topic.
- */
-public interface Topic {
- BasicAttributeSensorAndConfigKey<String> TOPIC_NAME = new BasicAttributeSensorAndConfigKey<String>(
- String.class, "topic.name", "Topic name");
-
- /**
- * Create the topic.
- *
- * TODO make this an effector
- */
- public abstract void create();
-
- /**
- * Delete the topic.
- *
- * TODO make this an effector
- */
- public abstract void delete();
-
- String getTopicName();
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/software/messaging/src/main/java/org/apache/brooklyn/entity/messaging/activemq/ActiveMQBroker.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/software/messaging/src/main/java/org/apache/brooklyn/entity/messaging/activemq/ActiveMQBroker.java b/brooklyn-library/software/messaging/src/main/java/org/apache/brooklyn/entity/messaging/activemq/ActiveMQBroker.java
deleted file mode 100644
index aa79613..0000000
--- a/brooklyn-library/software/messaging/src/main/java/org/apache/brooklyn/entity/messaging/activemq/ActiveMQBroker.java
+++ /dev/null
@@ -1,80 +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.messaging.activemq;
-
-import org.apache.brooklyn.api.catalog.Catalog;
-import org.apache.brooklyn.api.entity.ImplementedBy;
-import org.apache.brooklyn.config.ConfigKey;
-import org.apache.brooklyn.core.config.BasicConfigKey;
-import org.apache.brooklyn.core.config.ConfigKeys;
-import org.apache.brooklyn.core.entity.Attributes;
-import org.apache.brooklyn.core.sensor.AttributeSensorAndConfigKey;
-import org.apache.brooklyn.core.sensor.BasicAttributeSensorAndConfigKey;
-import org.apache.brooklyn.core.sensor.PortAttributeSensorAndConfigKey;
-import org.apache.brooklyn.core.sensor.BasicAttributeSensorAndConfigKey.StringAttributeSensorAndConfigKey;
-import org.apache.brooklyn.entity.java.UsesJmx;
-import org.apache.brooklyn.entity.messaging.MessageBroker;
-import org.apache.brooklyn.entity.messaging.jms.JMSBroker;
-import org.apache.brooklyn.entity.software.base.SoftwareProcess;
-import org.apache.brooklyn.util.core.flags.SetFromFlag;
-import org.apache.brooklyn.util.time.Duration;
-/**
- * An {@link org.apache.brooklyn.api.entity.Entity} that represents a single ActiveMQ broker instance.
- */
-@Catalog(name="ActiveMQ Broker", description="ActiveMQ is an open source message broker which fully implements the Java Message Service 1.1 (JMS)", iconUrl="classpath:///activemq-logo.png")
-@ImplementedBy(ActiveMQBrokerImpl.class)
-public interface ActiveMQBroker extends SoftwareProcess, MessageBroker, UsesJmx, JMSBroker<ActiveMQQueue, ActiveMQTopic> {
-
- @SetFromFlag("startTimeout")
- ConfigKey<Duration> START_TIMEOUT = SoftwareProcess.START_TIMEOUT;
-
- @SetFromFlag("version")
- public static final ConfigKey<String> SUGGESTED_VERSION = ConfigKeys.newConfigKeyWithDefault(SoftwareProcess.SUGGESTED_VERSION, "5.10.2");
-
- @SetFromFlag("downloadUrl")
- public static final AttributeSensorAndConfigKey<String,String> DOWNLOAD_URL = new StringAttributeSensorAndConfigKey(
- Attributes.DOWNLOAD_URL, "${driver.mirrorUrl}/${version}/apache-activemq-${version}-bin.tar.gz");
-
- /** download mirror, if desired */
- @SetFromFlag("mirrorUrl")
- public static final BasicConfigKey<String> MIRROR_URL = new BasicConfigKey<String>(String.class, "activemq.install.mirror.url", "URL of mirror",
- "http://www.mirrorservice.org/sites/ftp.apache.org/activemq");
-
- @SetFromFlag("brokerName")
- public static final AttributeSensorAndConfigKey<String,String> BROKER_NAME =
- ConfigKeys.newStringSensorAndConfigKey("activemq.brokerName", "ActiveMQ Broker Name", "localhost");
-
- @SetFromFlag("openWirePort")
- public static final PortAttributeSensorAndConfigKey OPEN_WIRE_PORT = new PortAttributeSensorAndConfigKey("openwire.port", "OpenWire port", "61616+");
-
- @SetFromFlag("jettyPort")
- public static final PortAttributeSensorAndConfigKey AMQ_JETTY_PORT = new PortAttributeSensorAndConfigKey("activemq.jetty.port", "jetty port", "8161+");
-
- @SetFromFlag("jmxUser")
- public static final BasicAttributeSensorAndConfigKey<String> JMX_USER = new BasicAttributeSensorAndConfigKey<String>(UsesJmx.JMX_USER, "admin");
-
- @SetFromFlag("jmxPassword")
- public static final BasicAttributeSensorAndConfigKey<String> JMX_PASSWORD = new BasicAttributeSensorAndConfigKey<String>(UsesJmx.JMX_PASSWORD, "admin");
-
- @SetFromFlag("templateConfigurationUrl")
- public static final BasicAttributeSensorAndConfigKey<String> TEMPLATE_CONFIGURATION_URL = new BasicAttributeSensorAndConfigKey<String>(
- String.class, "activemq.templateConfigurationUrl", "Template file (in freemarker format) for the conf/activemq.xml file",
- "classpath://org/apache/brooklyn/entity/messaging/activemq/activemq.xml");
-
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/software/messaging/src/main/java/org/apache/brooklyn/entity/messaging/activemq/ActiveMQBrokerImpl.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/software/messaging/src/main/java/org/apache/brooklyn/entity/messaging/activemq/ActiveMQBrokerImpl.java b/brooklyn-library/software/messaging/src/main/java/org/apache/brooklyn/entity/messaging/activemq/ActiveMQBrokerImpl.java
deleted file mode 100644
index 6954e81..0000000
--- a/brooklyn-library/software/messaging/src/main/java/org/apache/brooklyn/entity/messaging/activemq/ActiveMQBrokerImpl.java
+++ /dev/null
@@ -1,121 +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.messaging.activemq;
-
-import java.util.Map;
-import java.util.concurrent.TimeUnit;
-
-import org.apache.brooklyn.api.entity.EntitySpec;
-import org.apache.brooklyn.core.entity.Entities;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.brooklyn.entity.java.UsesJmx;
-import org.apache.brooklyn.entity.messaging.jms.JMSBrokerImpl;
-import org.apache.brooklyn.feed.jmx.JmxAttributePollConfig;
-import org.apache.brooklyn.feed.jmx.JmxFeed;
-
-import com.google.common.base.Functions;
-import com.google.common.base.Objects.ToStringHelper;
-import com.google.common.base.Predicates;
-/**
- * An {@link org.apache.brooklyn.api.entity.Entity} that represents a single ActiveMQ broker instance.
- */
-public class ActiveMQBrokerImpl extends JMSBrokerImpl<ActiveMQQueue, ActiveMQTopic> implements ActiveMQBroker {
- private static final Logger log = LoggerFactory.getLogger(ActiveMQBrokerImpl.class);
-
- private volatile JmxFeed jmxFeed;
-
- public ActiveMQBrokerImpl() {
- super();
- }
-
- @Override
- public void init() {
- super.init();
- Entities.getRequiredUrlConfig(this, TEMPLATE_CONFIGURATION_URL);
- }
-
- public void setBrokerUrl() {
- sensors().set(BROKER_URL, String.format("tcp://%s:%d", getAttribute(HOSTNAME), getAttribute(OPEN_WIRE_PORT)));
- }
-
- public Integer getJmxPort() {
- return !isJmxEnabled() ? Integer.valueOf(-1) : getAttribute(UsesJmx.JMX_PORT);
- }
-
- public String getBrokerName() {
- return getAttribute(BROKER_NAME);
- }
-
- public Integer getOpenWirePort() {
- return getAttribute(OPEN_WIRE_PORT);
- }
-
- public boolean isJmxEnabled() {
- return Boolean.TRUE.equals(getConfig(USE_JMX));
- }
-
- @Override
- public ActiveMQQueue createQueue(Map properties) {
- ActiveMQQueue result = addChild(EntitySpec.create(ActiveMQQueue.class).configure(properties));
- result.create();
- return result;
- }
-
- @Override
- public ActiveMQTopic createTopic(Map properties) {
- ActiveMQTopic result = addChild(EntitySpec.create(ActiveMQTopic.class).configure(properties));
- result.create();
- return result;
- }
-
- @Override
- protected void connectSensors() {
- sensors().set(BROKER_URL, String.format("tcp://%s:%d", getAttribute(HOSTNAME), getAttribute(OPEN_WIRE_PORT)));
-
- String brokerMbeanName = "org.apache.activemq:type=Broker,brokerName=" + getBrokerName();
-
- jmxFeed = JmxFeed.builder()
- .entity(this)
- .period(500, TimeUnit.MILLISECONDS)
- .pollAttribute(new JmxAttributePollConfig<Boolean>(SERVICE_UP)
- .objectName(brokerMbeanName)
- .attributeName("BrokerName")
- .onSuccess(Functions.forPredicate(Predicates.notNull()))
- .onFailureOrException(Functions.constant(false))
- .suppressDuplicates(true))
- .build();
- }
-
- @Override
- public void disconnectSensors() {
- super.disconnectSensors();
- if (jmxFeed != null) jmxFeed.stop();
- }
-
- @Override
- protected ToStringHelper toStringHelper() {
- return super.toStringHelper().add("openWirePort", getAttribute(OPEN_WIRE_PORT));
- }
-
- @Override
- public Class getDriverInterface() {
- return ActiveMQDriver.class;
- }
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/software/messaging/src/main/java/org/apache/brooklyn/entity/messaging/activemq/ActiveMQDestination.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/software/messaging/src/main/java/org/apache/brooklyn/entity/messaging/activemq/ActiveMQDestination.java b/brooklyn-library/software/messaging/src/main/java/org/apache/brooklyn/entity/messaging/activemq/ActiveMQDestination.java
deleted file mode 100644
index c941ac1..0000000
--- a/brooklyn-library/software/messaging/src/main/java/org/apache/brooklyn/entity/messaging/activemq/ActiveMQDestination.java
+++ /dev/null
@@ -1,24 +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.messaging.activemq;
-
-import org.apache.brooklyn.entity.messaging.jms.JMSDestination;
-
-public interface ActiveMQDestination extends JMSDestination {
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/02abbab0/brooklyn-library/software/messaging/src/main/java/org/apache/brooklyn/entity/messaging/activemq/ActiveMQDestinationImpl.java
----------------------------------------------------------------------
diff --git a/brooklyn-library/software/messaging/src/main/java/org/apache/brooklyn/entity/messaging/activemq/ActiveMQDestinationImpl.java b/brooklyn-library/software/messaging/src/main/java/org/apache/brooklyn/entity/messaging/activemq/ActiveMQDestinationImpl.java
deleted file mode 100644
index 6a27030..0000000
--- a/brooklyn-library/software/messaging/src/main/java/org/apache/brooklyn/entity/messaging/activemq/ActiveMQDestinationImpl.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.brooklyn.entity.messaging.activemq;
-
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
-
-import org.apache.brooklyn.api.entity.Entity;
-import org.apache.brooklyn.api.entity.EntityLocal;
-
-import com.google.common.base.Preconditions;
-
-import org.apache.brooklyn.entity.messaging.jms.JMSDestinationImpl;
-import org.apache.brooklyn.feed.jmx.JmxFeed;
-import org.apache.brooklyn.feed.jmx.JmxHelper;
-import org.apache.brooklyn.util.exceptions.Exceptions;
-
-public abstract class ActiveMQDestinationImpl extends JMSDestinationImpl implements ActiveMQDestination {
- protected ObjectName brokerMBeanName;
- protected transient JmxHelper jmxHelper;
- protected volatile JmxFeed jmxFeed;
-
- public ActiveMQDestinationImpl() {
- }
-
- @Override
- public void onManagementStarting() {
- super.onManagementStarting();
-
- String brokerName = getBrokerName();
- Preconditions.checkArgument(brokerName != null && !brokerName.isEmpty(), "ActiveMQ brokerName attribute must be specified");
-
- try {
- brokerMBeanName = new ObjectName("org.apache.activemq:type=Broker,brokerName=" + brokerName);
- jmxHelper = new JmxHelper((EntityLocal) getParent());
- } catch (MalformedObjectNameException e) {
- throw Exceptions.propagate(e);
- }
- }
-
- @Override
- protected void disconnectSensors() {
- if (jmxFeed != null) jmxFeed.stop();
- }
-
- protected String getBrokerName() {
- Preconditions.checkNotNull(getParent(), "JMS Destination must have a broker parent");
- return getParent().getAttribute(ActiveMQBroker.BROKER_NAME);
- }
-}