Repository: storm
Updated Branches:
  refs/heads/master dbf7b998c -> 64168037f


STORM-2650: Expand property substitution test for Flux to cover non-string 
properties


Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/752b90c5
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/752b90c5
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/752b90c5

Branch: refs/heads/master
Commit: 752b90c51b5b3081ab990a0e4476ee8e2175455c
Parents: ce19f81
Author: Stig Rohde Døssing <s...@apache.org>
Authored: Thu Jul 20 17:22:42 2017 +0200
Committer: Stig Rohde Døssing <s...@apache.org>
Committed: Thu Jul 20 17:43:56 2017 +0200

----------------------------------------------------------------------
 .../src/test/java/org/apache/storm/flux/TCKTest.java        | 9 +++++++++
 .../src/test/resources/configs/substitution-test.yaml       | 3 ++-
 flux/flux-core/src/test/resources/configs/test.properties   | 1 +
 3 files changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/752b90c5/flux/flux-core/src/test/java/org/apache/storm/flux/TCKTest.java
----------------------------------------------------------------------
diff --git a/flux/flux-core/src/test/java/org/apache/storm/flux/TCKTest.java 
b/flux/flux-core/src/test/java/org/apache/storm/flux/TCKTest.java
index c9227f6..da38969 100644
--- a/flux/flux-core/src/test/java/org/apache/storm/flux/TCKTest.java
+++ b/flux/flux-core/src/test/java/org/apache/storm/flux/TCKTest.java
@@ -17,6 +17,8 @@
  */
 package org.apache.storm.flux;
 
+import static org.hamcrest.CoreMatchers.is;
+
 import org.apache.storm.Config;
 import org.apache.storm.generated.StormTopology;
 import org.apache.storm.flux.model.ExecutionContext;
@@ -27,6 +29,8 @@ import org.junit.Test;
 
 import static org.junit.Assert.*;
 
+import java.util.Collections;
+
 public class TCKTest {
     @Test
     public void testTCK() throws Exception {
@@ -249,6 +253,11 @@ public class TCKTest {
         assertEquals("ENV variable not replaced.",
                 envPath,
                 context.getTopologyDef().getConfig().get("test.env.value"));
+        
+        //Test substitution where the target type is List
+        assertThat("List property is not replaced by the expected value",
+               Collections.singletonList("A string list"),
+               
is(context.getTopologyDef().getConfig().get("list.property.target")));
 
     }
 }

http://git-wip-us.apache.org/repos/asf/storm/blob/752b90c5/flux/flux-core/src/test/resources/configs/substitution-test.yaml
----------------------------------------------------------------------
diff --git a/flux/flux-core/src/test/resources/configs/substitution-test.yaml 
b/flux/flux-core/src/test/resources/configs/substitution-test.yaml
index ce9e62d..3d521e1 100644
--- a/flux/flux-core/src/test/resources/configs/substitution-test.yaml
+++ b/flux/flux-core/src/test/resources/configs/substitution-test.yaml
@@ -43,7 +43,8 @@ config:
   topology.workers: 1
   # test environent variable substitution
   test.env.value: ${ENV-PATH}
-  # ...
+  # test variable substitution for list type
+  list.property.target: ${a.list.property}
 
 # spout definitions
 spouts:

http://git-wip-us.apache.org/repos/asf/storm/blob/752b90c5/flux/flux-core/src/test/resources/configs/test.properties
----------------------------------------------------------------------
diff --git a/flux/flux-core/src/test/resources/configs/test.properties 
b/flux/flux-core/src/test/resources/configs/test.properties
index ecd89d9..afa3592 100644
--- a/flux/flux-core/src/test/resources/configs/test.properties
+++ b/flux/flux-core/src/test/resources/configs/test.properties
@@ -15,4 +15,5 @@
 # limitations under the License.
 
 topology.name: substitution-topology
+a.list.property: ["A string list"]
 some.other.property: foo bar
\ No newline at end of file

Reply via email to