multi store test, doesnt work

This commit is contained in:
Adam
2015-10-16 18:44:43 -04:00
parent 298d623bbf
commit ad63c9d423

View File

@@ -1,7 +1,7 @@
package net.runelite.cache.fs;
import java.io.IOException;
import java.util.List;
import java.util.Random;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Rule;
@@ -39,4 +39,33 @@ public class StoreTest
}
}
}
@Test
public void testManyFiles() throws IOException
{
Random random = new Random(42L);
try (Store store = new Store(folder.getRoot()))
{
Index index = store.addIndex(0);
Archive archive = index.addArchive(0);
for (int i = 0; i < 2; ++i)
{
File file = archive.addFile(i);
// file.setNameHash(random.nextInt());
byte[] data = new byte[random.nextInt(1024)];
random.nextBytes(data);
file.setContents(data);
}
store.save();
try (Store store2 = new Store(folder.getRoot()))
{
store2.load();
Assert.assertEquals(store, store2);
}
}
}
}