2828import gov .loc .repository .bagit .exceptions .MissingPayloadManifestException ;
2929import gov .loc .repository .bagit .reader .BagReader ;
3030
31- public class VerifierTest extends Assert {
31+ public class BagVerifierTest extends Assert {
3232 @ Rule
3333 public TemporaryFolder folder = new TemporaryFolder ();
3434
@@ -37,12 +37,12 @@ public class VerifierTest extends Assert{
3737 @ Test
3838 public void testCanQuickVerify () throws Exception {
3939 Bag bag = BagReader .read (rootDir );
40- boolean canQuickVerify = Verifier .canQuickVerify (bag );
40+ boolean canQuickVerify = BagVerifier .canQuickVerify (bag );
4141 assertFalse ("Since " + bag .getRootDir () + " DOES NOT contain the metadata Payload-Oxum then it should return false!" , canQuickVerify );
4242
4343 File passingRootDir = new File (getClass ().getClassLoader ().getResource ("bags/v0_94/bag" ).getFile ());
4444 bag = BagReader .read (passingRootDir );
45- canQuickVerify = Verifier .canQuickVerify (bag );
45+ canQuickVerify = BagVerifier .canQuickVerify (bag );
4646 assertTrue ("Since " + bag .getRootDir () + " DOES contain the metadata Payload-Oxum then it should return true!" , canQuickVerify );
4747 }
4848
@@ -51,23 +51,23 @@ public void testQuickVerify() throws Exception{
5151 File passingRootDir = new File (getClass ().getClassLoader ().getResource ("bags/v0_94/bag" ).getFile ());
5252 Bag bag = BagReader .read (passingRootDir );
5353
54- Verifier .quicklyVerify (bag , true );
54+ BagVerifier .quicklyVerify (bag , true );
5555 }
5656
5757 @ Test (expected =InvalidPayloadOxumException .class )
5858 public void testInvalidByteSizeForQuickVerify () throws Exception {
5959 File badRootDir = new File (getClass ().getClassLoader ().getResource ("badPayloadOxumByteSize/bag" ).getFile ());
6060 Bag bag = BagReader .read (badRootDir );
6161
62- Verifier .quicklyVerify (bag , true );
62+ BagVerifier .quicklyVerify (bag , true );
6363 }
6464
6565 @ Test (expected =InvalidPayloadOxumException .class )
6666 public void testInvalidFileCountForQuickVerify () throws Exception {
6767 File badRootDir = new File (getClass ().getClassLoader ().getResource ("badPayloadOxumFileCount/bag" ).getFile ());
6868 Bag bag = BagReader .read (badRootDir );
6969
70- Verifier .quicklyVerify (bag , true );
70+ BagVerifier .quicklyVerify (bag , true );
7171 }
7272
7373 @ Test
@@ -76,7 +76,7 @@ public void testStandardSupportedAlgorithms() throws Exception{
7676 for (String alg : algorithms ){
7777 StandardSupportedAlgorithms algorithm = StandardSupportedAlgorithms .valueOf (alg .toUpperCase ());
7878 Manifest manifest = new Manifest (algorithm );
79- Verifier .checkHashes (manifest );
79+ BagVerifier .checkHashes (manifest );
8080 }
8181 }
8282
@@ -85,69 +85,69 @@ public void testBagWithTagFilesInPayloadIsValid() throws Exception{
8585 rootDir = new File (getClass ().getClassLoader ().getResource ("bags/v0_96/bag-with-tagfiles-in-payload-manifest" ).getFile ());
8686 Bag bag = BagReader .read (rootDir );
8787
88- Verifier .isValid (bag , true );
88+ BagVerifier .isValid (bag , true );
8989 }
9090
9191 @ Test
9292 public void testVersion0_97IsValid () throws Exception {
9393 Bag bag = BagReader .read (rootDir );
9494
95- Verifier .isValid (bag , true );
95+ BagVerifier .isValid (bag , true );
9696 }
9797
9898 @ Test
9999 public void testVersion0_98IsValid () throws Exception {
100100 rootDir = new File (getClass ().getClassLoader ().getResource ("bags/v0_98/bag" ).getFile ());
101101 Bag bag = BagReader .read (rootDir );
102102
103- Verifier .isValid (bag , true );
103+ BagVerifier .isValid (bag , true );
104104 }
105105
106106 @ Test
107107 public void testIsComplete () throws Exception {
108108 Bag bag = BagReader .read (rootDir );
109109
110- Verifier .isComplete (bag , true );
110+ BagVerifier .isComplete (bag , true );
111111 }
112112
113113 @ Test (expected =FileNotInPayloadDirectoryException .class )
114114 public void testErrorWhenFetchItemsDontExist () throws Exception {
115115 rootDir = new File (getClass ().getClassLoader ().getResource ("bags/v0_96/holey-bag" ).getFile ());
116116 Bag bag = BagReader .read (rootDir );
117117
118- Verifier .isComplete (bag , true );
118+ BagVerifier .isComplete (bag , true );
119119 }
120120
121121 @ Test (expected =FileNotInPayloadDirectoryException .class )
122122 public void testErrorWhenManifestListFileThatDoesntExist () throws Exception {
123123 rootDir = new File (getClass ().getClassLoader ().getResource ("filesInManifestDontExist" ).getFile ());
124124 Bag bag = BagReader .read (rootDir );
125125
126- Verifier .isComplete (bag , true );
126+ BagVerifier .isComplete (bag , true );
127127 }
128128
129129 @ Test (expected =FileNotInManifestException .class )
130130 public void testErrorWhenFileIsntInManifest () throws Exception {
131131 rootDir = new File (getClass ().getClassLoader ().getResource ("filesInPayloadDirAreNotInManifest" ).getFile ());
132132 Bag bag = BagReader .read (rootDir );
133133
134- Verifier .isComplete (bag , true );
134+ BagVerifier .isComplete (bag , true );
135135 }
136136
137137 @ Test (expected =CorruptChecksumException .class )
138138 public void testCorruptPayloadFile () throws Exception {
139139 rootDir = new File (getClass ().getClassLoader ().getResource ("corruptPayloadFile" ).getFile ());
140140 Bag bag = BagReader .read (rootDir );
141141
142- Verifier .isValid (bag , true );
142+ BagVerifier .isValid (bag , true );
143143 }
144144
145145 @ Test (expected =CorruptChecksumException .class )
146146 public void testCorruptTagFile () throws Exception {
147147 rootDir = new File (getClass ().getClassLoader ().getResource ("corruptTagFile" ).getFile ());
148148 Bag bag = BagReader .read (rootDir );
149149
150- Verifier .isValid (bag , true );
150+ BagVerifier .isValid (bag , true );
151151 }
152152
153153 @ Test (expected =MissingBagitFileException .class )
@@ -157,7 +157,7 @@ public void testErrorWhenMissingBagitTextFile() throws Exception{
157157 File bagitFile = new File (folder .getRoot (), "bagit.txt" );
158158 bagitFile .delete ();
159159
160- Verifier .isValid (bag , true );
160+ BagVerifier .isValid (bag , true );
161161 }
162162
163163 @ Test (expected =MissingPayloadDirectoryException .class )
@@ -167,7 +167,7 @@ public void testErrorWhenMissingPayloadDirectory() throws Exception{
167167 File dataDir = new File (folder .getRoot (), "data" );
168168 deleteDirectory (Paths .get (dataDir .toURI ()));
169169
170- Verifier .isValid (bag , true );
170+ BagVerifier .isValid (bag , true );
171171 }
172172
173173 @ Test (expected =MissingPayloadManifestException .class )
@@ -177,7 +177,7 @@ public void testErrorWhenMissingPayloadManifest() throws Exception{
177177 File manifestFile = new File (folder .getRoot (), "manifest-md5.txt" );
178178 manifestFile .delete ();
179179
180- Verifier .isValid (bag , true );
180+ BagVerifier .isValid (bag , true );
181181 }
182182
183183 private void copyBagToTestFolder () throws Exception {
0 commit comments