brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From drigod...@apache.org
Subject [2/3] brooklyn-server git commit: BROOKLYN-565: revert “fix”; include broken tests
Date Mon, 27 Nov 2017 10:15:17 GMT
BROOKLYN-565: revert “fix”; include broken tests

Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/8f2edef3
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/8f2edef3
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/8f2edef3

Branch: refs/heads/master
Commit: 8f2edef3353e04a72775c7aa7bcd1b60488f6690
Parents: 397a832
Author: Aled Sage <aled.sage@gmail.com>
Authored: Thu Nov 23 16:40:13 2017 +0000
Committer: Aled Sage <aled.sage@gmail.com>
Committed: Thu Nov 23 16:40:13 2017 +0000

----------------------------------------------------------------------
 .../brooklyn/camp/brooklyn/spi/dsl/DslUtils.java       | 12 ------------
 .../apache/brooklyn/camp/brooklyn/ObjectsYamlTest.java |  7 ++++++-
 .../brooklyn/camp/brooklyn/spi/dsl/DslUtilsTest.java   | 13 +++++++++----
 3 files changed, 15 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/8f2edef3/camp/camp-brooklyn/src/main/java/org/apache/brooklyn/camp/brooklyn/spi/dsl/DslUtils.java
----------------------------------------------------------------------
diff --git a/camp/camp-brooklyn/src/main/java/org/apache/brooklyn/camp/brooklyn/spi/dsl/DslUtils.java
b/camp/camp-brooklyn/src/main/java/org/apache/brooklyn/camp/brooklyn/spi/dsl/DslUtils.java
index 2c9f025..9789c86 100644
--- a/camp/camp-brooklyn/src/main/java/org/apache/brooklyn/camp/brooklyn/spi/dsl/DslUtils.java
+++ b/camp/camp-brooklyn/src/main/java/org/apache/brooklyn/camp/brooklyn/spi/dsl/DslUtils.java
@@ -19,8 +19,6 @@
 package org.apache.brooklyn.camp.brooklyn.spi.dsl;
 
 import java.util.Arrays;
-import java.util.Collection;
-import java.util.Map;
 
 import org.apache.brooklyn.util.core.task.DeferredSupplier;
 
@@ -40,16 +38,6 @@ public class DslUtils {
             if (arg instanceof DeferredSupplier<?>) {
                 allResolved = false;
                 break;
-            } else if (arg instanceof Collection) {
-                if (!resolved((Collection<?>)arg)) {
-                    allResolved = false;
-                    break;
-                }
-            } else if (arg instanceof Map) {
-                if (!(resolved(((Map<?,?>)arg).keySet()) && resolved(((Map<?,?>)arg).values())))
{
-                    allResolved = false;
-                    break;
-                }
             }
         }
         return allResolved;

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/8f2edef3/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ObjectsYamlTest.java
----------------------------------------------------------------------
diff --git a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ObjectsYamlTest.java
b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ObjectsYamlTest.java
index 5ff3f15..edbc201 100644
--- a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ObjectsYamlTest.java
+++ b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ObjectsYamlTest.java
@@ -476,7 +476,7 @@ public class ObjectsYamlTest extends AbstractYamlTest {
     }
 
     @Test
-    public void testFieldOfTypeListAsDeferredSuppliers() throws Exception {
+    public void testFieldOfTypeListAsDeferredSuppliersExplicitlyDeferred() throws Exception
{
         {
             // Using explicit `deferred: true`
             Entity testEntity = setupAndCheckTestEntityInBasicYamlWith(
@@ -494,6 +494,11 @@ public class ObjectsYamlTest extends AbstractYamlTest {
             TestObject testObject = (TestObject) testEntity.getConfig(TestEntity.CONF_OBJECT);
             Assert.assertEquals(testObject.getList(), ImmutableList.of("myval"));
         }
+    }
+    
+    // TODO See https://issues.apache.org/jira/browse/BROOKLYN-565
+    @Test(groups="Broken")
+    public void testFieldOfTypeListAsDeferredSuppliers() throws Exception {
         {
             // See https://issues.apache.org/jira/browse/BROOKLYN-565
             // should defer evaluation automatically, and resolve config in `getConfig()`

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/8f2edef3/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/spi/dsl/DslUtilsTest.java
----------------------------------------------------------------------
diff --git a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/spi/dsl/DslUtilsTest.java
b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/spi/dsl/DslUtilsTest.java
index 60dec99..f10e8d8 100644
--- a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/spi/dsl/DslUtilsTest.java
+++ b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/spi/dsl/DslUtilsTest.java
@@ -32,12 +32,12 @@ import com.google.common.collect.ImmutableMap;
 
 public class DslUtilsTest {
 
+    private DeferredSupplier<String> deferredVal = new DeferredSupplier<String>()
{
+        public String get() {return "myval";};
+    };
+
     @Test
     public void testResolved() throws Exception {
-        DeferredSupplier<String> deferredVal = new DeferredSupplier<String>()
{
-            public String get() {return "myval";};
-        };
-        
         assertTrue(DslUtils.resolved());
         assertTrue(DslUtils.resolved((Object)null));
         assertTrue(DslUtils.resolved((List<?>)null));
@@ -47,6 +47,11 @@ public class DslUtilsTest {
         
         assertFalse(DslUtils.resolved(deferredVal));
         assertFalse(DslUtils.resolved(ImmutableList.of(deferredVal)));
+    }
+    
+    // TODO See https://issues.apache.org/jira/browse/BROOKLYN-565
+    @Test(groups="Broken")
+    public void testResolvedDetectionInNestedCollections() throws Exception {
         assertFalse(DslUtils.resolved(ImmutableList.of(ImmutableList.of(deferredVal))));
         assertFalse(DslUtils.resolved(ImmutableList.of(ImmutableMap.of(deferredVal, "myval"))));
         assertFalse(DslUtils.resolved(ImmutableList.of(ImmutableMap.of("mykey", deferredVal))));


Mime
View raw message