brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henev...@apache.org
Subject [11/22] incubator-brooklyn git commit: Switch OSGi more entites sayHI effector to include version info
Date Mon, 09 Feb 2015 15:36:30 GMT
Switch OSGi more entites sayHI effector to include version info

as per @aledsage's suggestion


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

Branch: refs/heads/master
Commit: 26811b9ae4f6e7102e30743998bf8be31ae9464a
Parents: 07aaa89
Author: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Authored: Thu Feb 5 18:36:15 2015 +0000
Committer: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Committed: Fri Feb 6 22:12:13 2015 +0000

----------------------------------------------------------------------
 .../osgi/tests/more/MoreEntityImpl.java         |   2 +-
 .../osgi/tests/more/MoreEntityImpl.java         |   2 +-
 .../osgi/tests/more/MoreEntityImpl.java         |   2 +-
 .../rebind/ActivePartialRebindVersionTest.java  |  15 ++++++---------
 .../osgi/OsgiVersionMoreEntityTest.java         |  16 ++++++++++------
 .../brooklyn-test-osgi-more-entities_0.1.0.jar  | Bin 12452 -> 12428 bytes
 .../brooklyn-test-osgi-more-entities_0.2.0.jar  | Bin 12615 -> 12590 bytes
 ...-test-osgi-more-entities_evil-twin_0.2.0.jar | Bin 12757 -> 12729 bytes
 8 files changed, 19 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/26811b9a/core/src/test/dependencies/osgi/more-entities-v1/src/main/java/brooklyn/osgi/tests/more/MoreEntityImpl.java
----------------------------------------------------------------------
diff --git a/core/src/test/dependencies/osgi/more-entities-v1/src/main/java/brooklyn/osgi/tests/more/MoreEntityImpl.java
b/core/src/test/dependencies/osgi/more-entities-v1/src/main/java/brooklyn/osgi/tests/more/MoreEntityImpl.java
index 5eb1de5..80d6b97 100644
--- a/core/src/test/dependencies/osgi/more-entities-v1/src/main/java/brooklyn/osgi/tests/more/MoreEntityImpl.java
+++ b/core/src/test/dependencies/osgi/more-entities-v1/src/main/java/brooklyn/osgi/tests/more/MoreEntityImpl.java
@@ -38,7 +38,7 @@ public class MoreEntityImpl extends AbstractEntity implements MoreEntity
{
     
     @Override
     public String sayHI(String name) {
-        return "Hi "+name.toUpperCase();
+        return "Hi "+name.toUpperCase()+" from V1";
     }
     
 }

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/26811b9a/core/src/test/dependencies/osgi/more-entities-v2-evil-twin/src/main/java/brooklyn/osgi/tests/more/MoreEntityImpl.java
----------------------------------------------------------------------
diff --git a/core/src/test/dependencies/osgi/more-entities-v2-evil-twin/src/main/java/brooklyn/osgi/tests/more/MoreEntityImpl.java
b/core/src/test/dependencies/osgi/more-entities-v2-evil-twin/src/main/java/brooklyn/osgi/tests/more/MoreEntityImpl.java
index 2788b8b..6200787 100644
--- a/core/src/test/dependencies/osgi/more-entities-v2-evil-twin/src/main/java/brooklyn/osgi/tests/more/MoreEntityImpl.java
+++ b/core/src/test/dependencies/osgi/more-entities-v2-evil-twin/src/main/java/brooklyn/osgi/tests/more/MoreEntityImpl.java
@@ -41,7 +41,7 @@ public class MoreEntityImpl extends AbstractEntity implements MoreEntity
{
     
     /** Returns HO instead of HI (like v2 non-evil twin) or Hi (like v1) */
     public String sayHI(String name) {
-        return "HO "+name.toUpperCase();
+        return "HO "+name.toUpperCase()+" FROM V2 EVIL TWIN";
     }
     
 }

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/26811b9a/core/src/test/dependencies/osgi/more-entities-v2/src/main/java/brooklyn/osgi/tests/more/MoreEntityImpl.java
----------------------------------------------------------------------
diff --git a/core/src/test/dependencies/osgi/more-entities-v2/src/main/java/brooklyn/osgi/tests/more/MoreEntityImpl.java
b/core/src/test/dependencies/osgi/more-entities-v2/src/main/java/brooklyn/osgi/tests/more/MoreEntityImpl.java
index 355c43a..a3952cf 100644
--- a/core/src/test/dependencies/osgi/more-entities-v2/src/main/java/brooklyn/osgi/tests/more/MoreEntityImpl.java
+++ b/core/src/test/dependencies/osgi/more-entities-v2/src/main/java/brooklyn/osgi/tests/more/MoreEntityImpl.java
@@ -41,7 +41,7 @@ public class MoreEntityImpl extends AbstractEntity implements MoreEntity
{
     
     /** Unlike v1, this returns "HI " rather than "Hi " */
     public String sayHI(String name) {
-        return "HI "+name.toUpperCase();
+        return "HI "+name.toUpperCase()+" FROM V2";
     }
     
 }

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/26811b9a/core/src/test/java/brooklyn/entity/rebind/ActivePartialRebindVersionTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/brooklyn/entity/rebind/ActivePartialRebindVersionTest.java
b/core/src/test/java/brooklyn/entity/rebind/ActivePartialRebindVersionTest.java
index 46c1bb6..b239f1a 100644
--- a/core/src/test/java/brooklyn/entity/rebind/ActivePartialRebindVersionTest.java
+++ b/core/src/test/java/brooklyn/entity/rebind/ActivePartialRebindVersionTest.java
@@ -54,16 +54,13 @@ public class ActivePartialRebindVersionTest extends RebindTestFixtureWithApp
{
         CatalogItem<?, ?> catV1 = OsgiVersionMoreEntityTest.addMoreEntityV1(origManagementContext,
"1.0");
         Entity childV1 = OsgiVersionMoreEntityTest.addItemFromCatalog(origManagementContext,
origApp, catV1);
         
-        // v1 says Hi Brooklyn
-        // v2 says HI Brooklyn
-        
-        Assert.assertEquals(OsgiVersionMoreEntityTest.doEffectorCallBrooklyn(childV1), "Hi
BROOKLYN");
+        OsgiVersionMoreEntityTest.assertV1EffectorCall(childV1);
         
         // simply adding to catalog doesn't change
         CatalogItem<?, ?> catV2 = OsgiVersionMoreEntityTest.addMoreEntityV2(origManagementContext,
"1.1");
-        Assert.assertEquals(OsgiVersionMoreEntityTest.doEffectorCallBrooklyn(childV1), "Hi
BROOKLYN");
+        OsgiVersionMoreEntityTest.assertV1EffectorCall(childV1);
         Entity child2V2 = OsgiVersionMoreEntityTest.addItemFromCatalog(origManagementContext,
origApp, catV2);
-        Assert.assertEquals(OsgiVersionMoreEntityTest.doEffectorCallBrooklyn(child2V2), "HI
BROOKLYN");
+        OsgiVersionMoreEntityTest.assertV2EffectorCall(child2V2);
         
         // now transform, with a version change
         CompoundTransformer transformer = CompoundTransformer.builder().changeCatalogItemId(
@@ -72,12 +69,12 @@ public class ActivePartialRebindVersionTest extends RebindTestFixtureWithApp
{
         doPartialRebindByObjectById(transformer, childV1.getId());
 
         Entity childV2 = origManagementContext.lookup(childV1.getId(), Entity.class);
-        Assert.assertEquals(OsgiVersionMoreEntityTest.doEffectorCallBrooklyn(childV2), "HI
BROOKLYN");
+        OsgiVersionMoreEntityTest.assertV2EffectorCall(childV2);
         
         // _v1_ child also points to new implementation -- saying HI
-        Assert.assertEquals(OsgiVersionMoreEntityTest.doEffectorCallBrooklyn(childV1), "HI
BROOKLYN");
+        OsgiVersionMoreEntityTest.assertV2EffectorCall(childV1);
 
-        // in fact they are the same
+        // (in fact they are the same)
         Assert.assertTrue(childV1==childV2, "Expected same instance: "+childV1+" / "+childV2);
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/26811b9a/core/src/test/java/brooklyn/management/osgi/OsgiVersionMoreEntityTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/brooklyn/management/osgi/OsgiVersionMoreEntityTest.java b/core/src/test/java/brooklyn/management/osgi/OsgiVersionMoreEntityTest.java
index b4a3511..7bec58f 100644
--- a/core/src/test/java/brooklyn/management/osgi/OsgiVersionMoreEntityTest.java
+++ b/core/src/test/java/brooklyn/management/osgi/OsgiVersionMoreEntityTest.java
@@ -77,6 +77,10 @@ public class OsgiVersionMoreEntityTest {
     public static final String BROOKLYN_TEST_MORE_ENTITIES_V2_EVIL_TWIN_URL = "classpath:"+BROOKLYN_TEST_MORE_ENTITIES_V2_EVIL_TWIN_PATH;
     
     public static final String TEST_VERSION = "0.1.0";
+
+    public static final String EXPECTED_SAY_HI_BROOKLYN_RESPONSE_FROM_V1 = "Hi BROOKLYN from
V1";
+    public static final String EXPECTED_SAY_HI_BROOKLYN_RESPONSE_FROM_V2 = "HI BROOKLYN FROM
V2";
+    public static final String EXPECTED_SAY_HI_BROOKLYN_RESPONSE_FROM_V2_EVIL_TWIN = "HO
BROOKLYN FROM V2 EVIL TWIN";
     
     protected LocalManagementContext mgmt;
     protected TestApplication app;
@@ -172,13 +176,13 @@ public class OsgiVersionMoreEntityTest {
     }
 
     public static void assertV1MethodCall(Entity me) throws IllegalAccessException, InvocationTargetException,
NoSuchMethodException {
-        Assert.assertEquals(doMethodCallBrooklyn(me), "Hi BROOKLYN");
+        Assert.assertEquals(doMethodCallBrooklyn(me), EXPECTED_SAY_HI_BROOKLYN_RESPONSE_FROM_V1);
     }
     public static void assertV2MethodCall(Entity me) throws IllegalAccessException, InvocationTargetException,
NoSuchMethodException {
-        Assert.assertEquals(doMethodCallBrooklyn(me), "HI BROOKLYN");
+        Assert.assertEquals(doMethodCallBrooklyn(me), EXPECTED_SAY_HI_BROOKLYN_RESPONSE_FROM_V2);
     }
     public static void assertV2EvilTwinMethodCall(Entity me) throws IllegalAccessException,
InvocationTargetException, NoSuchMethodException {
-        Assert.assertEquals(doMethodCallBrooklyn(me), "HO BROOKLYN");
+        Assert.assertEquals(doMethodCallBrooklyn(me), EXPECTED_SAY_HI_BROOKLYN_RESPONSE_FROM_V2_EVIL_TWIN);
     }
 
     public static Object doMethodCallBrooklyn(Entity me) throws IllegalAccessException, InvocationTargetException,
NoSuchMethodException {
@@ -186,13 +190,13 @@ public class OsgiVersionMoreEntityTest {
     }
 
     public static void assertV1EffectorCall(Entity me) {
-        Assert.assertEquals(doEffectorCallBrooklyn(me), "Hi BROOKLYN");
+        Assert.assertEquals(doEffectorCallBrooklyn(me), EXPECTED_SAY_HI_BROOKLYN_RESPONSE_FROM_V1);
     }
     public static void assertV2EffectorCall(Entity me) {
-        Assert.assertEquals(doEffectorCallBrooklyn(me), "HI BROOKLYN");
+        Assert.assertEquals(doEffectorCallBrooklyn(me), EXPECTED_SAY_HI_BROOKLYN_RESPONSE_FROM_V2);
     }
     public static void assertV2EvilTwinEffectorCall(Entity me) {
-        Assert.assertEquals(doEffectorCallBrooklyn(me), "HO BROOKLYN");
+        Assert.assertEquals(doEffectorCallBrooklyn(me), EXPECTED_SAY_HI_BROOKLYN_RESPONSE_FROM_V2_EVIL_TWIN);
     }
 
     public static String doEffectorCallBrooklyn(Entity me) {

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/26811b9a/core/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.1.0.jar
----------------------------------------------------------------------
diff --git a/core/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.1.0.jar
b/core/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.1.0.jar
index a71f428..9958cf1 100644
Binary files a/core/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.1.0.jar
and b/core/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.1.0.jar differ

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/26811b9a/core/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.2.0.jar
----------------------------------------------------------------------
diff --git a/core/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.2.0.jar
b/core/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.2.0.jar
index c75c092..1567f6e 100644
Binary files a/core/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.2.0.jar
and b/core/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.2.0.jar differ

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/26811b9a/core/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_evil-twin_0.2.0.jar
----------------------------------------------------------------------
diff --git a/core/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_evil-twin_0.2.0.jar
b/core/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_evil-twin_0.2.0.jar
index 2d52340..1cd12b1 100644
Binary files a/core/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_evil-twin_0.2.0.jar
and b/core/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_evil-twin_0.2.0.jar
differ


Mime
View raw message