Github user chiwanpark commented on a diff in the pull request:
https://github.com/apache/flink/pull/1106#discussion_r40801825
--- Diff:
flink-staging/flink-scala-shell/src/test/scala/org/apache/flink/api/scala/ScalaShellITSuite.scala
---
@@ -225,6 +220,52 @@ class ScalaShellITSuite extends FunSuite with Matchers
with BeforeAndAfterAll {
out.toString + stdout
}
+ /**
+ * tests flink shell startup with remote cluster (starts cluster
internally)
+ */
+ test("start flink scala shell with remote cluster") {
+
+ val input: String = "val els = env.fromElements(\"a\",\"b\");\n" +
+ "els.print\nError\n:q\n"
+
+ val in: BufferedReader = new BufferedReader(
+ new StringReader(
+ input + "\n"))
+ val out: StringWriter = new StringWriter
+
+ val baos: ByteArrayOutputStream = new ByteArrayOutputStream
+ val oldOut: PrintStream = System.out
+ System.setOut(new PrintStream(baos))
+ val c = cluster.getOrElse(null);
+ var args : Array[String] = null;
+ if(c != null){
+ args = Array("remote",
+ c.hostname,
+ Integer.toString(c.getLeaderRPCPort))
+ }
+ else{
+ assert(false)
+ }
+
+ //start scala shell with initialized
+ // buffered reader for testing
+ FlinkShell.bufferedReader = in;
+ FlinkShell.main(args)
+ baos.flush
+
+ val output: String = baos.toString
+ System.setOut(oldOut)
+
+ assert(output.contains("Job execution switched to status FINISHED."))
+ assert(output.contains("a\nb"))
+
+ assert((!output.contains("Error")))
+ assert((!output.contains("ERROR")))
+ assert((!output.contains("Exception")))
+ assert((!output.contains("failed")))
--- End diff --
These assert statements contain unnecessary parentheses.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---