File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed
main/java/org/xmlunit/builder
test/java/org/xmlunit/builder Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -150,6 +150,8 @@ public static Builder from(Object object) {
150
150
xml = Input .fromChannel ((ReadableByteChannel ) object );
151
151
} else if (object instanceof Path ) {
152
152
xml = Input .fromPath ((Path ) object );
153
+ } else if (object instanceof Reader ) {
154
+ xml = Input .fromReader ((Reader ) object );
153
155
} else {
154
156
// assume it is a JaxB-Object.
155
157
xml = Input .fromJaxb (object );
Original file line number Diff line number Diff line change @@ -164,6 +164,10 @@ private static Document parse(Source s) throws Exception {
164
164
FileChannel fc = is .getChannel ()) {
165
165
allIsWellFor (Input .from (fc ).build ());
166
166
}
167
+ //from Reader
168
+ try (FileReader r = new FileReader (TestResources .ANIMAL_FILE )) {
169
+ allIsWellFor (Input .from (r ).build ());
170
+ }
167
171
// from Path
168
172
allIsWellFor (Input .from (new File (TestResources .ANIMAL_FILE ).toPath ()).build ());
169
173
}
You can’t perform that action at this time.
0 commit comments