Search in sources :

Example 6 with BagVerifier

use of gov.loc.repository.bagit.verify.BagVerifier in project bagit-java by LibraryOfCongress.

the class ReaderWriterVerifierIntegrationTest method testReaderWriterVersion94.

@Test
public void testReaderWriterVersion94() throws Exception {
    BagReader reader = new BagReader();
    Path rootDir = Paths.get(this.getClass().getClassLoader().getResource("bags/v0_94/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);
    }
}
Also used : Path(java.nio.file.Path) BagVerifier(gov.loc.repository.bagit.verify.BagVerifier) BagReader(gov.loc.repository.bagit.reader.BagReader) Bag(gov.loc.repository.bagit.domain.Bag) Test(org.junit.Test)

Aggregations

Bag (gov.loc.repository.bagit.domain.Bag)6 BagReader (gov.loc.repository.bagit.reader.BagReader)6 BagVerifier (gov.loc.repository.bagit.verify.BagVerifier)6 Path (java.nio.file.Path)6 Test (org.junit.Test)6