From 3f4b20ad6f4bc0047e5b95fb4ada7f2c03e34f51 Mon Sep 17 00:00:00 2001 From: Keuin Date: Wed, 13 Jan 2021 20:11:32 +0800 Subject: Fix test --- .../backup/method/ConfiguredIncrementalBackupMethodTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/java/com/keuin/kbackupfabric/operation/backup/method/ConfiguredIncrementalBackupMethodTest.java b/src/test/java/com/keuin/kbackupfabric/operation/backup/method/ConfiguredIncrementalBackupMethodTest.java index 7e4f267..10b40f7 100644 --- a/src/test/java/com/keuin/kbackupfabric/operation/backup/method/ConfiguredIncrementalBackupMethodTest.java +++ b/src/test/java/com/keuin/kbackupfabric/operation/backup/method/ConfiguredIncrementalBackupMethodTest.java @@ -20,7 +20,7 @@ public class ConfiguredIncrementalBackupMethodTest { private final String indexFileName = "index"; private final double directoryFactor = 0.4; - private final double fileFactor = 0.1; + private final double fileFactor = 0.02; private final int maxRandomFileSizeBytes = 1024 * 1024; private final Function scaleDecayFunc = (x) -> x - 1; @@ -94,7 +94,7 @@ public class ConfiguredIncrementalBackupMethodTest { for (int i = 0; i < subFileCount; i++) { String subFile = null; while (subFile == null || new File(path, subFile).exists()) - subFile = getRandomString((int) (Math.random() * 16 + 1)); + subFile = getRandomString((int) (Math.random() * 16 + 4)); createRandomFile(new File(path, subFile), maxRandomFileSizeBytes); } @@ -103,7 +103,7 @@ public class ConfiguredIncrementalBackupMethodTest { for (int i = 0; i < subDirCount; i++) { String subDir = null; while (subDir == null || new File(path, subDir).exists()) - subDir = getRandomString((int) (Math.random() * 16 + 1)); + subDir = getRandomString((int) (Math.random() * 16 + 4)); createRandomDirectoryTree(new File(path, subDir).getAbsolutePath(), scaleDecayFunc.apply(scale)); } } -- cgit v1.2.3 From 1534e62557098bb72129bee16b84d2eb527a34be Mon Sep 17 00:00:00 2001 From: Keuin Date: Thu, 14 Jan 2021 10:33:32 +0800 Subject: Improve test --- .../backup/method/ConfiguredIncrementalBackupMethodTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/java/com/keuin/kbackupfabric/operation/backup/method/ConfiguredIncrementalBackupMethodTest.java b/src/test/java/com/keuin/kbackupfabric/operation/backup/method/ConfiguredIncrementalBackupMethodTest.java index 10b40f7..fa0079d 100644 --- a/src/test/java/com/keuin/kbackupfabric/operation/backup/method/ConfiguredIncrementalBackupMethodTest.java +++ b/src/test/java/com/keuin/kbackupfabric/operation/backup/method/ConfiguredIncrementalBackupMethodTest.java @@ -19,7 +19,7 @@ public class ConfiguredIncrementalBackupMethodTest { private final String destDirectoryName = "destination"; private final String indexFileName = "index"; - private final double directoryFactor = 0.4; + private final double directoryFactor = 0.1; private final double fileFactor = 0.02; private final int maxRandomFileSizeBytes = 1024 * 1024; private final Function scaleDecayFunc = (x) -> x - 1; @@ -94,7 +94,7 @@ public class ConfiguredIncrementalBackupMethodTest { for (int i = 0; i < subFileCount; i++) { String subFile = null; while (subFile == null || new File(path, subFile).exists()) - subFile = getRandomString((int) (Math.random() * 16 + 4)); + subFile = getRandomString((int) (Math.random() * 16 + 5)); createRandomFile(new File(path, subFile), maxRandomFileSizeBytes); } @@ -103,7 +103,7 @@ public class ConfiguredIncrementalBackupMethodTest { for (int i = 0; i < subDirCount; i++) { String subDir = null; while (subDir == null || new File(path, subDir).exists()) - subDir = getRandomString((int) (Math.random() * 16 + 4)); + subDir = getRandomString((int) (Math.random() * 16 + 5)); createRandomDirectoryTree(new File(path, subDir).getAbsolutePath(), scaleDecayFunc.apply(scale)); } } -- cgit v1.2.3