zentol commented on a change in pull request #11361: [FLINK-15727] Let
BashJavaUtils return dynamic configs and JVM parame…
URL: https://github.com/apache/flink/pull/11361#discussion_r390928769
##########
File path:
flink-dist/src/test/java/org/apache/flink/dist/BashJavaUtilsITCase.java
##########
@@ -36,32 +37,13 @@
private static final String RUN_BASH_JAVA_UTILS_CMD_SCRIPT =
"src/test/bin/runBashJavaUtilsCmd.sh";
- /**
- * Executes the given shell script wrapper and returns the last line.
- */
- private String executeScriptAndFetchLastLine(final String command)
throws IOException {
- String[] commands = {RUN_BASH_JAVA_UTILS_CMD_SCRIPT, command};
- String[] lines =
executeScript(commands).split(System.lineSeparator());
- if (lines.length == 0) {
- return "";
- } else {
- return lines[lines.length - 1];
- }
- }
-
- @Test
- public void testGetTmResourceDynamicConfigs() throws Exception {
- String result =
executeScriptAndFetchLastLine(BashJavaUtils.Command.GET_TM_RESOURCE_DYNAMIC_CONFIGS.toString());
-
- assertNotNull(result);
- ConfigurationUtils.parseTmResourceDynamicConfigs(result);
- }
-
@Test
- public void testGetTmResourceJvmParams() throws Exception {
- String result =
executeScriptAndFetchLastLine(BashJavaUtils.Command.GET_TM_RESOURCE_JVM_PARAMS.toString());
+ public void testGetTmResourceParamsConfigs() throws Exception {
+ String[] commands = {RUN_BASH_JAVA_UTILS_CMD_SCRIPT,
BashJavaUtils.Command.GET_TM_RESOURCE_PARAMS.toString()};
+ List<String> lines =
Arrays.asList(executeScript(commands).split(System.lineSeparator()));
- assertNotNull(result);
- ConfigurationUtils.parseTmResourceJvmParams(result);
+ assertTrue(lines.size() >= 2);
Review comment:
shouldn't this be _exactly_ 2 lines? (and if so, use assertEquals)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services