brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henev...@apache.org
Subject [18/21] incubator-brooklyn git commit: Moved TestEntiy to its own package
Date Wed, 11 Nov 2015 17:21:45 GMT
Moved TestEntiy to its own package


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/840482fa
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/840482fa
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/840482fa

Branch: refs/heads/master
Commit: 840482faf80501c47605fc33c0ecae17a3ad3031
Parents: a3e253d
Author: Mark McKenna <m4rkmckenna@gmail.com>
Authored: Wed Nov 11 15:14:46 2015 +0000
Committer: Mark McKenna <m4rkmckenna@gmail.com>
Committed: Wed Nov 11 15:14:46 2015 +0000

----------------------------------------------------------------------
 .../test/framework/TestEffectorTest.java        |  1 +
 .../brooklyn/test/framework/TestEntity.java     | 55 --------------------
 .../brooklyn/test/framework/TestEntityImpl.java | 39 --------------
 .../test/framework/entity/TestEntity.java       | 55 ++++++++++++++++++++
 .../test/framework/entity/TestEntityImpl.java   | 40 ++++++++++++++
 5 files changed, 96 insertions(+), 94 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/840482fa/usage/test-framework/src/test/java/org/apache/brooklyn/test/framework/TestEffectorTest.java
----------------------------------------------------------------------
diff --git a/usage/test-framework/src/test/java/org/apache/brooklyn/test/framework/TestEffectorTest.java
b/usage/test-framework/src/test/java/org/apache/brooklyn/test/framework/TestEffectorTest.java
index b43c76b..65c7aa0 100644
--- a/usage/test-framework/src/test/java/org/apache/brooklyn/test/framework/TestEffectorTest.java
+++ b/usage/test-framework/src/test/java/org/apache/brooklyn/test/framework/TestEffectorTest.java
@@ -8,6 +8,7 @@ import org.apache.brooklyn.api.mgmt.ManagementContext;
 import org.apache.brooklyn.core.entity.Entities;
 import org.apache.brooklyn.core.test.entity.TestApplication;
 import org.apache.brooklyn.location.localhost.LocalhostMachineProvisioningLocation;
+import org.apache.brooklyn.test.framework.entity.TestEntity;
 import org.testng.annotations.AfterMethod;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/840482fa/usage/test-framework/src/test/java/org/apache/brooklyn/test/framework/TestEntity.java
----------------------------------------------------------------------
diff --git a/usage/test-framework/src/test/java/org/apache/brooklyn/test/framework/TestEntity.java
b/usage/test-framework/src/test/java/org/apache/brooklyn/test/framework/TestEntity.java
deleted file mode 100644
index 933b227..0000000
--- a/usage/test-framework/src/test/java/org/apache/brooklyn/test/framework/TestEntity.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package org.apache.brooklyn.test.framework;
-
-import org.apache.brooklyn.api.entity.Entity;
-import org.apache.brooklyn.api.entity.ImplementedBy;
-import org.apache.brooklyn.core.annotation.Effector;
-import org.apache.brooklyn.core.annotation.EffectorParam;
-import org.apache.brooklyn.core.config.ConfigKeys;
-import org.apache.brooklyn.core.entity.trait.Startable;
-import org.apache.brooklyn.core.sensor.AttributeSensorAndConfigKey;
-
-/**
- * @author m4rkmckenna on 27/10/2015.
- */
-
-@ImplementedBy(TestEntityImpl.class)
-public interface TestEntity extends Entity, Startable {
-
-    AttributeSensorAndConfigKey<Boolean, Boolean> SIMPLE_EFFECTOR_INVOKED = ConfigKeys.newSensorAndConfigKey(Boolean.class,
"simple-effector-invoked", "");
-    AttributeSensorAndConfigKey<Boolean, Boolean> COMPLEX_EFFECTOR_INVOKED = ConfigKeys.newSensorAndConfigKey(Boolean.class,
"complex-effector-invoked", "");
-    AttributeSensorAndConfigKey<String, String> COMPLEX_EFFECTOR_STRING = ConfigKeys.newSensorAndConfigKey(String.class,
"complex-effector-string", "");
-    AttributeSensorAndConfigKey<Boolean, Boolean> COMPLEX_EFFECTOR_BOOLEAN = ConfigKeys.newSensorAndConfigKey(Boolean.class,
"complex-effector-boolean", "");
-    AttributeSensorAndConfigKey<Long, Long> COMPLEX_EFFECTOR_LONG = ConfigKeys.newSensorAndConfigKey(Long.class,
"complex-effector-long", "");
-
-    @Effector
-    void simpleEffector();
-
-    @Effector
-    TestPojo complexEffector(@EffectorParam(name = "stringValue") final String stringValue,
-                             @EffectorParam(name = "booleanValue") final Boolean booleanValue,
-                             @EffectorParam(name = "longValue") final Long longValue);
-
-    class TestPojo {
-        private final String stringValue;
-        private final Boolean booleanValue;
-        private final Long longValue;
-
-        public TestPojo(final String stringValue, final Boolean booleanValue, final Long
longValue) {
-            this.stringValue = stringValue;
-            this.booleanValue = booleanValue;
-            this.longValue = longValue;
-        }
-
-        public String getStringValue() {
-            return stringValue;
-        }
-
-        public Boolean getBooleanValue() {
-            return booleanValue;
-        }
-
-        public Long getLongValue() {
-            return longValue;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/840482fa/usage/test-framework/src/test/java/org/apache/brooklyn/test/framework/TestEntityImpl.java
----------------------------------------------------------------------
diff --git a/usage/test-framework/src/test/java/org/apache/brooklyn/test/framework/TestEntityImpl.java
b/usage/test-framework/src/test/java/org/apache/brooklyn/test/framework/TestEntityImpl.java
deleted file mode 100644
index b3386f2..0000000
--- a/usage/test-framework/src/test/java/org/apache/brooklyn/test/framework/TestEntityImpl.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package org.apache.brooklyn.test.framework;
-
-import org.apache.brooklyn.api.location.Location;
-import org.apache.brooklyn.core.annotation.EffectorParam;
-import org.apache.brooklyn.core.entity.AbstractEntity;
-
-import java.util.Collection;
-
-/**
- * @author m4rkmckenna on 27/10/2015.
- */
-public class TestEntityImpl extends AbstractEntity implements TestEntity {
-    @Override
-    public void start(final Collection<? extends Location> locations) {
-    }
-
-    @Override
-    public void stop() {
-
-    }
-
-    @Override
-    public void restart() {
-    }
-
-    @Override
-    public void simpleEffector() {
-        sensors().set(SIMPLE_EFFECTOR_INVOKED, Boolean.TRUE);
-    }
-
-    @Override
-    public TestPojo complexEffector(@EffectorParam(name = "stringValue") final String stringValue,
@EffectorParam(name = "booleanValue") final Boolean booleanValue, @EffectorParam(name = "longValue")
final Long longValue) {
-        sensors().set(COMPLEX_EFFECTOR_INVOKED, Boolean.TRUE);
-        sensors().set(COMPLEX_EFFECTOR_STRING, stringValue);
-        sensors().set(COMPLEX_EFFECTOR_BOOLEAN, booleanValue);
-        sensors().set(COMPLEX_EFFECTOR_LONG, longValue);
-        return new TestPojo(stringValue, booleanValue, longValue);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/840482fa/usage/test-framework/src/test/java/org/apache/brooklyn/test/framework/entity/TestEntity.java
----------------------------------------------------------------------
diff --git a/usage/test-framework/src/test/java/org/apache/brooklyn/test/framework/entity/TestEntity.java
b/usage/test-framework/src/test/java/org/apache/brooklyn/test/framework/entity/TestEntity.java
new file mode 100644
index 0000000..a9a6fc0
--- /dev/null
+++ b/usage/test-framework/src/test/java/org/apache/brooklyn/test/framework/entity/TestEntity.java
@@ -0,0 +1,55 @@
+package org.apache.brooklyn.test.framework.entity;
+
+import org.apache.brooklyn.api.entity.Entity;
+import org.apache.brooklyn.api.entity.ImplementedBy;
+import org.apache.brooklyn.core.annotation.Effector;
+import org.apache.brooklyn.core.annotation.EffectorParam;
+import org.apache.brooklyn.core.config.ConfigKeys;
+import org.apache.brooklyn.core.entity.trait.Startable;
+import org.apache.brooklyn.core.sensor.AttributeSensorAndConfigKey;
+
+/**
+ * @author m4rkmckenna on 27/10/2015.
+ */
+
+@ImplementedBy(TestEntityImpl.class)
+public interface TestEntity extends Entity, Startable {
+
+    AttributeSensorAndConfigKey<Boolean, Boolean> SIMPLE_EFFECTOR_INVOKED = ConfigKeys.newSensorAndConfigKey(Boolean.class,
"simple-effector-invoked", "");
+    AttributeSensorAndConfigKey<Boolean, Boolean> COMPLEX_EFFECTOR_INVOKED = ConfigKeys.newSensorAndConfigKey(Boolean.class,
"complex-effector-invoked", "");
+    AttributeSensorAndConfigKey<String, String> COMPLEX_EFFECTOR_STRING = ConfigKeys.newSensorAndConfigKey(String.class,
"complex-effector-string", "");
+    AttributeSensorAndConfigKey<Boolean, Boolean> COMPLEX_EFFECTOR_BOOLEAN = ConfigKeys.newSensorAndConfigKey(Boolean.class,
"complex-effector-boolean", "");
+    AttributeSensorAndConfigKey<Long, Long> COMPLEX_EFFECTOR_LONG = ConfigKeys.newSensorAndConfigKey(Long.class,
"complex-effector-long", "");
+
+    @Effector
+    void simpleEffector();
+
+    @Effector
+    TestPojo complexEffector(@EffectorParam(name = "stringValue") final String stringValue,
+                             @EffectorParam(name = "booleanValue") final Boolean booleanValue,
+                             @EffectorParam(name = "longValue") final Long longValue);
+
+    class TestPojo {
+        private final String stringValue;
+        private final Boolean booleanValue;
+        private final Long longValue;
+
+        public TestPojo(final String stringValue, final Boolean booleanValue, final Long
longValue) {
+            this.stringValue = stringValue;
+            this.booleanValue = booleanValue;
+            this.longValue = longValue;
+        }
+
+        public String getStringValue() {
+            return stringValue;
+        }
+
+        public Boolean getBooleanValue() {
+            return booleanValue;
+        }
+
+        public Long getLongValue() {
+            return longValue;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/840482fa/usage/test-framework/src/test/java/org/apache/brooklyn/test/framework/entity/TestEntityImpl.java
----------------------------------------------------------------------
diff --git a/usage/test-framework/src/test/java/org/apache/brooklyn/test/framework/entity/TestEntityImpl.java
b/usage/test-framework/src/test/java/org/apache/brooklyn/test/framework/entity/TestEntityImpl.java
new file mode 100644
index 0000000..5c81a7b
--- /dev/null
+++ b/usage/test-framework/src/test/java/org/apache/brooklyn/test/framework/entity/TestEntityImpl.java
@@ -0,0 +1,40 @@
+package org.apache.brooklyn.test.framework.entity;
+
+import org.apache.brooklyn.api.location.Location;
+import org.apache.brooklyn.core.annotation.EffectorParam;
+import org.apache.brooklyn.core.entity.AbstractEntity;
+import org.apache.brooklyn.test.framework.entity.TestEntity;
+
+import java.util.Collection;
+
+/**
+ * @author m4rkmckenna on 27/10/2015.
+ */
+public class TestEntityImpl extends AbstractEntity implements TestEntity {
+    @Override
+    public void start(final Collection<? extends Location> locations) {
+    }
+
+    @Override
+    public void stop() {
+
+    }
+
+    @Override
+    public void restart() {
+    }
+
+    @Override
+    public void simpleEffector() {
+        sensors().set(SIMPLE_EFFECTOR_INVOKED, Boolean.TRUE);
+    }
+
+    @Override
+    public TestPojo complexEffector(@EffectorParam(name = "stringValue") final String stringValue,
@EffectorParam(name = "booleanValue") final Boolean booleanValue, @EffectorParam(name = "longValue")
final Long longValue) {
+        sensors().set(COMPLEX_EFFECTOR_INVOKED, Boolean.TRUE);
+        sensors().set(COMPLEX_EFFECTOR_STRING, stringValue);
+        sensors().set(COMPLEX_EFFECTOR_BOOLEAN, booleanValue);
+        sensors().set(COMPLEX_EFFECTOR_LONG, longValue);
+        return new TestPojo(stringValue, booleanValue, longValue);
+    }
+}


Mime
View raw message