You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by cs...@apache.org on 2018/02/28 01:37:33 UTC
[incubator-openwhisk-catalog] branch master updated: Update CURL
Tests (#259)
This is an automated email from the ASF dual-hosted git repository.
csantanapr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-catalog.git
The following commit(s) were added to refs/heads/master by this push:
new ee99391 Update CURL Tests (#259)
ee99391 is described below
commit ee993914e3fc039b2a524320914cb4803481fc46
Author: James Dubee <jw...@us.ibm.com>
AuthorDate: Tue Feb 27 20:37:31 2018 -0500
Update CURL Tests (#259)
---
.../src/test/scala/packages/samples/CurlTest.scala | 29 ++++++++++++++++------
1 file changed, 21 insertions(+), 8 deletions(-)
diff --git a/tests/src/test/scala/packages/samples/CurlTest.scala b/tests/src/test/scala/packages/samples/CurlTest.scala
index eeb52f1..92b64ac 100644
--- a/tests/src/test/scala/packages/samples/CurlTest.scala
+++ b/tests/src/test/scala/packages/samples/CurlTest.scala
@@ -21,9 +21,12 @@ import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
import common.{ TestHelpers, Wsk, WskProps, WskTestHelpers }
+
import spray.json._
import spray.json.DefaultJsonProtocol._
+import whisk.utils.retry
+
@RunWith(classOf[JUnitRunner])
class CurlTest extends TestHelpers with WskTestHelpers {
implicit val wskprops = WskProps()
@@ -34,17 +37,27 @@ class CurlTest extends TestHelpers with WskTestHelpers {
it should "Return Could not resolve host when sending no parameter" in {
val expectedError = "Could not resolve host"
- val run = wsk.action.invoke(greetingAction, Map())
- withActivation(wsk.activation, run) {
- _.response.result.get.toString should include(expectedError)
- }
+
+ retry(
+ {
+ val run = wsk.action.invoke(greetingAction, Map())
+ withActivation(wsk.activation, run) {
+ _.response.result.get.toString should include(expectedError)
+ }
+ })
}
it should "Return the web content when sending the public google as the payload" in {
val expectedBody = "<HTML>"
- val run = wsk.action.invoke(greetingAction, Map("payload" -> "google.com".toJson))
- withActivation(wsk.activation, run) {
- _.response.result.get.toString should include(expectedBody)
- }
+ val host = "google.com"
+
+ retry(
+ {
+ val run = wsk.action.invoke(greetingAction, Map("payload" -> host.toJson))
+ withActivation(wsk.activation, run) {
+ _.response.result.get.toString should include(expectedBody)
+ }
+ }
+ )
}
}
--
To stop receiving notification emails like this one, please contact
csantanapr@apache.org.