Replace zip/jar artifacts with source. (#4763)

Removed binary files which seem to have no references in this repo.
Added README and tooling for building needed test binaries from source.
diff --git a/.gitignore b/.gitignore
index ae5e525..da4204e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -72,14 +72,18 @@
 
 # .zip files must be explicited whitelisted
 *.zip
-!tests/dat/actions/blackbox.zip
-!tests/dat/actions/helloSwift.zip
-!tests/dat/actions/python.zip
-!tests/dat/actions/python2_virtualenv.zip
-!tests/dat/actions/python3_virtualenv.zip
-!tests/dat/actions/python_virtualenv_dir.zip
-!tests/dat/actions/python_virtualenv_name.zip
-!tests/dat/actions/zippedaction.zip
+tests/dat/actions/zippedaction/node_modules
+tests/dat/actions/sleep.jar
+tests/dat/actions/blackbox.zip
+tests/dat/actions/python.zip
+tests/dat/actions/zippedaction.zip
+tests/dat/actions/zippedaction/node_modules
+tests/dat/actions/python2_virtualenv.zip
+tests/dat/actions/python_virtualenv/virtualenv
+tests/dat/actions/.built
+tests/dat/actions/unicode.tests/java-8.bin
+tests/performance/gatling_tests/src/gatling/resources/data/javaAction.jar
+tests/performance/gatling_tests/.built
 
 # dev
 intellij-run-config.groovy
diff --git a/tests/build.gradle b/tests/build.gradle
index 91976ee..2c0d158 100644
--- a/tests/build.gradle
+++ b/tests/build.gradle
@@ -233,10 +233,17 @@
     }
 }
 
+task buildArtifacts(type:Exec) {
+  workingDir 'dat/actions'
+  commandLine './build.sh'
+}
+
 tasks.withType(Test) {
     dependsOn createKeystore
+    dependsOn buildArtifacts
 }
 createKeystore.mustRunAfter(testClasses)
+buildArtifacts.mustRunAfter(testClasses)
 
 gradle.projectsEvaluated {
     task testCoverageLean(type: Test) {
diff --git a/tests/dat/actions/README.md b/tests/dat/actions/README.md
new file mode 100644
index 0000000..d5a960f
--- /dev/null
+++ b/tests/dat/actions/README.md
@@ -0,0 +1,36 @@
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+
+### Building test artifacts
+
+Some test artifacts should be build ahead of actually running the tests.
+These test artifacts compile source code into binaries, generate JAR files,
+install modules and package functions into zip files.
+
+A `build.sh` script is availble as a convenience and will run ahead of tests
+when using `gradle`. However this script will not work on Windows as it currently
+assumes Bash is available.
+
+Some artifacts are not build because they require additional tooling.
+Specifically, these are the unicode tests for the Ballerina and .NET runtimes.
+These unicode tests are checked however in their corresponding runtime build.
+
+For Java artifacts, Java 8 is required. If not found in your path, the build
+script will skip those artifacts and corresponding tests will also be skipped.
+
diff --git a/tests/dat/actions/blackbox.zip b/tests/dat/actions/blackbox.zip
deleted file mode 100644
index d66f3e3..0000000
--- a/tests/dat/actions/blackbox.zip
+++ /dev/null
Binary files differ
diff --git a/tests/dat/actions/blackbox/exec b/tests/dat/actions/blackbox/exec
new file mode 100755
index 0000000..90f026d
--- /dev/null
+++ b/tests/dat/actions/blackbox/exec
@@ -0,0 +1,20 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+echo 'This is an example zip used with the docker skeleton action.'
+echo '{ "msg": "hello zip" }'
diff --git a/tests/dat/actions/build.sh b/tests/dat/actions/build.sh
new file mode 100755
index 0000000..b42dc33
--- /dev/null
+++ b/tests/dat/actions/build.sh
@@ -0,0 +1,42 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+set -e
+
+if [ -f ".built" ]; then
+  echo "Test zip artifacts already built, skipping"
+  exit 0
+fi
+
+# need java 8 to build java actions since that's the version of the runtime currently
+jv=$(java -version 2>&1 | head -1 | awk -F'"' '{print $2}')
+if [[ $jv == 1.8.* ]]; then
+  echo "java version is $jv (ok)"
+  (cd unicode.tests/src/java/unicode && ../../../../../../../gradlew build && cp build/libs/unicode-1.0.jar ../../../java-8.bin)
+  (cd src/java/sleep && ../../../../../../gradlew build && cp build/libs/sleep-1.0.jar ../../../sleep.jar)
+else
+  echo "java version is $jv (not ok)"
+  echo "skipping java actions"
+fi
+
+(cd blackbox && zip ../blackbox.zip exec)
+(cd python-zip && zip ../python.zip -r .)
+(cd zippedaction && npm install && zip ../zippedaction.zip -r .)
+(cd python_virtualenv && ./build.sh && zip ../python2_virtualenv.zip -r .)
+
+touch .built
diff --git a/tests/dat/actions/helloJava.jar b/tests/dat/actions/helloJava.jar
deleted file mode 100644
index a8f49ee..0000000
--- a/tests/dat/actions/helloJava.jar
+++ /dev/null
Binary files differ
diff --git a/tests/dat/actions/helloJavaDefaultPackage.jar b/tests/dat/actions/helloJavaDefaultPackage.jar
deleted file mode 100644
index 5a7a9f3..0000000
--- a/tests/dat/actions/helloJavaDefaultPackage.jar
+++ /dev/null
Binary files differ
diff --git a/tests/dat/actions/helloSwift311.zip b/tests/dat/actions/helloSwift311.zip
deleted file mode 100644
index 5eac158..0000000
--- a/tests/dat/actions/helloSwift311.zip
+++ /dev/null
Binary files differ
diff --git a/tests/dat/actions/multiSwift.zip b/tests/dat/actions/multiSwift.zip
deleted file mode 100644
index e460886..0000000
--- a/tests/dat/actions/multiSwift.zip
+++ /dev/null
Binary files differ
diff --git a/tests/dat/actions/python.zip b/tests/dat/actions/python.zip
deleted file mode 100644
index 070ccc2..0000000
--- a/tests/dat/actions/python.zip
+++ /dev/null
Binary files differ
diff --git a/tests/dat/actions/python2_virtualenv.zip b/tests/dat/actions/python2_virtualenv.zip
deleted file mode 100644
index 4808c8a..0000000
--- a/tests/dat/actions/python2_virtualenv.zip
+++ /dev/null
Binary files differ
diff --git a/tests/dat/actions/python37_virtualenv.zip b/tests/dat/actions/python37_virtualenv.zip
deleted file mode 100644
index 8c2816b..0000000
--- a/tests/dat/actions/python37_virtualenv.zip
+++ /dev/null
Binary files differ
diff --git a/tests/dat/actions/python3_virtualenv.zip b/tests/dat/actions/python3_virtualenv.zip
deleted file mode 100644
index 3f40a15..0000000
--- a/tests/dat/actions/python3_virtualenv.zip
+++ /dev/null
Binary files differ
diff --git a/tests/dat/actions/python_virtualenv/__main__.py b/tests/dat/actions/python_virtualenv/__main__.py
new file mode 100755
index 0000000..e075550
--- /dev/null
+++ b/tests/dat/actions/python_virtualenv/__main__.py
@@ -0,0 +1,32 @@
+#!/usr/bin/env python
+"""Python Hello virtualenv test.
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+"""
+
+import netifaces
+
+def main(dict):
+    networkif = netifaces.interfaces()
+    print ("Networkinterfaces: \n %s" %networkif )
+    networkinfo = netifaces.ifaddresses('eth0')[netifaces.AF_INET]
+    print ("Networkinfo eth0: \n %s" %networkinfo )
+    return {"Networkinfo: ": networkinfo}
+
+def naim(dict):
+    return main(dict)
diff --git a/tests/dat/actions/python_virtualenv/build.sh b/tests/dat/actions/python_virtualenv/build.sh
new file mode 100755
index 0000000..6e4b8fe
--- /dev/null
+++ b/tests/dat/actions/python_virtualenv/build.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+virtualenv virtualenv
+source virtualenv/bin/activate
+pip install -r requirements.txt
diff --git a/tests/dat/actions/python_virtualenv/requirements.txt b/tests/dat/actions/python_virtualenv/requirements.txt
new file mode 100644
index 0000000..65e1d5f
--- /dev/null
+++ b/tests/dat/actions/python_virtualenv/requirements.txt
@@ -0,0 +1,18 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+netifaces==0.10.9
diff --git a/tests/dat/actions/python_virtualenv_dir.zip b/tests/dat/actions/python_virtualenv_dir.zip
deleted file mode 100644
index f308fa1..0000000
--- a/tests/dat/actions/python_virtualenv_dir.zip
+++ /dev/null
Binary files differ
diff --git a/tests/dat/actions/python_virtualenv_name.zip b/tests/dat/actions/python_virtualenv_name.zip
deleted file mode 100644
index 4c6c68a..0000000
--- a/tests/dat/actions/python_virtualenv_name.zip
+++ /dev/null
Binary files differ
diff --git a/tests/dat/actions/sleep.jar b/tests/dat/actions/sleep.jar
deleted file mode 100644
index 536711b..0000000
--- a/tests/dat/actions/sleep.jar
+++ /dev/null
Binary files differ
diff --git a/tests/dat/actions/src/java/sleep/build.gradle b/tests/dat/actions/src/java/sleep/build.gradle
new file mode 100644
index 0000000..c6df5f6
--- /dev/null
+++ b/tests/dat/actions/src/java/sleep/build.gradle
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+plugins {
+    id 'java'
+}
+
+version = '1.0'
+
+repositories {
+    mavenCentral()
+}
+
+dependencies {
+    compile "com.google.code.gson:gson:2.6.2"
+}
diff --git a/tests/dat/actions/src/java/sleep/settings.gradle b/tests/dat/actions/src/java/sleep/settings.gradle
new file mode 100644
index 0000000..9c7396b
--- /dev/null
+++ b/tests/dat/actions/src/java/sleep/settings.gradle
@@ -0,0 +1,18 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+rootProject.name = 'sleep'
diff --git a/tests/dat/actions/Sleep.java b/tests/dat/actions/src/java/sleep/src/main/java/Sleep.java
similarity index 100%
rename from tests/dat/actions/Sleep.java
rename to tests/dat/actions/src/java/sleep/src/main/java/Sleep.java
diff --git a/tests/dat/actions/unicode.tests/ballerina-0.990.bin b/tests/dat/actions/unicode.tests/ballerina-0.990.bin
deleted file mode 100644
index d1bc61b..0000000
--- a/tests/dat/actions/unicode.tests/ballerina-0.990.bin
+++ /dev/null
Binary files differ
diff --git a/tests/dat/actions/unicode.tests/dotnet-2.2.bin b/tests/dat/actions/unicode.tests/dotnet-2.2.bin
deleted file mode 100644
index f3949ee..0000000
--- a/tests/dat/actions/unicode.tests/dotnet-2.2.bin
+++ /dev/null
Binary files differ
diff --git a/tests/dat/actions/unicode.tests/java-8.bin b/tests/dat/actions/unicode.tests/java-8.bin
deleted file mode 100644
index 6360733..0000000
--- a/tests/dat/actions/unicode.tests/java-8.bin
+++ /dev/null
Binary files differ
diff --git a/tests/dat/actions/unicode.tests/src/java/unicode/settings.gradle b/tests/dat/actions/unicode.tests/src/java/unicode/settings.gradle
new file mode 100644
index 0000000..b97dd07
--- /dev/null
+++ b/tests/dat/actions/unicode.tests/src/java/unicode/settings.gradle
@@ -0,0 +1,18 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+rootProject.name = 'unicode'
diff --git a/tests/dat/actions/zippedaction.zip b/tests/dat/actions/zippedaction.zip
deleted file mode 100644
index 14cbd4c..0000000
--- a/tests/dat/actions/zippedaction.zip
+++ /dev/null
Binary files differ
diff --git a/tests/dat/actions/zippedaction/index.js b/tests/dat/actions/zippedaction/index.js
new file mode 100644
index 0000000..1ec587f
--- /dev/null
+++ b/tests/dat/actions/zippedaction/index.js
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+function entryPoint(args) {
+    var pq = require("prog-quote")();
+
+    return pq.next().value;
+}
+
+exports.main = entryPoint;
diff --git a/tests/dat/actions/zippedaction/package-lock.json b/tests/dat/actions/zippedaction/package-lock.json
new file mode 100644
index 0000000..4bbddd4
--- /dev/null
+++ b/tests/dat/actions/zippedaction/package-lock.json
@@ -0,0 +1,21 @@
+{
+  "name": "test-action",
+  "version": "1.0.0",
+  "lockfileVersion": 1,
+  "requires": true,
+  "dependencies": {
+    "prog-quote": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/prog-quote/-/prog-quote-2.0.0.tgz",
+      "integrity": "sha1-TLBMeosV/zu/kxMQxCsBzSjcMB0=",
+      "requires": {
+        "random-js": "1.0.8"
+      }
+    },
+    "random-js": {
+      "version": "1.0.8",
+      "resolved": "https://registry.npmjs.org/random-js/-/random-js-1.0.8.tgz",
+      "integrity": "sha1-lo/WiabyXWwKrHZig94vaIycGQo="
+    }
+  }
+}
diff --git a/tests/dat/actions/zippedaction/package.json b/tests/dat/actions/zippedaction/package.json
new file mode 100644
index 0000000..d330091
--- /dev/null
+++ b/tests/dat/actions/zippedaction/package.json
@@ -0,0 +1,11 @@
+{
+  "name": "test-action",
+  "version": "1.0.0",
+  "description": "An action written as an npm package.",
+  "main": "index.js",
+  "author": "OpenWhisk",
+  "license": "Apache 2.0",
+  "dependencies": {
+    "prog-quote": "2.0.0"
+  }
+}
diff --git a/tests/performance/gatling_tests/build.gradle b/tests/performance/gatling_tests/build.gradle
index 856173a..04c1b05 100644
--- a/tests/performance/gatling_tests/build.gradle
+++ b/tests/performance/gatling_tests/build.gradle
@@ -25,3 +25,9 @@
     gatling "io.spray:spray-json_${gradle.scala.depVersion}:1.3.4"
     gatling "commons-io:commons-io:2.6"
 }
+
+task buildArtifacts(type:Exec) {
+  commandLine './build.sh'
+}
+
+tasks.matching {it != buildArtifacts}.all {it.dependsOn buildArtifacts}
diff --git a/tests/performance/gatling_tests/build.sh b/tests/performance/gatling_tests/build.sh
new file mode 100755
index 0000000..547abd6
--- /dev/null
+++ b/tests/performance/gatling_tests/build.sh
@@ -0,0 +1,35 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+set -e
+
+if [ -f ".built" ]; then
+  echo "Test zip artifacts already built, skipping"
+  exit 0
+fi
+
+# need java 8 to build java actions since that's the version of the runtime currently
+jv=$(java -version 2>&1 | head -1 | awk -F'"' '{print $2}')
+if [[ $jv == 1.8.* ]]; then
+  echo "java version is $jv (ok)"
+  (cd src/gatling/resources/data/src/java && ../../../../../../../../../gradlew build && cp build/libs/gatling-1.0.jar ../../javaAction.jar)
+  touch .built
+else
+  echo "java version is $jv (not ok)"
+  echo "skipping java actions"
+fi
diff --git a/tests/performance/gatling_tests/src/gatling/resources/data/javaAction.jar b/tests/performance/gatling_tests/src/gatling/resources/data/javaAction.jar
deleted file mode 100644
index 17229eb..0000000
--- a/tests/performance/gatling_tests/src/gatling/resources/data/javaAction.jar
+++ /dev/null
Binary files differ
diff --git a/tests/performance/gatling_tests/src/gatling/resources/data/src/java/build.gradle b/tests/performance/gatling_tests/src/gatling/resources/data/src/java/build.gradle
new file mode 100644
index 0000000..c6df5f6
--- /dev/null
+++ b/tests/performance/gatling_tests/src/gatling/resources/data/src/java/build.gradle
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+plugins {
+    id 'java'
+}
+
+version = '1.0'
+
+repositories {
+    mavenCentral()
+}
+
+dependencies {
+    compile "com.google.code.gson:gson:2.6.2"
+}
diff --git a/tests/performance/gatling_tests/src/gatling/resources/data/src/java/settings.gradle b/tests/performance/gatling_tests/src/gatling/resources/data/src/java/settings.gradle
new file mode 100644
index 0000000..0791bc4
--- /dev/null
+++ b/tests/performance/gatling_tests/src/gatling/resources/data/src/java/settings.gradle
@@ -0,0 +1,18 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+rootProject.name = 'gatling'
diff --git a/tests/performance/gatling_tests/src/gatling/resources/data/javaAction.java b/tests/performance/gatling_tests/src/gatling/resources/data/src/java/src/main/java/JavaAction.java
similarity index 100%
rename from tests/performance/gatling_tests/src/gatling/resources/data/javaAction.java
rename to tests/performance/gatling_tests/src/gatling/resources/data/src/java/src/main/java/JavaAction.java
diff --git a/tests/src/test/scala/org/apache/openwhisk/core/limits/MaxActionDurationTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/limits/MaxActionDurationTests.scala
index 14ad882..4995b0c 100644
--- a/tests/src/test/scala/org/apache/openwhisk/core/limits/MaxActionDurationTests.scala
+++ b/tests/src/test/scala/org/apache/openwhisk/core/limits/MaxActionDurationTests.scala
@@ -17,6 +17,7 @@
 
 package org.apache.openwhisk.core.limits
 
+import java.io.File
 import scala.concurrent.duration.DurationInt
 
 import org.junit.runner.RunWith
@@ -64,35 +65,41 @@
   "node-, python, and java-action" should s"run up to the max allowed duration (${TimeLimit.MAX_DURATION})" taggedAs (Slow) in withAssetCleaner(
     wskprops) { (wp, assetHelper) =>
     // When you add more runtimes, keep in mind, how many actions can be processed in parallel by the Invokers!
-    Map("node" -> "helloDeadline.js", "python" -> "sleep.py", "java" -> "sleep.jar").par.map {
-      case (k, name) =>
-        println(s"Testing action kind '${k}' with action '${name}'")
-        assetHelper.withCleaner(wsk.action, name) { (action, _) =>
-          val main = if (k == "java") Some("Sleep") else None
-          action.create(
-            name,
-            Some(TestUtils.getTestActionFilename(name)),
-            timeout = Some(TimeLimit.MAX_DURATION),
-            main = main)
-        }
-
-        val run = wsk.action.invoke(
-          name,
-          Map("forceHang" -> true.toJson, "sleepTimeInMs" -> (TimeLimit.MAX_DURATION + 30.seconds).toMillis.toJson))
-        withActivation(
-          wsk.activation,
-          run,
-          initialWait = 1.minute,
-          pollPeriod = 1.minute,
-          totalWait = TimeLimit.MAX_DURATION + 2.minutes) { activation =>
-          withClue("Activation result not as expected:") {
-            activation.response.status shouldBe ActivationResponse.messageForCode(ActivationResponse.DeveloperError)
-            activation.response.result shouldBe Some(
-              JsObject("error" -> Messages.timedoutActivation(TimeLimit.MAX_DURATION, init = false).toJson))
-            activation.duration.toInt should be >= TimeLimit.MAX_DURATION.toMillis.toInt
+    Map("node" -> "helloDeadline.js", "python" -> "sleep.py", "java" -> "sleep.jar")
+      .filter {
+        case (_, name) =>
+          new File(TestUtils.getTestActionFilename(name)).exists()
+      }
+      .par
+      .map {
+        case (k, name) =>
+          println(s"Testing action kind '${k}' with action '${name}'")
+          assetHelper.withCleaner(wsk.action, name) { (action, _) =>
+            val main = if (k == "java") Some("Sleep") else None
+            action.create(
+              name,
+              Some(TestUtils.getTestActionFilename(name)),
+              timeout = Some(TimeLimit.MAX_DURATION),
+              main = main)
           }
-        }
-        () // explicitly map to Unit
-    }
+
+          val run = wsk.action.invoke(
+            name,
+            Map("forceHang" -> true.toJson, "sleepTimeInMs" -> (TimeLimit.MAX_DURATION + 30.seconds).toMillis.toJson))
+          withActivation(
+            wsk.activation,
+            run,
+            initialWait = 1.minute,
+            pollPeriod = 1.minute,
+            totalWait = TimeLimit.MAX_DURATION + 2.minutes) { activation =>
+            withClue("Activation result not as expected:") {
+              activation.response.status shouldBe ActivationResponse.messageForCode(ActivationResponse.DeveloperError)
+              activation.response.result shouldBe Some(
+                JsObject("error" -> Messages.timedoutActivation(TimeLimit.MAX_DURATION, init = false).toJson))
+              activation.duration.toInt should be >= TimeLimit.MAX_DURATION.toMillis.toInt
+            }
+          }
+          () // explicitly map to Unit
+      }
   }
 }