diff options
author | Keuin <[email protected]> | 2021-01-23 14:10:32 +0800 |
---|---|---|
committer | keuin <[email protected]> | 2021-01-23 14:10:32 +0800 |
commit | 4a1d885afa7217b47d6183488c3dc6537cef05b6 (patch) | |
tree | 1b499db6b834cb0709029e30c0d52c0ddf200ffa /src/test/java/com/keuin/kbackupfabric/backup/incremental/ObjectCollectionSerializerTest.java | |
parent | 4ac575330130ac4e1b4b35386ffc0aacd431a5a4 (diff) |
Version 1.4.6 (preview): added metadata for incremental backup (need integrated test and display implementation)
Diffstat (limited to 'src/test/java/com/keuin/kbackupfabric/backup/incremental/ObjectCollectionSerializerTest.java')
-rw-r--r-- | src/test/java/com/keuin/kbackupfabric/backup/incremental/ObjectCollectionSerializerTest.java | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/src/test/java/com/keuin/kbackupfabric/backup/incremental/ObjectCollectionSerializerTest.java b/src/test/java/com/keuin/kbackupfabric/backup/incremental/ObjectCollectionSerializerTest.java deleted file mode 100644 index d21e5b3..0000000 --- a/src/test/java/com/keuin/kbackupfabric/backup/incremental/ObjectCollectionSerializerTest.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.keuin.kbackupfabric.backup.incremental; - -import com.keuin.kbackupfabric.backup.incremental.identifier.Sha256Identifier; -import org.junit.Test; - -import java.io.File; -import java.io.IOException; -import java.nio.file.Files; - -import static org.junit.Assert.assertEquals; - -public class ObjectCollectionSerializerTest { - - @Test - public void testSerializationConsistency1() throws IOException { - testSerializationConsistency(1, 0); - } - - @Test - public void testSerializationConsistency2() throws IOException { - testSerializationConsistency(2, 0); - } - - @Test - public void testSerializationConsistency4() throws IOException { - testSerializationConsistency(4, 0); - } - - @Test - public void testSerializationConsistency8() throws IOException { - testSerializationConsistency(8, 0); - } - - @Test - public void testSerializationConsistency1A() throws IOException { - testSerializationConsistency(1, 1000); - } - - @Test - public void testSerializationConsistency2A() throws IOException { - testSerializationConsistency(2, 1000); - } - - @Test - public void testSerializationConsistency4A() throws IOException { - testSerializationConsistency(4, 1000); - } - - @Test - public void testSerializationConsistency8A() throws IOException { - testSerializationConsistency(8, 1000); - } - - public void testSerializationConsistency(int threads, int multiThreadThreshold) throws IOException { - ObjectCollectionFactory<Sha256Identifier> factory = - new ObjectCollectionFactory<>(Sha256Identifier.getFactory(), threads, multiThreadThreshold); - ObjectCollection collection = - factory.fromDirectory(new File("./testfile/ObjectCollectionFactoryTest")); - File file = new File("./testfile/serialized"); - if (file.exists()) { - Files.delete(file.toPath()); - } - ObjectCollectionSerializer.toFile(collection, file); - ObjectCollection collection2 = ObjectCollectionSerializer.fromFile(file); - Files.delete(file.toPath()); - assertEquals(collection, collection2); - } - -}
\ No newline at end of file |