|
1 | 1 | package org.jabref.logic.exporter;
|
2 | 2 |
|
3 | 3 | import java.io.IOException;
|
| 4 | +import java.io.InputStream; |
4 | 5 | import java.net.URISyntaxException;
|
5 | 6 | import java.nio.charset.Charset;
|
6 | 7 | import java.nio.charset.StandardCharsets;
|
@@ -72,15 +73,18 @@ void performExportForSingleEntry(@TempDir Path testFolder) throws IOException, S
|
72 | 73 | unzipContentXml(zipPath, testFolder.resolve(unzipFolder));
|
73 | 74 | Path contentXmlPath = unzipFolder.resolve("content.xml");
|
74 | 75 |
|
75 |
| - Input.Builder control = Input.from(Files.newInputStream(xmlFile)); |
76 |
| - Input.Builder test = Input.from(Files.newInputStream(contentXmlPath)); |
77 | 76 | // for debugging purposes
|
78 |
| - // Path testPath = xmlFile.resolveSibling("test.xml"); |
79 |
| - // Files.copy(Files.newInputStream(contentXmlPath), testPath, StandardCopyOption.REPLACE_EXISTING); |
80 |
| - |
81 |
| - assertThat(test, CompareMatcher.isSimilarTo(control) |
82 |
| - .normalizeWhitespace() |
83 |
| - .withNodeMatcher(new DefaultNodeMatcher(ElementSelectors.byNameAndText)).throwComparisonFailure()); |
| 77 | + // Files.copy(contentXmlPath, xmlFile.resolveSibling("test.xml"), StandardCopyOption.REPLACE_EXISTING); |
| 78 | + |
| 79 | + try (InputStream xmlFileInputStream = Files.newInputStream(xmlFile); |
| 80 | + InputStream contentXmlInputStream = Files.newInputStream(contentXmlPath); |
| 81 | + ) { |
| 82 | + Input.Builder control = Input.from(xmlFileInputStream); |
| 83 | + Input.Builder test = Input.from(contentXmlInputStream); |
| 84 | + assertThat(test, CompareMatcher.isSimilarTo(control) |
| 85 | + .normalizeWhitespace() |
| 86 | + .withNodeMatcher(new DefaultNodeMatcher(ElementSelectors.byNameAndText)).throwComparisonFailure()); |
| 87 | + } |
84 | 88 | }
|
85 | 89 |
|
86 | 90 | private static void unzipContentXml(Path zipFile, Path unzipFolder) throws IOException {
|
|
0 commit comments