This commit is contained in:
Jörg Prante 2022-10-17 09:32:13 +02:00
parent 3eebd674ea
commit 1abe90fdd1
2 changed files with 2 additions and 12 deletions

View file

@ -3,12 +3,3 @@ name = marc
version = 2.7.0 version = 2.7.0
org.gradle.warning.mode = ALL org.gradle.warning.mode = ALL
gradle.wrapper.version = 7.5.1
xbib-content.version = 4.0.0
xbib-bibliographic-character-sets.version = 2.0.0
xalan.version = 2.7.2
xmlunit-matchers.version = 2.8.4
system-rules.version = 1.19.0
mockito.version = 3.3.3
marc4j.version = 2.9.2
junit.version = 5.8.2

View file

@ -16,7 +16,6 @@
package org.xbib.marc; package org.xbib.marc;
import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail; import static org.junit.jupiter.api.Assertions.fail;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import java.io.IOException; import java.io.IOException;
@ -85,7 +84,7 @@ public class StreamMatcher {
assertStream("step 2 " + path2, path2, cl.getResource(resourceName).openStream()); assertStream("step 2 " + path2, path2, cl.getResource(resourceName).openStream());
logger.log(Level.INFO, "step 2: success"); logger.log(Level.INFO, "step 2: success");
} finally { } finally {
//Files.delete(path2); Files.delete(path2);
} }
} finally { } finally {
Files.delete(path1); Files.delete(path1);
@ -103,7 +102,6 @@ public class StreamMatcher {
OutputStream outputStream2 = Files.newOutputStream(path2)) { OutputStream outputStream2 = Files.newOutputStream(path2)) {
producer1.produce(inputStream1, outputStream1); producer1.produce(inputStream1, outputStream1);
producer2.produce(inputStream2, outputStream2); producer2.produce(inputStream2, outputStream2);
//assertStream("comparing " + path1 + " and " + path2, path1, path2);
assertThat("XML check of " + path1, path1, CompareMatcher.isIdenticalTo(cl.getResource(resourceName + suffix1).openStream())); assertThat("XML check of " + path1, path1, CompareMatcher.isIdenticalTo(cl.getResource(resourceName + suffix1).openStream()));
assertThat("XML check of " + path2, path2, CompareMatcher.isIdenticalTo(cl.getResource(resourceName + suffix2).openStream())); assertThat("XML check of " + path2, path2, CompareMatcher.isIdenticalTo(cl.getResource(resourceName + suffix2).openStream()));
} finally { } finally {
@ -120,6 +118,7 @@ public class StreamMatcher {
producer.produce(inputStream, outputStream); producer.produce(inputStream, outputStream);
} }
} }
public static void assertStream(String name, Path path1, Path path2) throws IOException { public static void assertStream(String name, Path path1, Path path2) throws IOException {
assertStream(name, Files.newInputStream(path1), Files.newInputStream(path2)); assertStream(name, Files.newInputStream(path1), Files.newInputStream(path2));
} }