You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by ri...@apache.org on 2014/12/12 13:06:16 UTC
[1/7] incubator-brooklyn git commit: add test dependency needed to
build (even though there are no tests)
Repository: incubator-brooklyn
Updated Branches:
refs/heads/master 6c46ac438 -> 67d05d6d9
add test dependency needed to build (even though there are no tests)
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/c631d0ac
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/c631d0ac
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/c631d0ac
Branch: refs/heads/master
Commit: c631d0ace42d954855c51ca720f5115300e37118
Parents: 6c46ac4
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Authored: Fri Dec 12 11:14:54 2014 +0000
Committer: Alex Heneveld <al...@cloudsoftcorp.com>
Committed: Fri Dec 12 11:14:54 2014 +0000
----------------------------------------------------------------------
api/pom.xml | 6 ++++++
1 file changed, 6 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c631d0ac/api/pom.xml
----------------------------------------------------------------------
diff --git a/api/pom.xml b/api/pom.xml
index 55c60b0..6ffb988 100644
--- a/api/pom.xml
+++ b/api/pom.xml
@@ -53,6 +53,12 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.apache.brooklyn</groupId>
+ <artifactId>brooklyn-utils-test-support</artifactId>
+ <scope>test</scope>
+ <version>${project.version}</version>
+ </dependency>
</dependencies>
</project>
[4/7] incubator-brooklyn git commit: fix failing test where location
sensor is added;
also fix caps of that new sensor, and remove warnings in the tests
Posted by ri...@apache.org.
fix failing test where location sensor is added; also fix caps of that new sensor, and remove warnings in the tests
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/6dfe0997
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/6dfe0997
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/6dfe0997
Branch: refs/heads/master
Commit: 6dfe0997260055335f34c6848eaad8dbe597324f
Parents: eacfe13
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Authored: Fri Dec 12 11:48:09 2014 +0000
Committer: Alex Heneveld <al...@cloudsoftcorp.com>
Committed: Fri Dec 12 11:48:09 2014 +0000
----------------------------------------------------------------------
.../brooklyn/entity/basic/AbstractEntity.java | 4 +-
.../brooklyn/event/basic/BasicSensorEvent.java | 18 +++++++
.../brooklyn/entity/basic/EntityTypeTest.java | 54 ++++++++++----------
3 files changed, 46 insertions(+), 30 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/6dfe0997/core/src/main/java/brooklyn/entity/basic/AbstractEntity.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/brooklyn/entity/basic/AbstractEntity.java b/core/src/main/java/brooklyn/entity/basic/AbstractEntity.java
index 9b0399b..6a64cb0 100644
--- a/core/src/main/java/brooklyn/entity/basic/AbstractEntity.java
+++ b/core/src/main/java/brooklyn/entity/basic/AbstractEntity.java
@@ -146,9 +146,9 @@ public abstract class AbstractEntity extends AbstractBrooklynObject implements E
static { BrooklynLanguageExtensions.init(); }
public static final BasicNotificationSensor<Location> LOCATION_ADDED = new BasicNotificationSensor<Location>(
- Location.class, "entity.Location.added", "Location dynamically added to entity");
+ Location.class, "entity.location.added", "Location dynamically added to entity");
public static final BasicNotificationSensor<Location> LOCATION_REMOVED = new BasicNotificationSensor<Location>(
- Location.class, "entity.Location.removed", "Location dynamically removed from entity");
+ Location.class, "entity.location.removed", "Location dynamically removed from entity");
public static final BasicNotificationSensor<Sensor> SENSOR_ADDED = new BasicNotificationSensor<Sensor>(Sensor.class,
"entity.sensor.added", "Sensor dynamically added to entity");
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/6dfe0997/core/src/main/java/brooklyn/event/basic/BasicSensorEvent.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/brooklyn/event/basic/BasicSensorEvent.java b/core/src/main/java/brooklyn/event/basic/BasicSensorEvent.java
index 3f09ffe..da912a8 100644
--- a/core/src/main/java/brooklyn/event/basic/BasicSensorEvent.java
+++ b/core/src/main/java/brooklyn/event/basic/BasicSensorEvent.java
@@ -65,6 +65,24 @@ public class BasicSensorEvent<T> implements SensorEvent<T> {
this.timestamp = System.currentTimeMillis();
}
}
+
+ public static <T> SensorEvent<T> of(Sensor<T> sensor, Entity source, T value, long timestamp) {
+ return new BasicSensorEvent<T>(sensor, source, value, timestamp);
+ }
+
+ @SuppressWarnings("unchecked")
+ public static <T> SensorEvent<T> ofUnchecked(Sensor<T> sensor, Entity source, Object value, long timestamp) {
+ return new BasicSensorEvent<T>(sensor, source, (T)value, timestamp);
+ }
+
+ public static <T> SensorEvent<T> of(Sensor<T> sensor, Entity source, T value) {
+ return new BasicSensorEvent<T>(sensor, source, value);
+ }
+
+ @SuppressWarnings("unchecked")
+ public static <T> SensorEvent<T> ofUnchecked(Sensor<T> sensor, Entity source, Object value) {
+ return new BasicSensorEvent<T>(sensor, source, (T)value);
+ }
@Override
public int hashCode() {
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/6dfe0997/core/src/test/java/brooklyn/entity/basic/EntityTypeTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/brooklyn/entity/basic/EntityTypeTest.java b/core/src/test/java/brooklyn/entity/basic/EntityTypeTest.java
index 6dd5693..67113fe 100644
--- a/core/src/test/java/brooklyn/entity/basic/EntityTypeTest.java
+++ b/core/src/test/java/brooklyn/entity/basic/EntityTypeTest.java
@@ -23,6 +23,8 @@ import static brooklyn.entity.basic.AbstractEntity.CHILD_REMOVED;
import static brooklyn.entity.basic.AbstractEntity.EFFECTOR_ADDED;
import static brooklyn.entity.basic.AbstractEntity.EFFECTOR_CHANGED;
import static brooklyn.entity.basic.AbstractEntity.EFFECTOR_REMOVED;
+import static brooklyn.entity.basic.AbstractEntity.LOCATION_ADDED;
+import static brooklyn.entity.basic.AbstractEntity.LOCATION_REMOVED;
import static brooklyn.entity.basic.AbstractEntity.POLICY_ADDED;
import static brooklyn.entity.basic.AbstractEntity.POLICY_REMOVED;
import static brooklyn.entity.basic.AbstractEntity.SENSOR_ADDED;
@@ -33,6 +35,7 @@ import static org.testng.Assert.assertNotNull;
import static org.testng.Assert.assertNull;
import static org.testng.Assert.assertTrue;
+import java.util.List;
import java.util.Set;
import javax.annotation.Nullable;
@@ -48,7 +51,7 @@ import brooklyn.event.AttributeSensor;
import brooklyn.event.Sensor;
import brooklyn.event.basic.BasicSensorEvent;
import brooklyn.event.basic.Sensors;
-import brooklyn.test.TestUtils;
+import brooklyn.test.Asserts;
import brooklyn.test.entity.TestEntity;
import brooklyn.test.entity.TestEntityImpl;
import brooklyn.util.collections.CollectionFunctionals;
@@ -70,7 +73,8 @@ public class EntityTypeTest extends BrooklynAppUnitTestSupport {
SENSOR_ADDED, SENSOR_REMOVED,
EFFECTOR_ADDED, EFFECTOR_REMOVED, EFFECTOR_CHANGED,
POLICY_ADDED, POLICY_REMOVED,
- CHILD_ADDED, CHILD_REMOVED);
+ CHILD_ADDED, CHILD_REMOVED,
+ LOCATION_ADDED, LOCATION_REMOVED);
public static class EmptyEntityForTesting extends AbstractEntity {}
@@ -79,9 +83,6 @@ public class EntityTypeTest extends BrooklynAppUnitTestSupport {
public void setUp() throws Exception{
super.setUp();
entity = (EntityInternal) app.createAndManageChild(EntitySpec.create(Entity.class, EmptyEntityForTesting.class));
-// entity = new AbstractEntity(app) {};
-// Entities.startManagement(entity);
-
listener = new EntitySubscriptionTest.RecordingSensorEventListener();
app.getSubscriptionContext().subscribe(entity, SENSOR_ADDED, listener);
app.getSubscriptionContext().subscribe(entity, SENSOR_REMOVED, listener);
@@ -133,8 +134,8 @@ public class EntityTypeTest extends BrooklynAppUnitTestSupport {
@Test
public void testGetEffectorDeprecated() throws Exception {
TestEntity entity2 = app.createAndManageChild(EntitySpec.create(TestEntity.class));
- Effector<?> effector = entity2.getEntityType().getEffector("myEffector");
- Effector<?> effector2 = entity2.getEntityType().getEffector("identityEffector", Object.class);
+ Effector<?> effector = entity2.getEntityType().getEffectorByName("myEffector").get();
+ Effector<?> effector2 = entity2.getEntityType().getEffectorByName("identityEffector").get();
assertEquals(effector.getName(), "myEffector");
assertEquals(effector2.getName(), "identityEffector");
}
@@ -143,6 +144,7 @@ public class EntityTypeTest extends BrooklynAppUnitTestSupport {
public void testCustomSimpleName() throws Exception {
class CustomTypeNamedEntity extends AbstractEntity {
private final String typeName;
+ @SuppressWarnings("deprecation")
CustomTypeNamedEntity(Entity parent, String typeName) {
super(parent);
this.typeName = typeName;
@@ -170,15 +172,20 @@ public class EntityTypeTest extends BrooklynAppUnitTestSupport {
assertEquals(entity.getEntityType().getSensors(), DEFAULT_SENSORS);
}
+ @SuppressWarnings("unchecked")
+ protected <T> void assertEventuallyListenerEventsEqual(List<T> sensorEvents) {
+ Asserts.eventually(
+ Suppliers.ofInstance((List<T>)listener.events),
+ Predicates.equalTo(sensorEvents));
+ }
+
@Test
public void testAddSensors() throws Exception{
entity.getMutableEntityType().addSensor(TEST_SENSOR);
assertEquals(entity.getEntityType().getSensors(),
ImmutableSet.builder().addAll(DEFAULT_SENSORS).add(TEST_SENSOR).build());
- TestUtils.assertEventually(
- Suppliers.ofInstance(listener.events),
- Predicates.equalTo(ImmutableList.of(new BasicSensorEvent(SENSOR_ADDED, entity, TEST_SENSOR))));
+ assertEventuallyListenerEventsEqual(ImmutableList.of(BasicSensorEvent.ofUnchecked(SENSOR_ADDED, entity, TEST_SENSOR)));
}
@Test
@@ -187,9 +194,7 @@ public class EntityTypeTest extends BrooklynAppUnitTestSupport {
assertEquals(entity.getEntityType().getSensors(),
ImmutableSet.builder().addAll(DEFAULT_SENSORS).add(TEST_SENSOR).build());
- TestUtils.assertEventually(
- Suppliers.ofInstance(listener.events),
- Predicates.equalTo(ImmutableList.of(new BasicSensorEvent(SENSOR_ADDED, entity, TEST_SENSOR))));
+ assertEventuallyListenerEventsEqual(ImmutableList.of(BasicSensorEvent.ofUnchecked(SENSOR_ADDED, entity, TEST_SENSOR)));
}
@Test
@@ -199,11 +204,8 @@ public class EntityTypeTest extends BrooklynAppUnitTestSupport {
assertFalse(entity.getEntityType().getSensors().contains(TEST_SENSOR), "sensors="+entity.getEntityType().getSensors());
assertEquals(entity.getAttribute(TEST_SENSOR), null);
- TestUtils.assertEventually(
- Suppliers.ofInstance(listener.events),
- Predicates.equalTo(ImmutableList.of(
- new BasicSensorEvent(SENSOR_ADDED, entity, TEST_SENSOR),
- new BasicSensorEvent(SENSOR_REMOVED, entity, TEST_SENSOR))));
+ assertEventuallyListenerEventsEqual(ImmutableList.of(BasicSensorEvent.ofUnchecked(SENSOR_ADDED, entity, TEST_SENSOR),
+ BasicSensorEvent.ofUnchecked(SENSOR_REMOVED, entity, TEST_SENSOR)));
}
@Test
@@ -212,9 +214,8 @@ public class EntityTypeTest extends BrooklynAppUnitTestSupport {
assertEquals(entity.getEntityType().getSensors(),
MutableSet.builder().addAll(DEFAULT_SENSORS).remove(SENSOR_ADDED).build().asUnmodifiable());
- TestUtils.assertEventually(
- Suppliers.ofInstance(listener.events),
- Predicates.equalTo(ImmutableList.of(new BasicSensorEvent(SENSOR_REMOVED, entity, SENSOR_ADDED))));
+ assertEventuallyListenerEventsEqual(ImmutableList.of(
+ BasicSensorEvent.ofUnchecked(SENSOR_REMOVED, entity, SENSOR_ADDED)));
}
@Test
@@ -224,15 +225,12 @@ public class EntityTypeTest extends BrooklynAppUnitTestSupport {
assertEquals(entity.getEntityType().getSensors(),
MutableSet.builder().addAll(DEFAULT_SENSORS).remove(SENSOR_ADDED).remove(POLICY_ADDED).build().asUnmodifiable());
- TestUtils.assertEventually(
+ Asserts.eventually(
CollectionFunctionals.sizeSupplier(listener.events),
Predicates.equalTo(2));
- TestUtils.assertEventually(
- Suppliers.ofInstance(listener.events),
- CollectionFunctionals.equalsSetOf(
- new BasicSensorEvent(SENSOR_REMOVED, entity, SENSOR_ADDED),
- new BasicSensorEvent(SENSOR_REMOVED, entity, POLICY_ADDED)
- ));
+ assertEventuallyListenerEventsEqual(ImmutableList.of(
+ BasicSensorEvent.ofUnchecked(SENSOR_REMOVED, entity, SENSOR_ADDED),
+ BasicSensorEvent.ofUnchecked(SENSOR_REMOVED, entity, POLICY_ADDED)));
}
@Test
[2/7] incubator-brooklyn git commit: remove duplicate dependencies
(causes warnings in maven build)
Posted by ri...@apache.org.
remove duplicate dependencies (causes warnings in maven build)
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/eacfe137
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/eacfe137
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/eacfe137
Branch: refs/heads/master
Commit: eacfe137d91491657fa4fd76d526b576ec5cfd14
Parents: c631d0a
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Authored: Fri Dec 12 11:21:44 2014 +0000
Committer: Alex Heneveld <al...@cloudsoftcorp.com>
Committed: Fri Dec 12 11:21:44 2014 +0000
----------------------------------------------------------------------
camp/camp-server/pom.xml | 6 ------
usage/launcher/pom.xml | 4 ----
2 files changed, 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/eacfe137/camp/camp-server/pom.xml
----------------------------------------------------------------------
diff --git a/camp/camp-server/pom.xml b/camp/camp-server/pom.xml
index 6e6ee72..45c4117 100644
--- a/camp/camp-server/pom.xml
+++ b/camp/camp-server/pom.xml
@@ -57,12 +57,6 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.apache.brooklyn</groupId>
- <artifactId>brooklyn-utils-test-support</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<scope>test</scope>
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/eacfe137/usage/launcher/pom.xml
----------------------------------------------------------------------
diff --git a/usage/launcher/pom.xml b/usage/launcher/pom.xml
index d105375..16a5bbf 100644
--- a/usage/launcher/pom.xml
+++ b/usage/launcher/pom.xml
@@ -117,10 +117,6 @@
<artifactId>javax.servlet</artifactId>
</dependency>
<dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.framework</artifactId>
- </dependency>
- <dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</dependency>
[7/7] incubator-brooklyn git commit: Merge and close #387
Posted by ri...@apache.org.
Merge and close #387
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/67d05d6d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/67d05d6d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/67d05d6d
Branch: refs/heads/master
Commit: 67d05d6d9f71572b804506c5d3b8e9c434a21ed0
Parents: ffe6c34 6dfe099
Author: Richard Downer <ri...@apache.org>
Authored: Fri Dec 12 11:56:41 2014 +0000
Committer: Richard Downer <ri...@apache.org>
Committed: Fri Dec 12 11:56:41 2014 +0000
----------------------------------------------------------------------
.../brooklyn/entity/basic/AbstractEntity.java | 4 +-
.../brooklyn/event/basic/BasicSensorEvent.java | 18 +++++++
.../brooklyn/entity/basic/EntityTypeTest.java | 54 ++++++++++----------
3 files changed, 46 insertions(+), 30 deletions(-)
----------------------------------------------------------------------
[3/7] incubator-brooklyn git commit: Adds instructions to enable HTTPS
Posted by ri...@apache.org.
Adds instructions to enable HTTPS
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/53855c60
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/53855c60
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/53855c60
Branch: refs/heads/master
Commit: 53855c608405e6bd605b0ba0e01f4a41d460c41a
Parents: 39935ba
Author: Martin Harris <gi...@nakomis.com>
Authored: Fri Dec 12 11:22:30 2014 +0000
Committer: Martin Harris <gi...@nakomis.com>
Committed: Fri Dec 12 11:22:30 2014 +0000
----------------------------------------------------------------------
docs/use/guide/management/index.md | 26 +++++++++++++++++++++++++-
1 file changed, 25 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/53855c60/docs/use/guide/management/index.md
----------------------------------------------------------------------
diff --git a/docs/use/guide/management/index.md b/docs/use/guide/management/index.md
index 64afa9b..0fff39c 100644
--- a/docs/use/guide/management/index.md
+++ b/docs/use/guide/management/index.md
@@ -207,7 +207,31 @@ If not using the web console, you can specify
During dev/test you can specify `brooklyn.webconsole.security.provider=brooklyn.rest.security.provider.AnyoneSecurityProvider`
to allow logins with no credentials.
-
+To enable https, you will need a server certificate in a java keystore. To create a self-signed certificate, you can use the
+following command:
+
+`keytool -genkey -keyalg RSA -alias brooklyn -keystore <path-to-keystore-directory>/server.key -storepass mypassword -validity 360 -keysize 2048`
+
+You will then be prompted to enter you name and organization details. This will create a keystore with the password `mypassword`
+- you should use your own secure password, which will be the same password used in your brooklyn.properties (below).
+You will also need to replace `<path-to-keystore-directory>` with the full path of the folder where you wish to store your
+keystore.
+
+The certificate generated will be a self-signed certificate and will not have a CN field identifying the website server
+name, which will cause a warning to be displayed by the browser when viewing the page. For production servers, a valid signed
+certificate from a trusted certifying authority should be used instead
+
+To enable HTTPS in Brooklyn, add the following to your brooklyn.properties:
+
+```
+# HTTPS
+brooklyn.webconsole.security.https.required=true
+brooklyn.webconsole.security.keystore.url=<path-to-keystore-directory>/server.key
+brooklyn.webconsole.security.keystore.password=mypassword
+brooklyn.webconsole.security.keystore.certificate.alias=brooklyn
+```
+
+In order to access the Brooklyn console, you will also need to enable security, and setup a user as described above
<a name="observation-other"></a>
Other Ways to Observe Activity
[5/7] incubator-brooklyn git commit: Merge and close #385
Posted by ri...@apache.org.
Merge and close #385
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/9f17729b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/9f17729b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/9f17729b
Branch: refs/heads/master
Commit: 9f17729bf81d8e284d29f83a890ec42bc60a729f
Parents: 6c46ac4 53855c6
Author: Richard Downer <ri...@apache.org>
Authored: Fri Dec 12 11:56:31 2014 +0000
Committer: Richard Downer <ri...@apache.org>
Committed: Fri Dec 12 11:56:31 2014 +0000
----------------------------------------------------------------------
docs/use/guide/management/index.md | 26 +++++++++++++++++++++++++-
1 file changed, 25 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
[6/7] incubator-brooklyn git commit: Merge and close #386
Posted by ri...@apache.org.
Merge and close #386
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/ffe6c34a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/ffe6c34a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/ffe6c34a
Branch: refs/heads/master
Commit: ffe6c34a5cb672f25222ac411dbd56c3ddf2053d
Parents: 9f17729 eacfe13
Author: Richard Downer <ri...@apache.org>
Authored: Fri Dec 12 11:56:36 2014 +0000
Committer: Richard Downer <ri...@apache.org>
Committed: Fri Dec 12 11:56:36 2014 +0000
----------------------------------------------------------------------
api/pom.xml | 6 ++++++
camp/camp-server/pom.xml | 6 ------
usage/launcher/pom.xml | 4 ----
3 files changed, 6 insertions(+), 10 deletions(-)
----------------------------------------------------------------------