diff options
author | Keuin <[email protected]> | 2021-03-02 13:32:03 +0800 |
---|---|---|
committer | keuin <[email protected]> | 2021-03-02 13:32:03 +0800 |
commit | fa37a5e907d0d167ef139b536b12c745b9189eb8 (patch) | |
tree | f727070ff30a458d210d4c98f865cba1a85b40c3 /src | |
parent | b253823a9e9806bbc5f6aad7f6c82f4fea8bd817 (diff) |
fix bad test
Diffstat (limited to 'src')
-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()); |