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-package-cloudant.git


The following commit(s) were added to refs/heads/master by this push:
     new 31c6ca0  replace gradle method leftshift(deprecated) with doLast (#158)
31c6ca0 is described below

commit 31c6ca0096c39f2d0b6e63ec28766e55a30acf0c
Author: Jason Peterson <jason...@us.ibm.com>
AuthorDate: Mon Feb 19 10:48:49 2018 -0500

    replace gradle method leftshift(deprecated) with doLast (#158)
---
 gradle/docker.gradle                               | 16 ++++++---
 settings.gradle                                    |  2 +-
 .../system/health/CloudantHealthFeedTests.scala    | 39 ++++++++++------------
 3 files changed, 30 insertions(+), 27 deletions(-)

diff --git a/gradle/docker.gradle b/gradle/docker.gradle
index 8192d3a..c74ba30 100644
--- a/gradle/docker.gradle
+++ b/gradle/docker.gradle
@@ -37,16 +37,21 @@ if(project.hasProperty('dockerHost')) {
 }
 
 if(project.hasProperty('dockerBuildArgs')) {
-    dockerBuildArg += ['--build-arg', project.dockerBuildArgs]
+    dockerBuildArgs.each { arg  ->
+        dockerBuildArg += ['--build-arg', arg]
+    }
 }
 
-task distDocker << {
+task distDocker {
+    doLast {
     def start = new Date()
     def cmd = dockerBinary + dockerBuildArg + ['-t', dockerImageName, 
project.buildscript.sourceFile.getParentFile().getAbsolutePath()]
     retry(cmd, dockerRetries, dockerTimeout)
     println("Building '${dockerImageName}' took ${TimeCategory.minus(new 
Date(), start)}")
 }
-task tagImage << {
+}
+task tagImage {
+    doLast {
     def versionString = (dockerBinary + ['-v']).execute().text
     def matched = (versionString =~ /(\d+)\.(\d+)\.(\d+)/)
 
@@ -59,11 +64,14 @@ task tagImage << {
     }
     retry(dockerBinary + dockerCmd + [dockerImageName, dockerTaggedImageName], 
dockerRetries, dockerTimeout)
 }
+}
 
-task pushImage << {
+task pushImage {
+    doLast {
     def cmd = dockerBinary + ['push', dockerTaggedImageName]
     retry(cmd, dockerRetries, dockerTimeout)
 }
+}
 pushImage.dependsOn tagImage
 pushImage.onlyIf { dockerRegistry != '' }
 distDocker.finalizedBy pushImage
diff --git a/settings.gradle b/settings.gradle
index cf885c6..2198275 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -11,6 +11,6 @@ include 'tests'
 rootProject.name = 'openwhisk-package-cloudant'
 
 gradle.ext.scala = [
-    version: '2.11.8',
+    version: '2.11.11',
     compileFlags: ['-feature', '-unchecked', '-deprecation', 
'-Xfatal-warnings', '-Ywarn-unused-import']
 ]
diff --git a/tests/src/test/scala/system/health/CloudantHealthFeedTests.scala 
b/tests/src/test/scala/system/health/CloudantHealthFeedTests.scala
index 42e842c..bb342d4 100644
--- a/tests/src/test/scala/system/health/CloudantHealthFeedTests.scala
+++ b/tests/src/test/scala/system/health/CloudantHealthFeedTests.scala
@@ -44,6 +44,7 @@ class CloudantHealthFeedTests
     val wsk = new Wsk
     val defaultAction = Some(TestUtils.getTestActionFilename("hello.js"))
     val myCloudantCreds = 
CloudantUtil.Credential.makeFromVCAPFile("cloudantNoSQLDB", 
this.getClass.getSimpleName)
+    val maxRetries = System.getProperty("max.retries", "60").toInt
 
     behavior of "Cloudant Health trigger service"
 
@@ -79,13 +80,13 @@ class CloudantHealthFeedTests
             }
 
             // create action
-            assetHelper.withCleaner(wsk.action, actionName) { (action, name) =>
-                action.create(name, defaultAction)
+            assetHelper.withCleaner(wsk.action, actionName) {
+                (action, name) => action.create(name, defaultAction)
             }
 
             // create whisk stuff
             println(s"Creating trigger: $triggerName")
-            val feedCreationResult = assetHelper.withCleaner(wsk.trigger, 
triggerName) {
+            assetHelper.withCleaner(wsk.trigger, triggerName) {
                 (trigger, name) =>
                     trigger.create(name, feed = Some(s"$packageName/$feed"), 
parameters = Map(
                         "username" -> myCloudantCreds.user.toJson,
@@ -95,8 +96,8 @@ class CloudantHealthFeedTests
             }
 
             // create rule
-            assetHelper.withCleaner(wsk.rule, ruleName) { (rule, name) =>
-                rule.create(name, trigger = triggerName, action = actionName)
+            assetHelper.withCleaner(wsk.rule, ruleName) {
+                (rule, name) => rule.create(name, trigger = triggerName, 
action = actionName)
             }
 
             val activationsBeforeChange = wsk.activation.pollFor(N = 1, 
Some(triggerName)).length
@@ -108,7 +109,7 @@ class CloudantHealthFeedTests
             println(s"created a test doc at $now")
 
             // get activation list of the trigger, expecting exactly 1
-            val activations = wsk.activation.pollFor(N = 1, Some(triggerName), 
retries = 60).length
+            val activations = wsk.activation.pollFor(N = 1, Some(triggerName), 
retries = maxRetries).length
             val nowPoll = Instant.now(Clock.systemUTC())
             println(s"Found activation size ($nowPoll): $activations")
             withClue("Change feed trigger count: ") { activations should be(1) 
}
@@ -148,12 +149,12 @@ class CloudantHealthFeedTests
             }
 
             // create action
-            assetHelper.withCleaner(wsk.action, actionName) { (action, name) =>
-                action.create(name, defaultAction)
+            assetHelper.withCleaner(wsk.action, actionName) {
+                (action, name) => action.create(name, defaultAction)
             }
 
             println(s"Creating trigger: $triggerName")
-            val feedCreationResult = assetHelper.withCleaner(wsk.trigger, 
triggerName) {
+            assetHelper.withCleaner(wsk.trigger, triggerName) {
                 (trigger, name) =>
                     trigger.create(name, feed = Some(s"$packageName/$feed"), 
parameters = Map(
                         "username" -> myCloudantCreds.user.toJson,
@@ -164,8 +165,8 @@ class CloudantHealthFeedTests
             }
 
             // create rule
-            assetHelper.withCleaner(wsk.rule, ruleName) { (rule, name) =>
-                rule.create(name, trigger = triggerName, action = actionName)
+            assetHelper.withCleaner(wsk.rule, ruleName) {
+                (rule, name) => rule.create(name, trigger = triggerName, 
action = actionName)
             }
 
             val activationsBeforeDelete = wsk.activation.pollFor(N = 1, 
Some(triggerName)).length
@@ -175,7 +176,7 @@ class CloudantHealthFeedTests
             println("delete a test doc")
             CloudantUtil.deleteDocument(myCloudantCreds, 
CloudantUtil.getDocument(myCloudantCreds, "testid"))
 
-            val activations = wsk.activation.pollFor(N = 1, Some(triggerName), 
retries = 60).length
+            val activations = wsk.activation.pollFor(N = 1, Some(triggerName), 
retries = maxRetries).length
             activations should be(1)
     }
 
@@ -236,8 +237,7 @@ class CloudantHealthFeedTests
             ))
 
             withActivation(wsk.activation, run) {
-                activation =>
-                    activation.response.success shouldBe true
+                activation => activation.response.success shouldBe true
 
                     inside(activation.response.result) {
                         case Some(result) =>
@@ -261,8 +261,6 @@ class CloudantHealthFeedTests
                             status should not(contain key "reason")
                     }
             }
-
-
     }
 
     it should "update filter and query_params parameters" in 
withAssetCleaner(wskprops) {
@@ -317,8 +315,7 @@ class CloudantHealthFeedTests
             ))
 
             withActivation(wsk.activation, readRunResult) {
-                activation =>
-                    activation.response.success shouldBe true
+                activation => activation.response.success shouldBe true
 
                     inside(activation.response.result) {
                         case Some(result) =>
@@ -341,8 +338,7 @@ class CloudantHealthFeedTests
             ))
 
             withActivation(wsk.activation, updateRunAction) {
-                activation =>
-                    activation.response.success shouldBe true
+                activation => activation.response.success shouldBe true
             }
 
             val runResult = wsk.action.invoke(actionName, parameters = Map(
@@ -352,8 +348,7 @@ class CloudantHealthFeedTests
             ))
 
             withActivation(wsk.activation, runResult) {
-                activation =>
-                    activation.response.success shouldBe true
+                activation => activation.response.success shouldBe true
 
                     inside(activation.response.result) {
                         case Some(result) =>

-- 
To stop receiving notification emails like this one, please contact
csantan...@apache.org.

Reply via email to