goiri commented on a change in pull request #1737: HDFS-14522. Allow compact 
property description in xml in httpfs.
URL: https://github.com/apache/hadoop/pull/1737#discussion_r355081871
 
 

 ##########
 File path: 
hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/util/TestConfigurationUtils.java
 ##########
 @@ -129,20 +127,14 @@ public void testVarResolutionAndSysProps() {
 
   @Test
   public void testCompactFormatProperty() throws IOException {
+    final String TESTFILE = "test-compact-format-property.xml";
     Configuration conf = new Configuration(false);
     assertEquals(conf.size(), 0);
-    StringWriter writer = new StringWriter();
-    BufferedWriter out = new BufferedWriter(writer);
-    out.write("<?xml version=\"1.0\"?>\n");
-    out.write("<configuration>\n");
-    out.write("<property name=\"key1\" value=\"val1\"/>");
-    out.write("</configuration>\n");
-    out.flush();
-    out.close();
-    InputStream is = new ByteArrayInputStream(writer.toString().getBytes());
-    conf = new Configuration(false);
-    ConfigurationUtils.load(conf, is);
-    assertEquals(conf.size(), 1);
-    assertEquals(conf.get("key1"), "val1");
+    ConfigurationUtils.load(conf,
+        Thread.currentThread()
+            .getContextClassLoader().getResource(TESTFILE).openStream());
+    assertEquals(conf.size(), 2);
 
 Review comment:
   These asserts are revert (also 132).

----------------------------------------------------------------
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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to