You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by he...@apache.org on 2015/11/11 18:21:44 UTC

[17/21] incubator-brooklyn git commit: Changed TestHttpCall assertion key word 'string' -> 'bodyContains'

Changed TestHttpCall assertion key word 'string' -> 'bodyContains'


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

Branch: refs/heads/master
Commit: a3e253d0c25eb3e537e881370d5bc6cd6b9bccdd
Parents: d6c455c
Author: Mark McKenna <m4...@gmail.com>
Authored: Wed Nov 11 14:33:46 2015 +0000
Committer: Mark McKenna <m4...@gmail.com>
Committed: Wed Nov 11 14:33:46 2015 +0000

----------------------------------------------------------------------
 usage/test-framework/README.md                                 | 2 +-
 .../org/apache/brooklyn/test/framework/TestHttpCallImpl.java   | 2 +-
 .../test-framework-examples/testhttpcall-examples.yml          | 6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/a3e253d0/usage/test-framework/README.md
----------------------------------------------------------------------
diff --git a/usage/test-framework/README.md b/usage/test-framework/README.md
index a4ca928..65556d8 100644
--- a/usage/test-framework/README.md
+++ b/usage/test-framework/README.md
@@ -92,7 +92,7 @@ Entity that makes a HTTP Request and tests the response
     url: $brooklyn:component("tomcat").attributeWhenReady("main.uri")
     timeout: 1m
     assert:
-      string: Sample Brooklyn Deployed
+      bodyContains: Sample Brooklyn Deployed
   - type: org.apache.brooklyn.test.framework.TestHttpCall
     name: Status Code 404
     url: $brooklyn:formatString("%s/invalidpath/", component("tomcat").attributeWhenReady("webapp.url"))

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/a3e253d0/usage/test-framework/src/main/java/org/apache/brooklyn/test/framework/TestHttpCallImpl.java
----------------------------------------------------------------------
diff --git a/usage/test-framework/src/main/java/org/apache/brooklyn/test/framework/TestHttpCallImpl.java b/usage/test-framework/src/main/java/org/apache/brooklyn/test/framework/TestHttpCallImpl.java
index dad5e97..9cf46dc 100644
--- a/usage/test-framework/src/main/java/org/apache/brooklyn/test/framework/TestHttpCallImpl.java
+++ b/usage/test-framework/src/main/java/org/apache/brooklyn/test/framework/TestHttpCallImpl.java
@@ -74,7 +74,7 @@ public class TestHttpCallImpl extends AbstractTest implements TestHttpCall {
                 LOG.info("Testing if url [{}] matches regex [{}]",
                         new Object[]{url, entry.getValue()});
                 assertContentEventuallyMatches(flags, url, TypeCoercions.coerce(entry.getValue(), String.class));
-            } else if (Objects.equal(entry.getKey(), "string")) {
+            } else if (Objects.equal(entry.getKey(), "bodyContains")) {
                 LOG.debug("Testing if url [{}] contains string [{}]",
                         new Object[]{url, entry.getValue()});
                 assertContentEventuallyContainsText(flags, url, TypeCoercions.coerce(entry.getValue(), String.class));

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/a3e253d0/usage/test-framework/src/test/resources/test-framework-examples/testhttpcall-examples.yml
----------------------------------------------------------------------
diff --git a/usage/test-framework/src/test/resources/test-framework-examples/testhttpcall-examples.yml b/usage/test-framework/src/test/resources/test-framework-examples/testhttpcall-examples.yml
index a418fd8..b439c8a 100644
--- a/usage/test-framework/src/test/resources/test-framework-examples/testhttpcall-examples.yml
+++ b/usage/test-framework/src/test/resources/test-framework-examples/testhttpcall-examples.yml
@@ -23,7 +23,7 @@ services:
     name: String match
     url: $brooklyn:component("tomcat").attributeWhenReady("webapp.url")
     assert:
-      string: Sample Brooklyn Deployed
+      bodyContains: Sample Brooklyn Deployed
   - type: org.apache.brooklyn.test.framework.TestHttpCall
     name: Regex match
     url: $brooklyn:component("tomcat").attributeWhenReady("webapp.url")
@@ -105,14 +105,14 @@ services:
     url: $brooklyn:formatString("%s/newcontext2/", component("tomcat").attributeWhenReady("webapp.url"))
     timeout: 10s
     assert:
-      string: Sample Brooklyn Deployed
+      bodyContains: Sample Brooklyn Deployed
     assert:
       status: 404
   - type: org.apache.brooklyn.test.framework.TestHttpCall
     name: String match
     url: $brooklyn:component("tomcat").attributeWhenReady("webapp.url")
     assert:
-      string: Sample Brooklyn Deployed
+      bodyContains: Sample Brooklyn Deployed
   - type: org.apache.brooklyn.test.framework.TestHttpCall
     name: Regex match
     url: $brooklyn:component("tomcat").attributeWhenReady("webapp.url")