From 68c89bd357fe044a431c099b3148e0d569a66e39 Mon Sep 17 00:00:00 2001 From: Devin Bost Date: Fri, 24 Jan 2020 11:54:36 -0700 Subject: [PATCH] Improved formatting and removed some unnecessary comments. (#6104). --- pulsar-function-go/core/pf/instance.go | 4 +-- .../functions/PulsarFunctionsTest.java | 34 ------------------- 2 files changed, 2 insertions(+), 36 deletions(-) diff --git a/pulsar-function-go/core/pf/instance.go b/pulsar-function-go/core/pf/instance.go index f31d520c887c7..7e5ae5ee2da3b 100644 --- a/pulsar-function-go/core/pf/instance.go +++ b/pulsar-function-go/core/pf/instance.go @@ -38,7 +38,7 @@ type goInstance struct { consumers map[string]pulsar.Consumer client pulsar.Client lastHealthCheckTs int64 - properties map[string]string + properties map[string]string } // newGoInstance init goInstance and init function context @@ -52,7 +52,7 @@ func newGoInstance() *goInstance { goInstance.properties = make(map[string]string) return goInstance } -func (gi *goInstance) getProperties(){ +func (gi *goInstance) getProperties() { gi.properties["application"] = "pulsar-function" gi.properties["id"] = gi.context.GetFuncFQFN() gi.properties["instance_id"] = gi.context.GetFuncID() diff --git a/tests/integration/src/test/java/org/apache/pulsar/tests/integration/functions/PulsarFunctionsTest.java b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/functions/PulsarFunctionsTest.java index 0e23954ffc7c4..e18a2ee320efe 100644 --- a/tests/integration/src/test/java/org/apache/pulsar/tests/integration/functions/PulsarFunctionsTest.java +++ b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/functions/PulsarFunctionsTest.java @@ -846,40 +846,6 @@ public void testPythonFunctionLocalRun() throws Exception { } @Test(groups = "function") public void testGoFunctionLocalRun() throws Exception { - /* - Process process = java.lang.Runtime.getRuntime().exec( - "go build ../../pulsar-function-go/pf -o /pulsar/examples/go-examples/go-test-functions.go"); - StringBuilder output = new StringBuilder(); - - BufferedReader stdInput = new BufferedReader(new - InputStreamReader(process.getInputStream())); - - BufferedReader stdError = new BufferedReader(new - InputStreamReader(process.getErrorStream())); - - // Read the output from the command - System.out.println("Here is the standard output of the command:\n"); - String s = null; - while ((s = stdInput.readLine()) != null) { - System.out.println(s); - } - - // Read any errors from the attempted command - System.out.println("Here is the standard error of the command (if any):\n"); - while ((s = stdError.readLine()) != null) { - System.out.println(s); - } - - int exitVal = process.waitFor(); - if (exitVal == 0) { - System.out.println("Success!"); - System.out.println(output); - System.exit(0); - } else { - System.out.println("Failure!"); - System.out.println(output); - System.exit(0); - }*/ testFunctionLocalRun(Runtime.GO); }