diff options
Diffstat (limited to 'src/test/java/com/keuin/kbackupfabric/backup/incremental/ObjectCollectionFactoryTest.java')
-rw-r--r-- | src/test/java/com/keuin/kbackupfabric/backup/incremental/ObjectCollectionFactoryTest.java | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/test/java/com/keuin/kbackupfabric/backup/incremental/ObjectCollectionFactoryTest.java b/src/test/java/com/keuin/kbackupfabric/backup/incremental/ObjectCollectionFactoryTest.java index e686e30..4548c65 100644 --- a/src/test/java/com/keuin/kbackupfabric/backup/incremental/ObjectCollectionFactoryTest.java +++ b/src/test/java/com/keuin/kbackupfabric/backup/incremental/ObjectCollectionFactoryTest.java @@ -65,11 +65,23 @@ public class ObjectCollectionFactoryTest { } public void fromDirectory(int threads, int multiThreadThreshold) { + + final String testRoot = "./testfile/ObjectCollectionFactoryTest"; + File[] paths = new File[]{ + new File(testRoot + "/1/12"), + new File(testRoot + "/2"), + new File(testRoot + "/3") + }; + for (File f : paths) { + assertTrue("Failed to create directory: " + f.getAbsolutePath(), + f.isDirectory() || f.mkdirs()); + } + try { ObjectCollectionFactory<Sha256Identifier> factory = new ObjectCollectionFactory<>(Sha256Identifier.getFactory(), threads, multiThreadThreshold); ObjectCollection2 collection = - factory.fromDirectory(new File("./testfile/ObjectCollectionFactoryTest")); + factory.fromDirectory(new File(testRoot)); assertEquals("ObjectCollectionFactoryTest", collection.getName()); assertEquals(3, collection.getSubCollectionMap().size()); |