You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by ho...@apache.org on 2017/08/29 18:36:46 UTC
[incubator-openwhisk-wskdeploy] 01/02: adding back jaraction
integration test
This is an automated email from the ASF dual-hosted git repository.
houshengbo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-wskdeploy.git
commit c9c4ffd68042821a45a56abeab002adde05950e6
Author: Priti Desai <pd...@us.ibm.com>
AuthorDate: Tue Aug 29 10:55:42 2017 -0700
adding back jaraction integration test
---
tests/src/integration/jaraction/jaraction_test.go | 42 ++++++++++++++++++++++
tests/src/integration/jaraction/manifest.yaml | 7 ++++
tests/src/integration/jaraction/src/Hello.java | 28 +++++++++++++++
tests/src/integration/jaraction/src/hello.jar | Bin 0 -> 966 bytes
4 files changed, 77 insertions(+)
diff --git a/tests/src/integration/jaraction/jaraction_test.go b/tests/src/integration/jaraction/jaraction_test.go
new file mode 100644
index 0000000..3c9f464
--- /dev/null
+++ b/tests/src/integration/jaraction/jaraction_test.go
@@ -0,0 +1,42 @@
+// +build integration
+
+/*
+ * 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.
+ */
+
+package tests
+
+import (
+ "github.com/apache/incubator-openwhisk-wskdeploy/tests/src/integration/common"
+ "github.com/stretchr/testify/assert"
+ "os"
+ "testing"
+)
+
+var wskprops = common.GetWskprops()
+
+func TestJarAction(t *testing.T) {
+ wskdeploy := common.NewWskdeploy()
+ _, err := wskdeploy.Deploy(manifestPath, deploymentPath)
+ assert.Equal(t, nil, err, "Failed to deploy based on the manifest and deployment files.")
+ _, err = wskdeploy.Undeploy(manifestPath, deploymentPath)
+ assert.Equal(t, nil, err, "Failed to undeploy based on the manifest and deployment files.")
+}
+
+var (
+ manifestPath = os.Getenv("GOPATH") + "/src/github.com/apache/incubator-openwhisk-wskdeploy/tests/src/integration/jaraction/manifest.yaml"
+ deploymentPath = ""
+)
diff --git a/tests/src/integration/jaraction/manifest.yaml b/tests/src/integration/jaraction/manifest.yaml
new file mode 100644
index 0000000..dfb83a9
--- /dev/null
+++ b/tests/src/integration/jaraction/manifest.yaml
@@ -0,0 +1,7 @@
+package:
+ name: IntegrationTestHelloworldJar
+ actions:
+ hellojaraction:
+ function: src/hello.jar
+ runtime: java
+ main: Hello
\ No newline at end of file
diff --git a/tests/src/integration/jaraction/src/Hello.java b/tests/src/integration/jaraction/src/Hello.java
new file mode 100644
index 0000000..016a88e
--- /dev/null
+++ b/tests/src/integration/jaraction/src/Hello.java
@@ -0,0 +1,28 @@
+/*
+ * 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 com.google.gson.JsonObject;
+public class Hello {
+ public static JsonObject main(JsonObject args) {
+ String name = "stranger";
+ if (args.has("name"))
+ name = args.getAsJsonPrimitive("name").getAsString();
+ JsonObject response = new JsonObject();
+ response.addProperty("greeting", "Hello " + name + "!");
+ return response;
+ }
+}
\ No newline at end of file
diff --git a/tests/src/integration/jaraction/src/hello.jar b/tests/src/integration/jaraction/src/hello.jar
new file mode 100644
index 0000000..b05753f
Binary files /dev/null and b/tests/src/integration/jaraction/src/hello.jar differ
--
To stop receiving notification emails like this one, please contact
"commits@openwhisk.apache.org" <co...@openwhisk.apache.org>.