File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed
src/main/java/com/powsybl/commons/test Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 6464 <artifactId >slf4j-api</artifactId >
6565 <scope >compile</scope >
6666 </dependency >
67+ <dependency >
68+ <groupId >commons-io</groupId >
69+ <artifactId >commons-io</artifactId >
70+ </dependency >
6771 </dependencies >
6872</project >
Original file line number Diff line number Diff line change 88package com .powsybl .commons .test ;
99
1010import com .google .common .io .ByteStreams ;
11+ import org .apache .commons .io .FileUtils ;
1112import org .slf4j .Logger ;
1213import org .slf4j .LoggerFactory ;
13- import org .xmlunit .builder .DiffBuilder ;
14- import org .xmlunit .diff .Diff ;
1514
1615import java .io .*;
1716import java .nio .charset .StandardCharsets ;
@@ -33,12 +32,24 @@ private ComparisonUtils() {
3332 }
3433
3534 public static void assertXmlEquals (InputStream expected , InputStream actual ) {
35+ /*
3636 Diff myDiff = DiffBuilder.compare(expected).withTest(actual).ignoreWhitespace().ignoreComments().build();
3737 boolean hasDiff = myDiff.hasDifferences();
3838 if (hasDiff) {
3939 LOGGER.error("{}", myDiff);
4040 }
4141 assertFalse(hasDiff);
42+ */
43+ try {
44+ File expectedFile = new File ("expectedFile.xml" );
45+ FileUtils .copyInputStreamToFile (expected , expectedFile );
46+ File actualFile = new File ("actualFile.xml" );
47+ FileUtils .copyInputStreamToFile (actual , actualFile );
48+ //Returns true if the files contains the same bytes.
49+ com .google .common .io .Files .equal (actualFile , expectedFile );
50+ } catch (IOException e ) {
51+ throw new UncheckedIOException (e );
52+ }
4253 }
4354
4455 public static void assertTxtEquals (Path expected , Path actual ) {
You can’t perform that action at this time.
0 commit comments