This is an automated email from the ASF dual-hosted git repository.
yangzhou pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-streampark.git
The following commit(s) were added to refs/heads/dev by this push:
new 07d3700f5 [improve] testcase improve (#1653)
07d3700f5 is described below
commit 07d3700f57a2793ffb360f0882b664e00c93249e
Author: benjobs <[email protected]>
AuthorDate: Tue Sep 20 10:34:05 2022 +0800
[improve] testcase improve (#1653)
* get jobId bug fixed.
* [improve] testcase improve
---
...{ParamAppTest.scala => ParameterTestCase.scala} | 41 +++++++++++++---------
1 file changed, 24 insertions(+), 17 deletions(-)
diff --git
a/streampark-flink/streampark-flink-submit/streampark-flink-submit-core/src/test/scala/org/apache/streampark/flink/submit/test/ParamAppTest.scala
b/streampark-flink/streampark-flink-submit/streampark-flink-submit-core/src/test/scala/org/apache/streampark/flink/submit/test/ParameterTestCase.scala
similarity index 54%
rename from
streampark-flink/streampark-flink-submit/streampark-flink-submit-core/src/test/scala/org/apache/streampark/flink/submit/test/ParamAppTest.scala
rename to
streampark-flink/streampark-flink-submit/streampark-flink-submit-core/src/test/scala/org/apache/streampark/flink/submit/test/ParameterTestCase.scala
index eef4937ca..a74fa5826 100644
---
a/streampark-flink/streampark-flink-submit/streampark-flink-submit-core/src/test/scala/org/apache/streampark/flink/submit/test/ParamAppTest.scala
+++
b/streampark-flink/streampark-flink-submit/streampark-flink-submit-core/src/test/scala/org/apache/streampark/flink/submit/test/ParameterTestCase.scala
@@ -17,22 +17,29 @@
package org.apache.streampark.flink.submit.test
import org.apache.flink.api.java.utils.ParameterTool
+import org.junit.jupiter.api.{Assertions, Test}
+
+class ParameterTestCase {
+
+ @Test def readArgs():Unit = {
+ val arg = Array(
+ "--flink.deployment.option.parallelism",
+ "10"
+ )
+ val args = Array(
+ "--flink.home",
+ "hdfs://nameservice1/streampark/flink/flink-1.11.1",
+ "--app.name",
+ "testApp123",
+ "--flink.deployment.option.parallelism",
+ "5"
+ )
+ val param =
ParameterTool.fromArgs(arg).mergeWith(ParameterTool.fromArgs(args))
+
+ Assertions.assertEquals(param.get("flink.home"),
"hdfs://nameservice1/streampark/flink/flink-1.11.1")
+ Assertions.assertEquals(param.get("app.name"), "testApp123")
+ Assertions.assertEquals(param.get("flink.deployment.option.parallelism"),
"5")
+
+ }
-object ParamAppTest extends App {
- val arg = Array(
- "--flink.deployment.option.parallelism",
- "10"
- )
- val argsx = Array(
- "--flink.home",
- "hdfs://nameservice1/streampark/flink/flink-1.11.1",
- "--app.name",
- "testApp123",
- "--flink.deployment.option.parallelism",
- "5"
- )
- val param =
ParameterTool.fromArgs(arg).mergeWith(ParameterTool.fromArgs(argsx))
- // scalastyle:off println
- println(param)
- // scalastyle:on println
}