store.save();
testStore.save();
@Test public void testManyFiles() throws IOException { Random random = new Random(42L); File root = folder.newFolder(); try (Store store = new Store(root)) { Index index = store.addIndex(0); Archive archive = index.addArchive(0); archive.setNameHash(random.nextInt()); archive.setFileData(new FileData[NUMBER_OF_FILES]); for (int i = 0; i < NUMBER_OF_FILES; ++i) { FileData[] fileData = archive.getFileData(); FileData file = fileData[i] = new FileData(); file.setId(i); file.setNameHash(random.nextInt()); } store.save(); try (Store store2 = new Store(root)) { store2.load(); Assert.assertEquals(store, store2); } } }
store.save();
@Test public void testOneFile() throws IOException { try (Store store = new Store(folder.getRoot())) { Index index = store.addIndex(0); Archive archive = index.addArchive(0); archive.setFileData(new FileData[1]); FileData fileData = archive.getFileData()[0] = new FileData(); fileData.setId(42); fileData.setNameHash(7); store.save(); try (Store store2 = new Store(folder.getRoot())) { store2.load(); Assert.assertEquals(store, store2); } } }
storage.saveArchive(archive2, compressedData); store.save();
storage.saveArchive(archive2, compressedData); store.save();