brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andreatu...@apache.org
Subject [1/2] git commit: Refactors tests to work around IntelliJ IDEA build issues
Date Wed, 17 Sep 2014 07:51:13 GMT
Repository: incubator-brooklyn
Updated Branches:
  refs/heads/master 76d8ef4a8 -> bf78f563c


Refactors tests to work around IntelliJ IDEA build issues


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

Branch: refs/heads/master
Commit: 3c68339ba914511bfbc128823006dcaabdcd2270
Parents: 76d8ef4
Author: Martin Harris <github@nakomis.com>
Authored: Tue Sep 16 17:27:27 2014 +0100
Committer: Martin Harris <github@nakomis.com>
Committed: Tue Sep 16 17:27:27 2014 +0100

----------------------------------------------------------------------
 .../test/java/brooklyn/entity/hello/LocalEntitiesTest.java    | 2 +-
 .../entity/proxy/nginx/NginxUrlMappingIntegrationTest.java    | 2 +-
 .../src/test/java/brooklyn/util/guava/IfFunctionsTest.java    | 7 +++++--
 3 files changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/3c68339b/core/src/test/java/brooklyn/entity/hello/LocalEntitiesTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/brooklyn/entity/hello/LocalEntitiesTest.java b/core/src/test/java/brooklyn/entity/hello/LocalEntitiesTest.java
index 3a35595..0a0adc3 100644
--- a/core/src/test/java/brooklyn/entity/hello/LocalEntitiesTest.java
+++ b/core/src/test/java/brooklyn/entity/hello/LocalEntitiesTest.java
@@ -266,7 +266,7 @@ public class LocalEntitiesTest extends BrooklynAppUnitTestSupport {
         app.setConfig(HelloEntity.MY_NAME, "Bob");
         
         HelloEntity dad = app.createAndManageChild(EntitySpec.create(HelloEntity.class));
-        HelloEntity son = entityManager.createEntity(EntitySpec.create(HelloEntity.class)
+        HelloEntity son = (HelloEntity)entityManager.createEntity(EntitySpec.create(HelloEntity.class)
                 .parent(dad)
                 .configure(HelloEntity.MY_NAME, transform(attributeWhenReady(dad, HelloEntity.FAVOURITE_NAME,
(Closure)null), new Function<String,String>() {
                     public String apply(String input) {

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/3c68339b/software/webapp/src/test/java/brooklyn/entity/proxy/nginx/NginxUrlMappingIntegrationTest.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/test/java/brooklyn/entity/proxy/nginx/NginxUrlMappingIntegrationTest.java
b/software/webapp/src/test/java/brooklyn/entity/proxy/nginx/NginxUrlMappingIntegrationTest.java
index d6918a5..aa7abc2 100644
--- a/software/webapp/src/test/java/brooklyn/entity/proxy/nginx/NginxUrlMappingIntegrationTest.java
+++ b/software/webapp/src/test/java/brooklyn/entity/proxy/nginx/NginxUrlMappingIntegrationTest.java
@@ -417,7 +417,7 @@ public class NginxUrlMappingIntegrationTest extends BrooklynAppLiveTestSupport
{
         c1.resize(2);
         List c1jbosses = new ArrayList(c1.getMembers());
         c1jbosses.remove(c1jboss);
-        Entity c1jboss2 = Iterables.getOnlyElement(c1jbosses);
+        Entity c1jboss2 = (Entity)Iterables.getOnlyElement(c1jbosses);
 
         // TODO Have to wait for new app-server; should fix app-servers to block
         // Also wait for TARGET_ADDRESSES to update

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/3c68339b/utils/common/src/test/java/brooklyn/util/guava/IfFunctionsTest.java
----------------------------------------------------------------------
diff --git a/utils/common/src/test/java/brooklyn/util/guava/IfFunctionsTest.java b/utils/common/src/test/java/brooklyn/util/guava/IfFunctionsTest.java
index e52dc34..0d3f1a4 100644
--- a/utils/common/src/test/java/brooklyn/util/guava/IfFunctionsTest.java
+++ b/utils/common/src/test/java/brooklyn/util/guava/IfFunctionsTest.java
@@ -41,8 +41,11 @@ public class IfFunctionsTest {
     
     @Test
     public void testPredicateAndSupplier() {
-        checkTF(IfFunctions.ifPredicate(Predicates.equalTo(false)).get(Suppliers.ofInstance("F"))
-            .ifEquals(true).value("T").defaultGet(Suppliers.ofInstance("?")).build(), "?");
+        Function function = IfFunctions.ifPredicate(Predicates.equalTo(false)).get(Suppliers.ofInstance("F"))
+                .ifEquals(true).value("T").defaultGet(Suppliers.ofInstance("?")).build();
+        Assert.assertEquals(function.apply(true), "T");
+        Assert.assertEquals(function.apply(false), "F");
+        Assert.assertEquals(function.apply(null), "?");
     }
 
     @Test


Mime
View raw message