use of gov.loc.repository.bagit.verify.BagVerifier in project bagit-java by LibraryOfCongress.
the class ReaderWriterVerifierIntegrationTest method testReaderWriterVersion95.
@Test
public void testReaderWriterVersion95() throws Exception {
BagReader reader = new BagReader();
Path rootDir = Paths.get(this.getClass().getClassLoader().getResource("bags/v0_95/bag").toURI());
Bag bag = reader.read(rootDir);
Path outputDir = Paths.get(folder.newFolder().toURI());
BagWriter.write(bag, outputDir);
testBagsEqual(rootDir, outputDir);
try (BagVerifier verifier = new BagVerifier()) {
verifier.isValid(reader.read(outputDir), true);
}
}
use of gov.loc.repository.bagit.verify.BagVerifier in project bagit-java by LibraryOfCongress.
the class ReaderWriterVerifierIntegrationTest method testReaderWriterVersion2_0.
@Test
public void testReaderWriterVersion2_0() throws Exception {
BagReader reader = new BagReader();
Path rootDir = Paths.get(this.getClass().getClassLoader().getResource("bags/v2_0/bag").toURI());
Bag bag = reader.read(rootDir);
Path outputDir = Paths.get(folder.newFolder().toURI());
BagWriter.write(bag, outputDir);
testBagsEqual(rootDir, outputDir);
try (BagVerifier verifier = new BagVerifier()) {
verifier.isValid(reader.read(outputDir), true);
}
}
use of gov.loc.repository.bagit.verify.BagVerifier in project bagit-java by LibraryOfCongress.
the class ReaderWriterVerifierIntegrationTest method testReaderWriterVersion97.
@Test
public void testReaderWriterVersion97() throws Exception {
BagReader reader = new BagReader();
Path rootDir = Paths.get(this.getClass().getClassLoader().getResource("bags/v0_97/bag").toURI());
Bag bag = reader.read(rootDir);
Path outputDir = Paths.get(folder.newFolder().toURI());
BagWriter.write(bag, outputDir);
testBagsEqual(rootDir, outputDir);
try (BagVerifier verifier = new BagVerifier()) {
verifier.isValid(reader.read(outputDir), true);
}
}
use of gov.loc.repository.bagit.verify.BagVerifier in project bagit-java by LibraryOfCongress.
the class ReaderWriterVerifierIntegrationTest method testReaderWriterVersion93.
@Test
public void testReaderWriterVersion93() throws Exception {
try (BagVerifier verifier = new BagVerifier()) {
BagReader reader = new BagReader();
Path rootDir = Paths.get(this.getClass().getClassLoader().getResource("bags/v0_93/bag").toURI());
Path outputDir = Paths.get(folder.newFolder().toURI());
Bag bag = reader.read(rootDir);
verifier.isValid(bag, true);
BagWriter.write(bag, outputDir);
testBagsEqual(rootDir, outputDir);
verifier.isValid(reader.read(outputDir), true);
}
}
use of gov.loc.repository.bagit.verify.BagVerifier in project bagit-java by LibraryOfCongress.
the class ReaderWriterVerifierIntegrationTest method testReaderWriterVersion96.
@Test
public void testReaderWriterVersion96() throws Exception {
BagReader reader = new BagReader();
Path rootDir = Paths.get(this.getClass().getClassLoader().getResource("bags/v0_96/bag").toURI());
Bag bag = reader.read(rootDir);
Path outputDir = Paths.get(folder.newFolder().toURI());
BagWriter.write(bag, outputDir);
testBagsEqual(rootDir, outputDir);
try (BagVerifier verifier = new BagVerifier()) {
verifier.isValid(reader.read(outputDir), true);
}
}
Aggregations