diff options
author | 2023-07-21 20:27:30 +0200 | |
---|---|---|
committer | 2023-07-21 20:27:30 +0200 | |
commit | a6dcff6293e960b420e26c57374a281467821556 (patch) | |
tree | 76fe949d03cc2603febb3057261ef365d476e52c /subprojects/store/src/test/java | |
parent | Fixing long-standing bug with state based diff cursor. (diff) | |
download | refinery-a6dcff6293e960b420e26c57374a281467821556.tar.gz refinery-a6dcff6293e960b420e26c57374a281467821556.tar.zst refinery-a6dcff6293e960b420e26c57374a281467821556.zip |
VersionedMapStoreFactoryBuilder.java is introduced, all tests are updated.
VersionedMapStoreBuilder.java is removed.
Diffstat (limited to 'subprojects/store/src/test/java')
10 files changed, 102 insertions, 105 deletions
diff --git a/subprojects/store/src/test/java/tools/refinery/store/map/tests/InOrderCursorTest.java b/subprojects/store/src/test/java/tools/refinery/store/map/tests/InOrderCursorTest.java index 05cf5a74..993e5531 100644 --- a/subprojects/store/src/test/java/tools/refinery/store/map/tests/InOrderCursorTest.java +++ b/subprojects/store/src/test/java/tools/refinery/store/map/tests/InOrderCursorTest.java | |||
@@ -1,7 +1,8 @@ | |||
1 | package tools.refinery.store.map.tests; | 1 | package tools.refinery.store.map.tests; |
2 | 2 | ||
3 | import org.junit.jupiter.api.Test; | 3 | import org.junit.jupiter.api.Test; |
4 | import tools.refinery.store.map.VersionedMapStoreBuilder; | 4 | import tools.refinery.store.map.VersionedMapStore; |
5 | import tools.refinery.store.map.VersionedMapStoreFactoryBuilder; | ||
5 | import tools.refinery.store.map.internal.InOrderMapCursor; | 6 | import tools.refinery.store.map.internal.InOrderMapCursor; |
6 | import tools.refinery.store.map.internal.VersionedMapImpl; | 7 | import tools.refinery.store.map.internal.VersionedMapImpl; |
7 | import tools.refinery.store.map.tests.utils.MapTestEnvironment; | 8 | import tools.refinery.store.map.tests.utils.MapTestEnvironment; |
@@ -11,13 +12,14 @@ import static org.junit.jupiter.api.Assertions.*; | |||
11 | class InOrderCursorTest { | 12 | class InOrderCursorTest { |
12 | @Test | 13 | @Test |
13 | void testCursor() { | 14 | void testCursor() { |
14 | var store = VersionedMapStoreBuilder.<Integer,String>builder() | 15 | var store = VersionedMapStore.<Integer,String>builder() |
15 | .setStrategy(VersionedMapStoreBuilder.StoreStrategy.STATE) | 16 | .strategy(VersionedMapStoreFactoryBuilder.StoreStrategy.STATE) |
16 | .setStateBasedImmutableWhenCommitting(true) | 17 | .stateBasedImmutableWhenCommitting(true) |
17 | .setHashProvider(MapTestEnvironment.prepareHashProvider(false)) | 18 | .stateBasedHashProvider(MapTestEnvironment.prepareHashProvider(false)) |
18 | .setStateBasedNodeSharingStrategy(VersionedMapStoreBuilder.StateStorageStrategy.SHARED_NODE_CACHE) | 19 | .stateBasedSharingStrategy(VersionedMapStoreFactoryBuilder.SharingStrategy.SHARED_NODE_CACHE) |
19 | .setDefaultValue("x") | 20 | .defaultValue("x") |
20 | .buildOne(); | 21 | .build() |
22 | .createOne(); | ||
21 | 23 | ||
22 | VersionedMapImpl<Integer,String> map = (VersionedMapImpl<Integer,String>) store.createMap(); | 24 | VersionedMapImpl<Integer,String> map = (VersionedMapImpl<Integer,String>) store.createMap(); |
23 | checkMove(map,0); | 25 | checkMove(map,0); |
diff --git a/subprojects/store/src/test/java/tools/refinery/store/map/tests/MapUnitTests.java b/subprojects/store/src/test/java/tools/refinery/store/map/tests/MapUnitTests.java index 2216db76..6889fd07 100644 --- a/subprojects/store/src/test/java/tools/refinery/store/map/tests/MapUnitTests.java +++ b/subprojects/store/src/test/java/tools/refinery/store/map/tests/MapUnitTests.java | |||
@@ -2,7 +2,6 @@ package tools.refinery.store.map.tests; | |||
2 | 2 | ||
3 | import org.junit.jupiter.api.Test; | 3 | import org.junit.jupiter.api.Test; |
4 | import tools.refinery.store.map.VersionedMapStore; | 4 | import tools.refinery.store.map.VersionedMapStore; |
5 | import tools.refinery.store.map.VersionedMapStoreBuilder; | ||
6 | import tools.refinery.store.map.VersionedMapStoreImpl; | 5 | import tools.refinery.store.map.VersionedMapStoreImpl; |
7 | import tools.refinery.store.model.TupleHashProvider; | 6 | import tools.refinery.store.model.TupleHashProvider; |
8 | import tools.refinery.store.tuple.Tuple; | 7 | import tools.refinery.store.tuple.Tuple; |
@@ -23,7 +22,7 @@ class MapUnitTests { | |||
23 | @Test | 22 | @Test |
24 | void deltaRestoreTest() { | 23 | void deltaRestoreTest() { |
25 | VersionedMapStore<Integer,String> store = | 24 | VersionedMapStore<Integer,String> store = |
26 | VersionedMapStoreBuilder.<Integer,String>builder().setDefaultValue("x").buildOne(); | 25 | VersionedMapStore.<Integer,String>builder().defaultValue("x").build().createOne(); |
27 | var map = store.createMap(); | 26 | var map = store.createMap(); |
28 | map.put(1,"val"); | 27 | map.put(1,"val"); |
29 | var version1 = map.commit(); | 28 | var version1 = map.commit(); |
@@ -36,7 +35,7 @@ class MapUnitTests { | |||
36 | @Test | 35 | @Test |
37 | void deltaRestoreTest2() { | 36 | void deltaRestoreTest2() { |
38 | VersionedMapStore<Integer,String> store = | 37 | VersionedMapStore<Integer,String> store = |
39 | VersionedMapStoreBuilder.<Integer,String>builder().setDefaultValue("x").buildOne(); | 38 | VersionedMapStore.<Integer,String>builder().defaultValue("x").build().createOne(); |
40 | var map = store.createMap(); | 39 | var map = store.createMap(); |
41 | map.put(1,"x"); | 40 | map.put(1,"x"); |
42 | var version1 = map.commit(); | 41 | var version1 = map.commit(); |
@@ -48,7 +47,7 @@ class MapUnitTests { | |||
48 | @Test | 47 | @Test |
49 | void deltaRestoreTest3() { | 48 | void deltaRestoreTest3() { |
50 | VersionedMapStore<Integer,String> store = | 49 | VersionedMapStore<Integer,String> store = |
51 | VersionedMapStoreBuilder.<Integer,String>builder().setDefaultValue("x").buildOne(); | 50 | VersionedMapStore.<Integer,String>builder().defaultValue("x").build().createOne(); |
52 | var map = store.createMap(); | 51 | var map = store.createMap(); |
53 | map.commit(); | 52 | map.commit(); |
54 | map.put(1,"1"); | 53 | map.put(1,"1"); |
@@ -71,7 +70,7 @@ class MapUnitTests { | |||
71 | @Test | 70 | @Test |
72 | void deltaRestoreTest4() { | 71 | void deltaRestoreTest4() { |
73 | VersionedMapStore<Integer,String> store = | 72 | VersionedMapStore<Integer,String> store = |
74 | VersionedMapStoreBuilder.<Integer,String>builder().setDefaultValue("x").buildOne(); | 73 | VersionedMapStore.<Integer,String>builder().defaultValue("x").build().createOne(); |
75 | var map = store.createMap(); | 74 | var map = store.createMap(); |
76 | map.commit(); | 75 | map.commit(); |
77 | map.put(1,"1"); | 76 | map.put(1,"1"); |
diff --git a/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/CommitFuzzTest.java b/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/CommitFuzzTest.java index 14a9e2e0..7977f772 100644 --- a/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/CommitFuzzTest.java +++ b/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/CommitFuzzTest.java | |||
@@ -1,30 +1,29 @@ | |||
1 | package tools.refinery.store.map.tests.fuzz; | 1 | package tools.refinery.store.map.tests.fuzz; |
2 | 2 | ||
3 | import static org.junit.jupiter.api.Assertions.fail; | ||
4 | |||
5 | import java.util.Random; | ||
6 | import java.util.stream.Stream; | ||
7 | |||
8 | import org.junit.jupiter.api.Tag; | 3 | import org.junit.jupiter.api.Tag; |
9 | import org.junit.jupiter.api.Timeout; | 4 | import org.junit.jupiter.api.Timeout; |
10 | import org.junit.jupiter.params.ParameterizedTest; | 5 | import org.junit.jupiter.params.ParameterizedTest; |
11 | import org.junit.jupiter.params.provider.Arguments; | 6 | import org.junit.jupiter.params.provider.Arguments; |
12 | import org.junit.jupiter.params.provider.MethodSource; | 7 | import org.junit.jupiter.params.provider.MethodSource; |
13 | |||
14 | import tools.refinery.store.map.VersionedMapStore; | 8 | import tools.refinery.store.map.VersionedMapStore; |
15 | import tools.refinery.store.map.VersionedMapStoreBuilder; | 9 | import tools.refinery.store.map.VersionedMapStoreFactoryBuilder; |
16 | import tools.refinery.store.map.tests.fuzz.utils.FuzzTestUtils; | 10 | import tools.refinery.store.map.tests.fuzz.utils.FuzzTestUtils; |
17 | import tools.refinery.store.map.tests.utils.MapTestEnvironment; | 11 | import tools.refinery.store.map.tests.utils.MapTestEnvironment; |
18 | 12 | ||
13 | import java.util.Random; | ||
14 | import java.util.stream.Stream; | ||
15 | |||
16 | import static org.junit.jupiter.api.Assertions.fail; | ||
19 | import static tools.refinery.store.map.tests.fuzz.utils.FuzzTestCollections.*; | 17 | import static tools.refinery.store.map.tests.fuzz.utils.FuzzTestCollections.*; |
20 | 18 | ||
21 | class CommitFuzzTest { | 19 | class CommitFuzzTest { |
22 | 20 | ||
23 | private void runFuzzTest(String scenario, int seed, int steps, int maxKey, int maxValue, | 21 | private void runFuzzTest(String scenario, int seed, int steps, int maxKey, int maxValue, |
24 | boolean nullDefault, int commitFrequency, VersionedMapStoreBuilder<Integer, String> builder) { | 22 | boolean nullDefault, int commitFrequency, |
23 | VersionedMapStoreFactoryBuilder<Integer, String> builder) { | ||
25 | String[] values = MapTestEnvironment.prepareValues(maxValue, nullDefault); | 24 | String[] values = MapTestEnvironment.prepareValues(maxValue, nullDefault); |
26 | 25 | ||
27 | VersionedMapStore<Integer, String> store = builder.setDefaultValue(values[0]).buildOne(); | 26 | VersionedMapStore<Integer, String> store = builder.defaultValue(values[0]).build().createOne(); |
28 | var sut = store.createMap(); | 27 | var sut = store.createMap(); |
29 | MapTestEnvironment<Integer, String> e = new MapTestEnvironment<>(sut); | 28 | MapTestEnvironment<Integer, String> e = new MapTestEnvironment<>(sut); |
30 | 29 | ||
@@ -61,7 +60,7 @@ class CommitFuzzTest { | |||
61 | @Timeout(value = 10) | 60 | @Timeout(value = 10) |
62 | @Tag("fuzz") | 61 | @Tag("fuzz") |
63 | void parametrizedFastFuzz(int ignoredTests, int steps, int noKeys, int noValues, boolean nullDefault, int commitFrequency, | 62 | void parametrizedFastFuzz(int ignoredTests, int steps, int noKeys, int noValues, boolean nullDefault, int commitFrequency, |
64 | int seed, VersionedMapStoreBuilder<Integer, String> builder) { | 63 | int seed, VersionedMapStoreFactoryBuilder<Integer, String> builder) { |
65 | runFuzzTest("CommitS" + steps + "K" + noKeys + "V" + noValues + "s" + seed, seed, steps, noKeys, noValues, | 64 | runFuzzTest("CommitS" + steps + "K" + noKeys + "V" + noValues + "s" + seed, seed, steps, noKeys, noValues, |
66 | nullDefault, commitFrequency, builder); | 65 | nullDefault, commitFrequency, builder); |
67 | } | 66 | } |
@@ -76,7 +75,7 @@ class CommitFuzzTest { | |||
76 | @Tag("fuzz") | 75 | @Tag("fuzz") |
77 | @Tag("slow") | 76 | @Tag("slow") |
78 | void parametrizedSlowFuzz(int ignoredTests, int steps, int noKeys, int noValues, boolean nullDefault, int commitFrequency, | 77 | void parametrizedSlowFuzz(int ignoredTests, int steps, int noKeys, int noValues, boolean nullDefault, int commitFrequency, |
79 | int seed, VersionedMapStoreBuilder<Integer, String> builder) { | 78 | int seed, VersionedMapStoreFactoryBuilder<Integer, String> builder) { |
80 | runFuzzTest("CommitS" + steps + "K" + noKeys + "V" + noValues + "s" + seed, seed, steps, noKeys, noValues, | 79 | runFuzzTest("CommitS" + steps + "K" + noKeys + "V" + noValues + "s" + seed, seed, steps, noKeys, noValues, |
81 | nullDefault, commitFrequency, builder); | 80 | nullDefault, commitFrequency, builder); |
82 | } | 81 | } |
diff --git a/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/ContentEqualsFuzzTest.java b/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/ContentEqualsFuzzTest.java index b462ed40..99e76649 100644 --- a/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/ContentEqualsFuzzTest.java +++ b/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/ContentEqualsFuzzTest.java | |||
@@ -5,7 +5,10 @@ import org.junit.jupiter.api.Timeout; | |||
5 | import org.junit.jupiter.params.ParameterizedTest; | 5 | import org.junit.jupiter.params.ParameterizedTest; |
6 | import org.junit.jupiter.params.provider.Arguments; | 6 | import org.junit.jupiter.params.provider.Arguments; |
7 | import org.junit.jupiter.params.provider.MethodSource; | 7 | import org.junit.jupiter.params.provider.MethodSource; |
8 | import tools.refinery.store.map.*; | 8 | import tools.refinery.store.map.Cursor; |
9 | import tools.refinery.store.map.VersionedMap; | ||
10 | import tools.refinery.store.map.VersionedMapStore; | ||
11 | import tools.refinery.store.map.VersionedMapStoreFactoryBuilder; | ||
9 | import tools.refinery.store.map.tests.fuzz.utils.FuzzTestUtils; | 12 | import tools.refinery.store.map.tests.fuzz.utils.FuzzTestUtils; |
10 | import tools.refinery.store.map.tests.utils.MapTestEnvironment; | 13 | import tools.refinery.store.map.tests.utils.MapTestEnvironment; |
11 | 14 | ||
@@ -16,12 +19,13 @@ import java.util.List; | |||
16 | import java.util.Random; | 19 | import java.util.Random; |
17 | import java.util.stream.Stream; | 20 | import java.util.stream.Stream; |
18 | 21 | ||
19 | import static org.junit.jupiter.api.Assertions.*; | 22 | import static org.junit.jupiter.api.Assertions.fail; |
20 | import static tools.refinery.store.map.tests.fuzz.utils.FuzzTestCollections.*; | 23 | import static tools.refinery.store.map.tests.fuzz.utils.FuzzTestCollections.*; |
21 | 24 | ||
22 | class ContentEqualsFuzzTest { | 25 | class ContentEqualsFuzzTest { |
23 | private void runFuzzTest(String scenario, int seed, int steps, int maxKey, int maxValue, | 26 | private void runFuzzTest(String scenario, int seed, int steps, int maxKey, int maxValue, |
24 | boolean nullDefault, int commitFrequency, VersionedMapStoreBuilder<Integer, String> builder) { | 27 | boolean nullDefault, int commitFrequency, |
28 | VersionedMapStoreFactoryBuilder<Integer, String> builder) { | ||
25 | String[] values = MapTestEnvironment.prepareValues(maxValue, nullDefault); | 29 | String[] values = MapTestEnvironment.prepareValues(maxValue, nullDefault); |
26 | 30 | ||
27 | 31 | ||
@@ -30,10 +34,10 @@ class ContentEqualsFuzzTest { | |||
30 | iterativeRandomPutsAndCommitsThenCompare(scenario, builder, steps, maxKey, values, r, commitFrequency); | 34 | iterativeRandomPutsAndCommitsThenCompare(scenario, builder, steps, maxKey, values, r, commitFrequency); |
31 | } | 35 | } |
32 | 36 | ||
33 | private void iterativeRandomPutsAndCommitsThenCompare(String scenario, VersionedMapStoreBuilder<Integer, String> builder, | 37 | private void iterativeRandomPutsAndCommitsThenCompare(String scenario, VersionedMapStoreFactoryBuilder<Integer, String> builder, |
34 | int steps, int maxKey, String[] values, Random r, | 38 | int steps, int maxKey, String[] values, Random r, |
35 | int commitFrequency) { | 39 | int commitFrequency) { |
36 | VersionedMapStore<Integer, String> store1 = builder.setDefaultValue(values[0]).buildOne(); | 40 | VersionedMapStore<Integer, String> store1 = builder.defaultValue(values[0]).build().createOne(); |
37 | VersionedMap<Integer, String> sut1 = store1.createMap(); | 41 | VersionedMap<Integer, String> sut1 = store1.createMap(); |
38 | 42 | ||
39 | // Fill one map | 43 | // Fill one map |
@@ -63,7 +67,7 @@ class ContentEqualsFuzzTest { | |||
63 | // Randomize the order of the content | 67 | // Randomize the order of the content |
64 | Collections.shuffle(content, r); | 68 | Collections.shuffle(content, r); |
65 | 69 | ||
66 | VersionedMapStore<Integer, String> store2 = builder.setDefaultValue(values[0]).buildOne(); | 70 | VersionedMapStore<Integer, String> store2 = builder.defaultValue(values[0]).build().createOne(); |
67 | VersionedMap<Integer, String> sut2 = store2.createMap(); | 71 | VersionedMap<Integer, String> sut2 = store2.createMap(); |
68 | int index2 = 1; | 72 | int index2 = 1; |
69 | for (SimpleEntry<Integer, String> entry : content) { | 73 | for (SimpleEntry<Integer, String> entry : content) { |
@@ -88,7 +92,7 @@ class ContentEqualsFuzzTest { | |||
88 | @Timeout(value = 10) | 92 | @Timeout(value = 10) |
89 | @Tag("fuzz") | 93 | @Tag("fuzz") |
90 | void parametrizedFastFuzz(int ignoredTests, int steps, int noKeys, int noValues, boolean nullDefault, int commitFrequency, | 94 | void parametrizedFastFuzz(int ignoredTests, int steps, int noKeys, int noValues, boolean nullDefault, int commitFrequency, |
91 | int seed, VersionedMapStoreBuilder<Integer, String> builder) { | 95 | int seed, VersionedMapStoreFactoryBuilder<Integer, String> builder) { |
92 | runFuzzTest("CompareS" + steps + "K" + noKeys + "V" + noValues + "s" + seed, seed, steps, noKeys, noValues, | 96 | runFuzzTest("CompareS" + steps + "K" + noKeys + "V" + noValues + "s" + seed, seed, steps, noKeys, noValues, |
93 | nullDefault, commitFrequency, builder); | 97 | nullDefault, commitFrequency, builder); |
94 | } | 98 | } |
@@ -103,7 +107,7 @@ class ContentEqualsFuzzTest { | |||
103 | @Tag("fuzz") | 107 | @Tag("fuzz") |
104 | @Tag("slow") | 108 | @Tag("slow") |
105 | void parametrizedSlowFuzz(int ignoredTests, int steps, int noKeys, int noValues, boolean defaultNull, int commitFrequency, | 109 | void parametrizedSlowFuzz(int ignoredTests, int steps, int noKeys, int noValues, boolean defaultNull, int commitFrequency, |
106 | int seed, VersionedMapStoreBuilder<Integer, String> builder) { | 110 | int seed, VersionedMapStoreFactoryBuilder<Integer, String> builder) { |
107 | runFuzzTest("CompareS" + steps + "K" + noKeys + "V" + noValues + "s" + seed, seed, steps, noKeys, noValues, | 111 | runFuzzTest("CompareS" + steps + "K" + noKeys + "V" + noValues + "s" + seed, seed, steps, noKeys, noValues, |
108 | defaultNull, commitFrequency, builder); | 112 | defaultNull, commitFrequency, builder); |
109 | } | 113 | } |
diff --git a/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/DiffCursorFuzzTest.java b/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/DiffCursorFuzzTest.java index b087906d..3a8852a9 100644 --- a/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/DiffCursorFuzzTest.java +++ b/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/DiffCursorFuzzTest.java | |||
@@ -8,7 +8,7 @@ import org.junit.jupiter.params.provider.MethodSource; | |||
8 | import tools.refinery.store.map.DiffCursor; | 8 | import tools.refinery.store.map.DiffCursor; |
9 | import tools.refinery.store.map.VersionedMap; | 9 | import tools.refinery.store.map.VersionedMap; |
10 | import tools.refinery.store.map.VersionedMapStore; | 10 | import tools.refinery.store.map.VersionedMapStore; |
11 | import tools.refinery.store.map.VersionedMapStoreBuilder; | 11 | import tools.refinery.store.map.VersionedMapStoreFactoryBuilder; |
12 | import tools.refinery.store.map.tests.fuzz.utils.FuzzTestUtils; | 12 | import tools.refinery.store.map.tests.fuzz.utils.FuzzTestUtils; |
13 | import tools.refinery.store.map.tests.utils.MapTestEnvironment; | 13 | import tools.refinery.store.map.tests.utils.MapTestEnvironment; |
14 | 14 | ||
@@ -21,10 +21,10 @@ import static tools.refinery.store.map.tests.fuzz.utils.FuzzTestCollections.*; | |||
21 | class DiffCursorFuzzTest { | 21 | class DiffCursorFuzzTest { |
22 | private void runFuzzTest(String scenario, int seed, int steps, int maxKey, int maxValue, boolean nullDefault, | 22 | private void runFuzzTest(String scenario, int seed, int steps, int maxKey, int maxValue, boolean nullDefault, |
23 | int commitFrequency, boolean commitBeforeDiffCursor, | 23 | int commitFrequency, boolean commitBeforeDiffCursor, |
24 | VersionedMapStoreBuilder<Integer, String> builder) { | 24 | VersionedMapStoreFactoryBuilder<Integer, String> builder) { |
25 | String[] values = MapTestEnvironment.prepareValues(maxValue, nullDefault); | 25 | String[] values = MapTestEnvironment.prepareValues(maxValue, nullDefault); |
26 | 26 | ||
27 | VersionedMapStore<Integer, String> store = builder.setDefaultValue(values[0]).buildOne(); | 27 | VersionedMapStore<Integer, String> store = builder.defaultValue(values[0]).build().createOne(); |
28 | iterativeRandomPutsAndCommitsThenDiffCursor(scenario, store, steps, maxKey, values, seed, commitFrequency, | 28 | iterativeRandomPutsAndCommitsThenDiffCursor(scenario, store, steps, maxKey, values, seed, commitFrequency, |
29 | commitBeforeDiffCursor); | 29 | commitBeforeDiffCursor); |
30 | } | 30 | } |
@@ -109,7 +109,7 @@ class DiffCursorFuzzTest { | |||
109 | @Tag("fuzz") | 109 | @Tag("fuzz") |
110 | void parametrizedFuzz(int ignoredTests, int steps, int noKeys, int noValues, boolean nullDefault, | 110 | void parametrizedFuzz(int ignoredTests, int steps, int noKeys, int noValues, boolean nullDefault, |
111 | int commitFrequency, int seed, boolean commitBeforeDiffCursor, | 111 | int commitFrequency, int seed, boolean commitBeforeDiffCursor, |
112 | VersionedMapStoreBuilder<Integer, String> builder) { | 112 | VersionedMapStoreFactoryBuilder<Integer, String> builder) { |
113 | runFuzzTest("DiffCursorS" + steps + "K" + noKeys + "V" + noValues + "s" + seed, seed, steps, | 113 | runFuzzTest("DiffCursorS" + steps + "K" + noKeys + "V" + noValues + "s" + seed, seed, steps, |
114 | noKeys, noValues, nullDefault, commitFrequency, commitBeforeDiffCursor, builder); | 114 | noKeys, noValues, nullDefault, commitFrequency, commitBeforeDiffCursor, builder); |
115 | } | 115 | } |
@@ -124,7 +124,7 @@ class DiffCursorFuzzTest { | |||
124 | @Tag("fuzz") | 124 | @Tag("fuzz") |
125 | @Tag("slow") | 125 | @Tag("slow") |
126 | void parametrizedSlowFuzz(int ignoredTests, int steps, int noKeys, int noValues, boolean nullDefault, int commitFrequency, | 126 | void parametrizedSlowFuzz(int ignoredTests, int steps, int noKeys, int noValues, boolean nullDefault, int commitFrequency, |
127 | int seed, boolean commitBeforeDiffCursor, VersionedMapStoreBuilder<Integer, String> builder) { | 127 | int seed, boolean commitBeforeDiffCursor, VersionedMapStoreFactoryBuilder<Integer, String> builder) { |
128 | runFuzzTest("DiffCursorS" + steps + "K" + noKeys + "V" + noValues + "s" + seed, seed, steps, noKeys, noValues, | 128 | runFuzzTest("DiffCursorS" + steps + "K" + noKeys + "V" + noValues + "s" + seed, seed, steps, noKeys, noValues, |
129 | nullDefault, commitFrequency, commitBeforeDiffCursor, builder); | 129 | nullDefault, commitFrequency, commitBeforeDiffCursor, builder); |
130 | } | 130 | } |
diff --git a/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/MultiThreadFuzzTest.java b/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/MultiThreadFuzzTest.java index ec2224b4..ea58e1b7 100644 --- a/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/MultiThreadFuzzTest.java +++ b/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/MultiThreadFuzzTest.java | |||
@@ -1,32 +1,31 @@ | |||
1 | package tools.refinery.store.map.tests.fuzz; | 1 | package tools.refinery.store.map.tests.fuzz; |
2 | 2 | ||
3 | import static org.junit.jupiter.api.Assertions.assertEquals; | ||
4 | import static org.junit.jupiter.api.Assertions.fail; | ||
5 | import static tools.refinery.store.map.tests.fuzz.utils.FuzzTestCollections.*; | ||
6 | |||
7 | import java.util.Collections; | ||
8 | import java.util.LinkedList; | ||
9 | import java.util.List; | ||
10 | import java.util.stream.Stream; | ||
11 | |||
12 | import org.junit.jupiter.api.Tag; | 3 | import org.junit.jupiter.api.Tag; |
13 | import org.junit.jupiter.api.Timeout; | 4 | import org.junit.jupiter.api.Timeout; |
14 | import org.junit.jupiter.params.ParameterizedTest; | 5 | import org.junit.jupiter.params.ParameterizedTest; |
15 | import org.junit.jupiter.params.provider.Arguments; | 6 | import org.junit.jupiter.params.provider.Arguments; |
16 | import org.junit.jupiter.params.provider.MethodSource; | 7 | import org.junit.jupiter.params.provider.MethodSource; |
17 | |||
18 | import tools.refinery.store.map.VersionedMapStore; | 8 | import tools.refinery.store.map.VersionedMapStore; |
19 | import tools.refinery.store.map.VersionedMapStoreBuilder; | 9 | import tools.refinery.store.map.VersionedMapStoreFactoryBuilder; |
20 | import tools.refinery.store.map.tests.fuzz.utils.FuzzTestUtils; | 10 | import tools.refinery.store.map.tests.fuzz.utils.FuzzTestUtils; |
21 | import tools.refinery.store.map.tests.utils.MapTestEnvironment; | 11 | import tools.refinery.store.map.tests.utils.MapTestEnvironment; |
22 | 12 | ||
13 | import java.util.Collections; | ||
14 | import java.util.LinkedList; | ||
15 | import java.util.List; | ||
16 | import java.util.stream.Stream; | ||
17 | |||
18 | import static org.junit.jupiter.api.Assertions.assertEquals; | ||
19 | import static org.junit.jupiter.api.Assertions.fail; | ||
20 | import static tools.refinery.store.map.tests.fuzz.utils.FuzzTestCollections.*; | ||
21 | |||
23 | class MultiThreadFuzzTest { | 22 | class MultiThreadFuzzTest { |
24 | public static final int noThreads = 10; | 23 | public static final int noThreads = 10; |
25 | 24 | ||
26 | private void runFuzzTest(String scenario, int seed, int steps, int maxKey, int maxValue, boolean nullDefault, int commitFrequency, VersionedMapStoreBuilder<Integer, String> builder) { | 25 | private void runFuzzTest(String scenario, int seed, int steps, int maxKey, int maxValue, boolean nullDefault, int commitFrequency, VersionedMapStoreFactoryBuilder<Integer, String> builder) { |
27 | String[] values = MapTestEnvironment.prepareValues(maxValue, nullDefault); | 26 | String[] values = MapTestEnvironment.prepareValues(maxValue, nullDefault); |
28 | 27 | ||
29 | VersionedMapStore<Integer, String> store = builder.setDefaultValue(values[0]).buildOne(); | 28 | VersionedMapStore<Integer, String> store = builder.defaultValue(values[0]).build().createOne(); |
30 | 29 | ||
31 | // initialize runnables | 30 | // initialize runnables |
32 | MultiThreadTestRunnable[] runnables = new MultiThreadTestRunnable[noThreads]; | 31 | MultiThreadTestRunnable[] runnables = new MultiThreadTestRunnable[noThreads]; |
@@ -73,7 +72,7 @@ class MultiThreadFuzzTest { | |||
73 | @Timeout(value = 10) | 72 | @Timeout(value = 10) |
74 | @Tag("fuzz") | 73 | @Tag("fuzz") |
75 | void parametrizedFastFuzz(int ignoredTests, int steps, int noKeys, int noValues, boolean defaultNull, | 74 | void parametrizedFastFuzz(int ignoredTests, int steps, int noKeys, int noValues, boolean defaultNull, |
76 | int commitFrequency, int seed, VersionedMapStoreBuilder<Integer, String> builder) { | 75 | int commitFrequency, int seed, VersionedMapStoreFactoryBuilder<Integer, String> builder) { |
77 | runFuzzTest("MultiThreadS" + steps + "K" + noKeys + "V" + noValues + defaultNull + "CF" + commitFrequency + | 76 | runFuzzTest("MultiThreadS" + steps + "K" + noKeys + "V" + noValues + defaultNull + "CF" + commitFrequency + |
78 | "s" + seed, seed, steps, noKeys, noValues, defaultNull, commitFrequency, builder); | 77 | "s" + seed, seed, steps, noKeys, noValues, defaultNull, commitFrequency, builder); |
79 | } | 78 | } |
@@ -88,7 +87,7 @@ class MultiThreadFuzzTest { | |||
88 | @Tag("fuzz") | 87 | @Tag("fuzz") |
89 | @Tag("slow") | 88 | @Tag("slow") |
90 | void parametrizedSlowFuzz(int ignoredTests, int steps, int noKeys, int noValues, boolean nullDefault, | 89 | void parametrizedSlowFuzz(int ignoredTests, int steps, int noKeys, int noValues, boolean nullDefault, |
91 | int commitFrequency, int seed, VersionedMapStoreBuilder<Integer, String> builder) { | 90 | int commitFrequency, int seed, VersionedMapStoreFactoryBuilder<Integer, String> builder) { |
92 | runFuzzTest("RestoreS" + steps + "K" + noKeys + "V" + noValues + "s" + seed, seed, steps, noKeys, noValues, | 91 | runFuzzTest("RestoreS" + steps + "K" + noKeys + "V" + noValues + "s" + seed, seed, steps, noKeys, noValues, |
93 | nullDefault, commitFrequency, builder); | 92 | nullDefault, commitFrequency, builder); |
94 | } | 93 | } |
diff --git a/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/MutableFuzzTest.java b/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/MutableFuzzTest.java index bdf72ce4..61b17362 100644 --- a/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/MutableFuzzTest.java +++ b/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/MutableFuzzTest.java | |||
@@ -18,10 +18,10 @@ import tools.refinery.store.map.tests.utils.MapTestEnvironment; | |||
18 | 18 | ||
19 | class MutableFuzzTest { | 19 | class MutableFuzzTest { |
20 | private void runFuzzTest(String scenario, int seed, int steps, int maxKey, int maxValue, | 20 | private void runFuzzTest(String scenario, int seed, int steps, int maxKey, int maxValue, |
21 | boolean nullDefault, VersionedMapStoreBuilder<Integer, String> builder) { | 21 | boolean nullDefault, VersionedMapStoreFactoryBuilder<Integer, String> builder) { |
22 | String[] values = MapTestEnvironment.prepareValues(maxValue, nullDefault); | 22 | String[] values = MapTestEnvironment.prepareValues(maxValue, nullDefault); |
23 | 23 | ||
24 | VersionedMapStore<Integer, String> store = builder.setDefaultValue(values[0]).buildOne(); | 24 | VersionedMapStore<Integer, String> store = builder.defaultValue(values[0]).build().createOne(); |
25 | VersionedMap<Integer, String> sut = store.createMap(); | 25 | VersionedMap<Integer, String> sut = store.createMap(); |
26 | MapTestEnvironment<Integer, String> e = new MapTestEnvironment<>(sut); | 26 | MapTestEnvironment<Integer, String> e = new MapTestEnvironment<>(sut); |
27 | 27 | ||
@@ -56,7 +56,7 @@ class MutableFuzzTest { | |||
56 | @Timeout(value = 10) | 56 | @Timeout(value = 10) |
57 | @Tag("fuzz") | 57 | @Tag("fuzz") |
58 | void parametrizedFuzz(int ignoredTests, int steps, int noKeys, int noValues, boolean defaultNull, int seed, | 58 | void parametrizedFuzz(int ignoredTests, int steps, int noKeys, int noValues, boolean defaultNull, int seed, |
59 | VersionedMapStoreBuilder<Integer, String> builder) { | 59 | VersionedMapStoreFactoryBuilder<Integer, String> builder) { |
60 | runFuzzTest( | 60 | runFuzzTest( |
61 | "MutableS" + steps + "K" + noKeys + "V" + noValues + "s" + seed, | 61 | "MutableS" + steps + "K" + noKeys + "V" + noValues + "s" + seed, |
62 | seed, steps, noKeys, noValues, defaultNull, builder); | 62 | seed, steps, noKeys, noValues, defaultNull, builder); |
@@ -72,7 +72,7 @@ class MutableFuzzTest { | |||
72 | @Tag("fuzz") | 72 | @Tag("fuzz") |
73 | @Tag("slow") | 73 | @Tag("slow") |
74 | void parametrizedSlowFuzz(int ignoredTests, int steps, int noKeys, int noValues, boolean nullDefault, int seed, | 74 | void parametrizedSlowFuzz(int ignoredTests, int steps, int noKeys, int noValues, boolean nullDefault, int seed, |
75 | VersionedMapStoreBuilder<Integer, String> builder) { | 75 | VersionedMapStoreFactoryBuilder<Integer, String> builder) { |
76 | runFuzzTest( | 76 | runFuzzTest( |
77 | "MutableS" + steps + "K" + noKeys + "V" + noValues + "s" + seed, | 77 | "MutableS" + steps + "K" + noKeys + "V" + noValues + "s" + seed, |
78 | seed, steps, noKeys, noValues, nullDefault, builder); | 78 | seed, steps, noKeys, noValues, nullDefault, builder); |
diff --git a/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/RestoreFuzzTest.java b/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/RestoreFuzzTest.java index 568aaac9..1661cccb 100644 --- a/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/RestoreFuzzTest.java +++ b/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/RestoreFuzzTest.java | |||
@@ -1,31 +1,31 @@ | |||
1 | package tools.refinery.store.map.tests.fuzz; | 1 | package tools.refinery.store.map.tests.fuzz; |
2 | 2 | ||
3 | import static org.junit.jupiter.api.Assertions.fail; | ||
4 | import static tools.refinery.store.map.tests.fuzz.utils.FuzzTestCollections.*; | ||
5 | |||
6 | import java.util.HashMap; | ||
7 | import java.util.Map; | ||
8 | import java.util.Random; | ||
9 | import java.util.stream.Stream; | ||
10 | |||
11 | import org.junit.jupiter.api.Tag; | 3 | import org.junit.jupiter.api.Tag; |
12 | import org.junit.jupiter.api.Timeout; | 4 | import org.junit.jupiter.api.Timeout; |
13 | import org.junit.jupiter.params.ParameterizedTest; | 5 | import org.junit.jupiter.params.ParameterizedTest; |
14 | import org.junit.jupiter.params.provider.Arguments; | 6 | import org.junit.jupiter.params.provider.Arguments; |
15 | import org.junit.jupiter.params.provider.MethodSource; | 7 | import org.junit.jupiter.params.provider.MethodSource; |
16 | 8 | import tools.refinery.store.map.VersionedMap; | |
17 | import tools.refinery.store.map.*; | 9 | import tools.refinery.store.map.VersionedMapStore; |
18 | import tools.refinery.store.map.internal.VersionedMapImpl; | 10 | import tools.refinery.store.map.VersionedMapStoreFactoryBuilder; |
19 | import tools.refinery.store.map.tests.fuzz.utils.FuzzTestUtils; | 11 | import tools.refinery.store.map.tests.fuzz.utils.FuzzTestUtils; |
20 | import tools.refinery.store.map.tests.utils.MapTestEnvironment; | 12 | import tools.refinery.store.map.tests.utils.MapTestEnvironment; |
21 | 13 | ||
14 | import java.util.HashMap; | ||
15 | import java.util.Map; | ||
16 | import java.util.Random; | ||
17 | import java.util.stream.Stream; | ||
18 | |||
19 | import static org.junit.jupiter.api.Assertions.fail; | ||
20 | import static tools.refinery.store.map.tests.fuzz.utils.FuzzTestCollections.*; | ||
21 | |||
22 | class RestoreFuzzTest { | 22 | class RestoreFuzzTest { |
23 | private void runFuzzTest(String scenario, int seed, int steps, int maxKey, int maxValue, | 23 | private void runFuzzTest(String scenario, int seed, int steps, int maxKey, int maxValue, |
24 | boolean nullDefault, int commitFrequency, | 24 | boolean nullDefault, int commitFrequency, |
25 | VersionedMapStoreBuilder<Integer, String> builder) { | 25 | VersionedMapStoreFactoryBuilder<Integer, String> builder) { |
26 | String[] values = MapTestEnvironment.prepareValues(maxValue, nullDefault); | 26 | String[] values = MapTestEnvironment.prepareValues(maxValue, nullDefault); |
27 | 27 | ||
28 | VersionedMapStore<Integer, String> store = builder.setDefaultValue(values[0]).buildOne(); | 28 | VersionedMapStore<Integer, String> store = builder.defaultValue(values[0]).build().createOne(); |
29 | 29 | ||
30 | iterativeRandomPutsAndCommitsThenRestore(scenario, store, steps, maxKey, values, seed, commitFrequency); | 30 | iterativeRandomPutsAndCommitsThenRestore(scenario, store, steps, maxKey, values, seed, commitFrequency); |
31 | } | 31 | } |
@@ -84,7 +84,7 @@ class RestoreFuzzTest { | |||
84 | @Timeout(value = 10) | 84 | @Timeout(value = 10) |
85 | @Tag("smoke") | 85 | @Tag("smoke") |
86 | void parametrizedFastFuzz(int ignoredTests, int steps, int noKeys, int noValues, boolean nullDefault, int commitFrequency, | 86 | void parametrizedFastFuzz(int ignoredTests, int steps, int noKeys, int noValues, boolean nullDefault, int commitFrequency, |
87 | int seed, VersionedMapStoreBuilder<Integer, String> builder) { | 87 | int seed, VersionedMapStoreFactoryBuilder<Integer, String> builder) { |
88 | runFuzzTest("RestoreS" + steps + "K" + noKeys + "V" + noValues + "s" + seed, seed, steps, noKeys, noValues, | 88 | runFuzzTest("RestoreS" + steps + "K" + noKeys + "V" + noValues + "s" + seed, seed, steps, noKeys, noValues, |
89 | nullDefault, commitFrequency, builder); | 89 | nullDefault, commitFrequency, builder); |
90 | } | 90 | } |
@@ -99,7 +99,7 @@ class RestoreFuzzTest { | |||
99 | @Tag("smoke") | 99 | @Tag("smoke") |
100 | @Tag("slow") | 100 | @Tag("slow") |
101 | void parametrizedSlowFuzz(int ignoredTests, int steps, int noKeys, int noValues, boolean nullDefault, int commitFrequency, | 101 | void parametrizedSlowFuzz(int ignoredTests, int steps, int noKeys, int noValues, boolean nullDefault, int commitFrequency, |
102 | int seed, VersionedMapStoreBuilder<Integer, String> builder) { | 102 | int seed, VersionedMapStoreFactoryBuilder<Integer, String> builder) { |
103 | runFuzzTest("RestoreS" + steps + "K" + noKeys + "V" + noValues + "s" + seed, seed, steps, noKeys, noValues, | 103 | runFuzzTest("RestoreS" + steps + "K" + noKeys + "V" + noValues + "s" + seed, seed, steps, noKeys, noValues, |
104 | nullDefault, commitFrequency, builder); | 104 | nullDefault, commitFrequency, builder); |
105 | } | 105 | } |
diff --git a/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/SingleThreadFuzzTest.java b/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/SingleThreadFuzzTest.java index e7d49227..0e1f9f9f 100644 --- a/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/SingleThreadFuzzTest.java +++ b/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/SingleThreadFuzzTest.java | |||
@@ -6,7 +6,7 @@ import org.junit.jupiter.params.ParameterizedTest; | |||
6 | import org.junit.jupiter.params.provider.Arguments; | 6 | import org.junit.jupiter.params.provider.Arguments; |
7 | import org.junit.jupiter.params.provider.MethodSource; | 7 | import org.junit.jupiter.params.provider.MethodSource; |
8 | import tools.refinery.store.map.VersionedMapStore; | 8 | import tools.refinery.store.map.VersionedMapStore; |
9 | import tools.refinery.store.map.VersionedMapStoreBuilder; | 9 | import tools.refinery.store.map.VersionedMapStoreFactoryBuilder; |
10 | import tools.refinery.store.map.tests.fuzz.utils.FuzzTestUtils; | 10 | import tools.refinery.store.map.tests.fuzz.utils.FuzzTestUtils; |
11 | import tools.refinery.store.map.tests.utils.MapTestEnvironment; | 11 | import tools.refinery.store.map.tests.utils.MapTestEnvironment; |
12 | 12 | ||
@@ -15,10 +15,10 @@ import java.util.stream.Stream; | |||
15 | import static tools.refinery.store.map.tests.fuzz.utils.FuzzTestCollections.*; | 15 | import static tools.refinery.store.map.tests.fuzz.utils.FuzzTestCollections.*; |
16 | 16 | ||
17 | class SingleThreadFuzzTest { | 17 | class SingleThreadFuzzTest { |
18 | private void runFuzzTest(String scenario, int seed, int steps, int maxKey, int maxValue, boolean nullDefault, int commitFrequency, VersionedMapStoreBuilder<Integer, String> builder) { | 18 | private void runFuzzTest(String scenario, int seed, int steps, int maxKey, int maxValue, boolean nullDefault, int commitFrequency, VersionedMapStoreFactoryBuilder<Integer, String> builder) { |
19 | String[] values = MapTestEnvironment.prepareValues(maxValue, nullDefault); | 19 | String[] values = MapTestEnvironment.prepareValues(maxValue, nullDefault); |
20 | 20 | ||
21 | VersionedMapStore<Integer, String> store = builder.setDefaultValue(values[0]).buildOne(); | 21 | VersionedMapStore<Integer, String> store = builder.defaultValue(values[0]).build().createOne(); |
22 | 22 | ||
23 | // initialize runnables | 23 | // initialize runnables |
24 | MultiThreadTestRunnable runnable = new MultiThreadTestRunnable(scenario, store, steps, maxKey, values, seed, commitFrequency); | 24 | MultiThreadTestRunnable runnable = new MultiThreadTestRunnable(scenario, store, steps, maxKey, values, seed, commitFrequency); |
@@ -35,7 +35,7 @@ class SingleThreadFuzzTest { | |||
35 | @Timeout(value = 10) | 35 | @Timeout(value = 10) |
36 | @Tag("fuzz") | 36 | @Tag("fuzz") |
37 | void parametrizedFastFuzz(int ignoredTests, int steps, int noKeys, int noValues, boolean defaultNull, | 37 | void parametrizedFastFuzz(int ignoredTests, int steps, int noKeys, int noValues, boolean defaultNull, |
38 | int commitFrequency, int seed, VersionedMapStoreBuilder<Integer, String> builder) { | 38 | int commitFrequency, int seed, VersionedMapStoreFactoryBuilder<Integer, String> builder) { |
39 | runFuzzTest("SingleThreadS" + steps + "K" + noKeys + "V" + noValues + defaultNull + "CF" + commitFrequency + | 39 | runFuzzTest("SingleThreadS" + steps + "K" + noKeys + "V" + noValues + defaultNull + "CF" + commitFrequency + |
40 | "s" + seed, seed, steps, noKeys, noValues, defaultNull, commitFrequency, builder); | 40 | "s" + seed, seed, steps, noKeys, noValues, defaultNull, commitFrequency, builder); |
41 | } | 41 | } |
@@ -50,7 +50,7 @@ class SingleThreadFuzzTest { | |||
50 | @Tag("fuzz") | 50 | @Tag("fuzz") |
51 | @Tag("slow") | 51 | @Tag("slow") |
52 | void parametrizedSlowFuzz(int ignoredTests, int steps, int noKeys, int noValues, boolean nullDefault, | 52 | void parametrizedSlowFuzz(int ignoredTests, int steps, int noKeys, int noValues, boolean nullDefault, |
53 | int commitFrequency, int seed, VersionedMapStoreBuilder<Integer, String> builder) { | 53 | int commitFrequency, int seed, VersionedMapStoreFactoryBuilder<Integer, String> builder) { |
54 | runFuzzTest("SingleThreadS" + steps + "K" + noKeys + "V" + noValues + "s" + seed, seed, steps, noKeys, noValues, | 54 | runFuzzTest("SingleThreadS" + steps + "K" + noKeys + "V" + noValues + "s" + seed, seed, steps, noKeys, noValues, |
55 | nullDefault, commitFrequency, builder); | 55 | nullDefault, commitFrequency, builder); |
56 | } | 56 | } |
diff --git a/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/utils/FuzzTestCollections.java b/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/utils/FuzzTestCollections.java index b344d9b9..94c9cba7 100644 --- a/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/utils/FuzzTestCollections.java +++ b/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/utils/FuzzTestCollections.java | |||
@@ -1,6 +1,7 @@ | |||
1 | package tools.refinery.store.map.tests.fuzz.utils; | 1 | package tools.refinery.store.map.tests.fuzz.utils; |
2 | 2 | ||
3 | import tools.refinery.store.map.VersionedMapStoreBuilder; | 3 | import tools.refinery.store.map.VersionedMapStore; |
4 | import tools.refinery.store.map.VersionedMapStoreFactoryBuilder; | ||
4 | import tools.refinery.store.map.tests.utils.MapTestEnvironment; | 5 | import tools.refinery.store.map.tests.utils.MapTestEnvironment; |
5 | 6 | ||
6 | public final class FuzzTestCollections { | 7 | public final class FuzzTestCollections { |
@@ -12,34 +13,27 @@ public final class FuzzTestCollections { | |||
12 | public static final Object[] randomSeedOptions = {1}; | 13 | public static final Object[] randomSeedOptions = {1}; |
13 | public static final Object[] storeConfigs = { | 14 | public static final Object[] storeConfigs = { |
14 | // State based | 15 | // State based |
15 | VersionedMapStoreBuilder.<Integer,String>builder() | 16 | VersionedMapStore.<Integer,String>builder() |
16 | .setStrategy(VersionedMapStoreBuilder.StoreStrategy.STATE) | 17 | .stateBasedImmutableWhenCommitting(true) |
17 | .setStateBasedImmutableWhenCommitting(true) | 18 | .stateBasedHashProvider(MapTestEnvironment.prepareHashProvider(false)) |
18 | .setHashProvider(MapTestEnvironment.prepareHashProvider(false)) | 19 | .stateBasedSharingStrategy(VersionedMapStoreFactoryBuilder.SharingStrategy.SHARED_NODE_CACHE), |
19 | .setStateBasedNodeSharingStrategy(VersionedMapStoreBuilder.StateStorageStrategy | 20 | VersionedMapStore.<Integer,String>builder() |
20 | .SHARED_NODE_CACHE), | 21 | .stateBasedImmutableWhenCommitting(true) |
21 | VersionedMapStoreBuilder.<Integer,String>builder() | 22 | .stateBasedHashProvider(MapTestEnvironment.prepareHashProvider(true)) |
22 | .setStrategy(VersionedMapStoreBuilder.StoreStrategy.STATE) | 23 | .stateBasedSharingStrategy(VersionedMapStoreFactoryBuilder.SharingStrategy.SHARED_NODE_CACHE), |
23 | .setStateBasedImmutableWhenCommitting(true) | 24 | VersionedMapStore.<Integer,String>builder() |
24 | .setHashProvider(MapTestEnvironment.prepareHashProvider(true)) | 25 | .stateBasedImmutableWhenCommitting(false) |
25 | .setStateBasedNodeSharingStrategy(VersionedMapStoreBuilder.StateStorageStrategy | 26 | .stateBasedHashProvider(MapTestEnvironment.prepareHashProvider(false)) |
26 | .SHARED_NODE_CACHE), | 27 | .stateBasedSharingStrategy(VersionedMapStoreFactoryBuilder.SharingStrategy.SHARED_NODE_CACHE), |
27 | VersionedMapStoreBuilder.<Integer,String>builder() | 28 | VersionedMapStore.<Integer,String>builder() |
28 | .setStrategy(VersionedMapStoreBuilder.StoreStrategy.STATE) | 29 | .stateBasedImmutableWhenCommitting(false) |
29 | .setStateBasedImmutableWhenCommitting(false) | 30 | .stateBasedHashProvider(MapTestEnvironment.prepareHashProvider(false)) |
30 | .setHashProvider(MapTestEnvironment.prepareHashProvider(false)) | 31 | .stateBasedSharingStrategy(VersionedMapStoreFactoryBuilder.SharingStrategy.NO_NODE_CACHE), |
31 | .setStateBasedNodeSharingStrategy(VersionedMapStoreBuilder.StateStorageStrategy.SHARED_NODE_CACHE), | 32 | |
32 | VersionedMapStoreBuilder.<Integer,String>builder() | ||
33 | .setStrategy(VersionedMapStoreBuilder.StoreStrategy.STATE) | ||
34 | .setStateBasedImmutableWhenCommitting(false) | ||
35 | .setHashProvider(MapTestEnvironment.prepareHashProvider(false)) | ||
36 | .setStateBasedNodeSharingStrategy(VersionedMapStoreBuilder.StateStorageStrategy.NO_NODE_CACHE), | ||
37 | // Delta based | 33 | // Delta based |
38 | VersionedMapStoreBuilder.<Integer,String>builder() | 34 | VersionedMapStore.<Integer,String>builder() |
39 | .setStrategy(VersionedMapStoreBuilder.StoreStrategy.DELTA) | 35 | .deltaTransactionStrategy(VersionedMapStoreFactoryBuilder.DeltaTransactionStrategy.SET), |
40 | .setDeltaStorageStrategy(VersionedMapStoreBuilder.DeltaStorageStrategy.SET), | 36 | VersionedMapStore.<Integer,String>builder() |
41 | VersionedMapStoreBuilder.<Integer,String>builder() | 37 | .deltaTransactionStrategy(VersionedMapStoreFactoryBuilder.DeltaTransactionStrategy.LIST) |
42 | .setStrategy(VersionedMapStoreBuilder.StoreStrategy.DELTA) | ||
43 | .setDeltaStorageStrategy(VersionedMapStoreBuilder.DeltaStorageStrategy.LIST) | ||
44 | }; | 38 | }; |
45 | } | 39 | } |