File tree 1 file changed +16
-1
lines changed
src/test/java/org/codehaus/plexus/util/xml
1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 18
18
19
19
import static org .junit .Assert .assertEquals ;
20
20
21
+ import java .io .IOException ;
21
22
import java .io .StringReader ;
22
23
23
24
import org .codehaus .plexus .util .xml .pull .XmlPullParser ;
25
+ import org .codehaus .plexus .util .xml .pull .XmlPullParserException ;
24
26
import org .junit .Test ;
25
27
26
28
/**
@@ -111,7 +113,20 @@ public void testCombineKeys()
111
113
assertEquals ( "RHS" , mergeResult .getChildren ( "property" )[2 ].getChild ( "value" ).getValue () );
112
114
assertEquals ( "right" , p2 .getChild ( "value" ).getInputLocation () );
113
115
}
114
-
116
+
117
+ @ Test
118
+ public void testOverwriteDominantBlankValue () throws XmlPullParserException , IOException {
119
+ String lhs = "<parameter xml:space=\" preserve\" > </parameter>" ;
120
+
121
+ String rhs = "<parameter>recessive</parameter>" ;
122
+
123
+ Xpp3Dom leftDom = Xpp3DomBuilder .build ( new StringReader ( lhs ), new FixedInputLocationBuilder ( "left" ) );
124
+ Xpp3Dom rightDom = Xpp3DomBuilder .build ( new StringReader ( rhs ), new FixedInputLocationBuilder ( "right" ) );
125
+
126
+ Xpp3Dom mergeResult = Xpp3DomUtils .mergeXpp3Dom ( leftDom , rightDom , true );
127
+ assertEquals ( " " , mergeResult .getValue () );
128
+ }
129
+
115
130
private static class FixedInputLocationBuilder
116
131
implements Xpp3DomBuilder .InputLocationBuilder
117
132
{
You can’t perform that action at this time.
0 commit comments