File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/conf Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,9 @@ public class TestConfiguration extends TestCase {
7070 IBM_JAVA ?"<?xml version=\" 1.0\" encoding=\" UTF-8\" ?><configuration>" :
7171 "<?xml version=\" 1.0\" encoding=\" UTF-8\" standalone=\" no\" ?><configuration>" ;
7272
73+ /** Four apostrophes. */
74+ public static final String ESCAPED = "''''" ;
75+
7376 @ Override
7477 protected void setUp () throws Exception {
7578 super .setUp ();
@@ -402,7 +405,18 @@ public void testCommentsInValue() throws IOException {
402405 //two spaces one after "this", one before "contains"
403406 assertEquals ("this contains a comment" , conf .get ("my.comment" ));
404407 }
405-
408+
409+ public void testEscapedCharactersInValue () throws IOException {
410+ out =new BufferedWriter (new FileWriter (CONFIG ));
411+ startConfig ();
412+ appendProperty ("my.comment" , ESCAPED );
413+ endConfig ();
414+ Path fileResource = new Path (CONFIG );
415+ conf .addResource (fileResource );
416+ //two spaces one after "this", one before "contains"
417+ assertEquals ("''''" , conf .get ("my.comment" ));
418+ }
419+
406420 public void testTrim () throws IOException {
407421 out =new BufferedWriter (new FileWriter (CONFIG ));
408422 startConfig ();
You can’t perform that action at this time.
0 commit comments