/** * Verify that uploading more than one ARC file works as expected and deletes the files locally. */ @Test public void testMainSeveralFiles() { Upload.main(new String[] {TestInfo.ARC1.getAbsolutePath(), TestInfo.ARC2.getAbsolutePath()}); assertMsgCount(2, 0); assertStoreStatus(0, TestInfo.ARC1, true); assertStoreStatus(1, TestInfo.ARC2, true); }
/** * Verify that the system fails as expected when the store operation fails on the server side. * (Local files must NOT be deleted). */ @Test public void testMainStoreFails2() { marc.failOnFile(TestInfo.ARC2.getName()); Upload.main( new String[] { TestInfo.ARC1.getAbsolutePath(), TestInfo.ARC2.getAbsolutePath(), TestInfo.ARC3.getAbsolutePath() }); assertMsgCount(2, 1); int index = 0; assertStoreStatus(index, TestInfo.ARC1, true); index++; for (int i = 0; i < storeRetries; i++) { assertStoreStatus(index, TestInfo.ARC2, false); index++; } assertStoreStatus(index, TestInfo.ARC3, true); }