TisonKun commented on a change in pull request #9541: 
[FLINK-13828][configuration] Deprecate ConfigConstants.LOCAL_START_WEBSERVER
URL: https://github.com/apache/flink/pull/9541#discussion_r318634860
 
 

 ##########
 File path: 
flink-runtime-web/src/test/java/org/apache/flink/runtime/webmonitor/WebFrontendITCase.java
 ##########
 @@ -209,45 +198,37 @@ public void getLogAndStdoutFiles() throws Exception {
        }
 
        @Test
-       public void getTaskManagerLogAndStdoutFiles() {
-               try {
-                       String json = 
TestBaseUtils.getFromHTTP("http://localhost:"; + getRestPort() + 
"/taskmanagers/");
+       public void getTaskManagerLogAndStdoutFiles() throws Exception {
+               String json = TestBaseUtils.getFromHTTP("http://localhost:"; + 
getRestPort() + "/taskmanagers/");
 
-                       ObjectMapper mapper = new ObjectMapper();
-                       JsonNode parsed = mapper.readTree(json);
-                       ArrayNode taskManagers = (ArrayNode) 
parsed.get("taskmanagers");
-                       JsonNode taskManager = taskManagers.get(0);
-                       String id = taskManager.get("id").asText();
+               ObjectMapper mapper = new ObjectMapper();
+               JsonNode parsed = mapper.readTree(json);
+               ArrayNode taskManagers = (ArrayNode) parsed.get("taskmanagers");
+               JsonNode taskManager = taskManagers.get(0);
+               String id = taskManager.get("id").asText();
 
-                       WebMonitorUtils.LogFileLocation logFiles = 
WebMonitorUtils.LogFileLocation.find(CLUSTER_CONFIGURATION);
+               WebMonitorUtils.LogFileLocation logFiles = 
WebMonitorUtils.LogFileLocation.find(CLUSTER_CONFIGURATION);
 
-                       //we check for job manager log files, since no separate 
taskmanager logs exist
-                       FileUtils.writeStringToFile(logFiles.logFile, "job 
manager log");
-                       String logs = 
TestBaseUtils.getFromHTTP("http://localhost:"; + getRestPort() + 
"/taskmanagers/" + id + "/log");
-                       assertTrue(logs.contains("job manager log"));
+               //we check for job manager log files, since no separate 
taskmanager logs exist
+               FileUtils.writeStringToFile(logFiles.logFile, "job manager 
log");
+               String logs = TestBaseUtils.getFromHTTP("http://localhost:"; + 
getRestPort() + "/taskmanagers/" + id + "/log");
+               assertTrue(logs.contains("job manager log"));
 
-                       FileUtils.writeStringToFile(logFiles.stdOutFile, "job 
manager out");
-                       logs = TestBaseUtils.getFromHTTP("http://localhost:"; + 
getRestPort() + "/taskmanagers/" + id + "/stdout");
-                       assertTrue(logs.contains("job manager out"));
-               } catch (Exception e) {
-                       e.printStackTrace();
-                       fail(e.getMessage());
-               }
+               FileUtils.writeStringToFile(logFiles.stdOutFile, "job manager 
out");
+               logs = TestBaseUtils.getFromHTTP("http://localhost:"; + 
getRestPort() + "/taskmanagers/" + id + "/stdout");
+               assertTrue(logs.contains("job manager out"));
        }
 
        @Test
-       public void getConfiguration() {
-               try {
-                       String config = 
TestBaseUtils.getFromHTTP("http://localhost:"; + getRestPort() + 
"/jobmanager/config");
+       public void getConfiguration() throws Exception {
+               String config = TestBaseUtils.getFromHTTP("http://localhost:"; + 
getRestPort() + "/jobmanager/config");
+               Map<String, String> conf = 
WebMonitorUtils.fromKeyValueJsonArray(config);
 
-                       Map<String, String> conf = 
WebMonitorUtils.fromKeyValueJsonArray(config);
-                       assertEquals(
-                               
CLUSTER_CONFIGURATION.getString(ConfigConstants.LOCAL_START_WEBSERVER, null),
-                               
conf.get(ConfigConstants.LOCAL_START_WEBSERVER));
-               } catch (Exception e) {
-                       e.printStackTrace();
-                       fail(e.getMessage());
-               }
+               String expected = 
CLUSTER_CONFIGURATION.getString(TaskManagerOptions.MANAGED_MEMORY_SIZE);
+               String actual = 
conf.get(TaskManagerOptions.MANAGED_MEMORY_SIZE.key());
+
+               assertNotNull(actual);
 
 Review comment:
   I think this prevent the case `null == null` but if we add comment above and 
assume we always set `TaskManagerOptions.MANAGED_MEMORY_SIZE` I agree with can 
remove this one.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to