diff options
author | 2021-08-06 20:12:52 +0200 | |
---|---|---|
committer | 2021-08-06 20:12:52 +0200 | |
commit | 8f582814f2f70be8b0019fa6f01aa4e5b01a7143 (patch) | |
tree | 3b2baf74524791394cc96681129792291a842771 | |
parent | getStates moved to interface level (diff) | |
download | refinery-8f582814f2f70be8b0019fa6f01aa4e5b01a7143.tar.gz refinery-8f582814f2f70be8b0019fa6f01aa4e5b01a7143.tar.zst refinery-8f582814f2f70be8b0019fa6f01aa4e5b01a7143.zip |
Renamed Smoke tests to Fuzz tests
-rw-r--r-- | model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/CommitFuzzTest.java (renamed from model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/CommitSmokeTest.java) | 8 | ||||
-rw-r--r-- | model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/ContentEqualsFuzzTest.java (renamed from model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/ContentEqualsSmokeTest.java) | 8 | ||||
-rw-r--r-- | model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/DiffCursorFuzzTest.java (renamed from model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/DiffCursorSmokeTest.java) | 8 | ||||
-rw-r--r-- | model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/MutableFuzzTest.java (renamed from model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/MutableSmokeTest.java) | 6 | ||||
-rw-r--r-- | model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/MutableImmutableCompareFuzzTest.java (renamed from model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/MutableImmutableCompareSmokeTest.java) | 8 | ||||
-rw-r--r-- | model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/RestoreFuzzTest.java (renamed from model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/RestoreSmokeTest.java) | 8 | ||||
-rw-r--r-- | model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/SharedStoreFuzzTest.java (renamed from model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/SharedStoreTest.java) | 8 | ||||
-rw-r--r-- | model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/utils/FuzzTestUtils.java (renamed from model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/utils/SmokeTestUtils.java) | 4 | ||||
-rw-r--r-- | model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/utils/FuzzTestUtilsTest.java (renamed from model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/utils/SmokeTestUtilsTest.java) | 8 | ||||
-rw-r--r-- | model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/utils/MapTestEnvironment.java | 29 |
10 files changed, 56 insertions, 39 deletions
diff --git a/model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/CommitSmokeTest.java b/model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/CommitFuzzTest.java index ce526534..7bd024a4 100644 --- a/model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/CommitSmokeTest.java +++ b/model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/CommitFuzzTest.java | |||
@@ -9,7 +9,7 @@ import org.eclipse.viatra.solver.data.map.ContinousHashProvider; | |||
9 | import org.eclipse.viatra.solver.data.map.VersionedMapStore; | 9 | import org.eclipse.viatra.solver.data.map.VersionedMapStore; |
10 | import org.eclipse.viatra.solver.data.map.VersionedMapStoreImpl; | 10 | import org.eclipse.viatra.solver.data.map.VersionedMapStoreImpl; |
11 | import org.eclipse.viatra.solver.data.map.internal.VersionedMapImpl; | 11 | import org.eclipse.viatra.solver.data.map.internal.VersionedMapImpl; |
12 | import org.eclipse.viatra.solver.data.map.tests.smoke.utils.SmokeTestUtils; | 12 | import org.eclipse.viatra.solver.data.map.tests.smoke.utils.FuzzTestUtils; |
13 | import org.eclipse.viatra.solver.data.map.tests.utils.MapTestEnvironment; | 13 | import org.eclipse.viatra.solver.data.map.tests.utils.MapTestEnvironment; |
14 | import org.junit.jupiter.api.Tag; | 14 | import org.junit.jupiter.api.Tag; |
15 | import org.junit.jupiter.api.Timeout; | 15 | import org.junit.jupiter.api.Timeout; |
@@ -17,7 +17,7 @@ import org.junit.jupiter.params.ParameterizedTest; | |||
17 | import org.junit.jupiter.params.provider.Arguments; | 17 | import org.junit.jupiter.params.provider.Arguments; |
18 | import org.junit.jupiter.params.provider.MethodSource; | 18 | import org.junit.jupiter.params.provider.MethodSource; |
19 | 19 | ||
20 | class CommitSmokeTest { | 20 | class CommitFuzzTest { |
21 | private void runSmokeTest(String scenario, int seed, int steps, int maxKey, int maxValue, int commitFrequency, | 21 | private void runSmokeTest(String scenario, int seed, int steps, int maxKey, int maxValue, int commitFrequency, |
22 | boolean evilHash) { | 22 | boolean evilHash) { |
23 | String[] values = MapTestEnvironment.prepareValues(maxValue); | 23 | String[] values = MapTestEnvironment.prepareValues(maxValue); |
@@ -74,7 +74,7 @@ class CommitSmokeTest { | |||
74 | } | 74 | } |
75 | 75 | ||
76 | static Stream<Arguments> parametrizedFastSmoke() { | 76 | static Stream<Arguments> parametrizedFastSmoke() { |
77 | return SmokeTestUtils.permutationWithSize(new Object[] { SmokeTestUtils.FAST_STEP_COUNT }, new Object[] { 3, 32, 32 * 32 }, | 77 | return FuzzTestUtils.permutationWithSize(new Object[] { FuzzTestUtils.FAST_STEP_COUNT }, new Object[] { 3, 32, 32 * 32 }, |
78 | new Object[] { 2, 3 }, new Object[] { 1, 10, 100 }, new Object[] { 1, 2, 3 }, | 78 | new Object[] { 2, 3 }, new Object[] { 1, 10, 100 }, new Object[] { 1, 2, 3 }, |
79 | new Object[] { false, true }); | 79 | new Object[] { false, true }); |
80 | } | 80 | } |
@@ -90,6 +90,6 @@ class CommitSmokeTest { | |||
90 | } | 90 | } |
91 | 91 | ||
92 | static Stream<Arguments> parametrizedSlowSmoke() { | 92 | static Stream<Arguments> parametrizedSlowSmoke() { |
93 | return SmokeTestUtils.changeStepCount(parametrizedFastSmoke(), 1); | 93 | return FuzzTestUtils.changeStepCount(parametrizedFastSmoke(), 1); |
94 | } | 94 | } |
95 | } | 95 | } |
diff --git a/model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/ContentEqualsSmokeTest.java b/model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/ContentEqualsFuzzTest.java index 2fe2a9a5..11e393d4 100644 --- a/model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/ContentEqualsSmokeTest.java +++ b/model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/ContentEqualsFuzzTest.java | |||
@@ -16,7 +16,7 @@ import org.eclipse.viatra.solver.data.map.VersionedMap; | |||
16 | import org.eclipse.viatra.solver.data.map.VersionedMapStore; | 16 | import org.eclipse.viatra.solver.data.map.VersionedMapStore; |
17 | import org.eclipse.viatra.solver.data.map.VersionedMapStoreImpl; | 17 | import org.eclipse.viatra.solver.data.map.VersionedMapStoreImpl; |
18 | import org.eclipse.viatra.solver.data.map.internal.VersionedMapImpl; | 18 | import org.eclipse.viatra.solver.data.map.internal.VersionedMapImpl; |
19 | import org.eclipse.viatra.solver.data.map.tests.smoke.utils.SmokeTestUtils; | 19 | import org.eclipse.viatra.solver.data.map.tests.smoke.utils.FuzzTestUtils; |
20 | import org.eclipse.viatra.solver.data.map.tests.utils.MapTestEnvironment; | 20 | import org.eclipse.viatra.solver.data.map.tests.utils.MapTestEnvironment; |
21 | import org.junit.jupiter.api.Tag; | 21 | import org.junit.jupiter.api.Tag; |
22 | import org.junit.jupiter.api.Timeout; | 22 | import org.junit.jupiter.api.Timeout; |
@@ -24,7 +24,7 @@ import org.junit.jupiter.params.ParameterizedTest; | |||
24 | import org.junit.jupiter.params.provider.Arguments; | 24 | import org.junit.jupiter.params.provider.Arguments; |
25 | import org.junit.jupiter.params.provider.MethodSource; | 25 | import org.junit.jupiter.params.provider.MethodSource; |
26 | 26 | ||
27 | class ContentEqualsSmokeTest { | 27 | class ContentEqualsFuzzTest { |
28 | private void runSmokeTest(String scenario, int seed, int steps, int maxKey, int maxValue, int commitFrequency, | 28 | private void runSmokeTest(String scenario, int seed, int steps, int maxKey, int maxValue, int commitFrequency, |
29 | boolean evilHash) { | 29 | boolean evilHash) { |
30 | String[] values = MapTestEnvironment.prepareValues(maxValue); | 30 | String[] values = MapTestEnvironment.prepareValues(maxValue); |
@@ -121,7 +121,7 @@ class ContentEqualsSmokeTest { | |||
121 | } | 121 | } |
122 | 122 | ||
123 | static Stream<Arguments> parametrizedFastSmoke() { | 123 | static Stream<Arguments> parametrizedFastSmoke() { |
124 | return SmokeTestUtils.permutationWithSize(new Object[] { SmokeTestUtils.FAST_STEP_COUNT }, new Object[] { 3, 32, 32 * 32 }, | 124 | return FuzzTestUtils.permutationWithSize(new Object[] { FuzzTestUtils.FAST_STEP_COUNT }, new Object[] { 3, 32, 32 * 32 }, |
125 | new Object[] { 2, 3 }, new Object[] { 1, 10, 100 }, new Object[] { 1, 2, 3 }, | 125 | new Object[] { 2, 3 }, new Object[] { 1, 10, 100 }, new Object[] { 1, 2, 3 }, |
126 | new Object[] { false, true }); | 126 | new Object[] { false, true }); |
127 | } | 127 | } |
@@ -137,6 +137,6 @@ class ContentEqualsSmokeTest { | |||
137 | } | 137 | } |
138 | 138 | ||
139 | static Stream<Arguments> parametrizedSlowSmoke() { | 139 | static Stream<Arguments> parametrizedSlowSmoke() { |
140 | return SmokeTestUtils.changeStepCount(parametrizedFastSmoke(), 1); | 140 | return FuzzTestUtils.changeStepCount(parametrizedFastSmoke(), 1); |
141 | } | 141 | } |
142 | } | 142 | } |
diff --git a/model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/DiffCursorSmokeTest.java b/model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/DiffCursorFuzzTest.java index 5b530892..ae1c49ff 100644 --- a/model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/DiffCursorSmokeTest.java +++ b/model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/DiffCursorFuzzTest.java | |||
@@ -10,7 +10,7 @@ import org.eclipse.viatra.solver.data.map.DiffCursor; | |||
10 | import org.eclipse.viatra.solver.data.map.VersionedMapStore; | 10 | import org.eclipse.viatra.solver.data.map.VersionedMapStore; |
11 | import org.eclipse.viatra.solver.data.map.VersionedMapStoreImpl; | 11 | import org.eclipse.viatra.solver.data.map.VersionedMapStoreImpl; |
12 | import org.eclipse.viatra.solver.data.map.internal.VersionedMapImpl; | 12 | import org.eclipse.viatra.solver.data.map.internal.VersionedMapImpl; |
13 | import org.eclipse.viatra.solver.data.map.tests.smoke.utils.SmokeTestUtils; | 13 | import org.eclipse.viatra.solver.data.map.tests.smoke.utils.FuzzTestUtils; |
14 | import org.eclipse.viatra.solver.data.map.tests.utils.MapTestEnvironment; | 14 | import org.eclipse.viatra.solver.data.map.tests.utils.MapTestEnvironment; |
15 | import org.junit.jupiter.api.Tag; | 15 | import org.junit.jupiter.api.Tag; |
16 | import org.junit.jupiter.api.Timeout; | 16 | import org.junit.jupiter.api.Timeout; |
@@ -18,7 +18,7 @@ import org.junit.jupiter.params.ParameterizedTest; | |||
18 | import org.junit.jupiter.params.provider.Arguments; | 18 | import org.junit.jupiter.params.provider.Arguments; |
19 | import org.junit.jupiter.params.provider.MethodSource; | 19 | import org.junit.jupiter.params.provider.MethodSource; |
20 | 20 | ||
21 | class DiffCursorSmokeTest { | 21 | class DiffCursorFuzzTest { |
22 | private void runSmokeTest(String scenario, int seed, int steps, int maxKey, int maxValue, int commitFrequency, | 22 | private void runSmokeTest(String scenario, int seed, int steps, int maxKey, int maxValue, int commitFrequency, |
23 | boolean evilHash) { | 23 | boolean evilHash) { |
24 | String[] values = MapTestEnvironment.prepareValues(maxValue); | 24 | String[] values = MapTestEnvironment.prepareValues(maxValue); |
@@ -96,7 +96,7 @@ class DiffCursorSmokeTest { | |||
96 | } | 96 | } |
97 | 97 | ||
98 | static Stream<Arguments> parametrizedSmoke() { | 98 | static Stream<Arguments> parametrizedSmoke() { |
99 | return SmokeTestUtils.permutationWithSize(new Object[] { SmokeTestUtils.FAST_STEP_COUNT }, new Object[] { 3, 32, 32 * 32 }, | 99 | return FuzzTestUtils.permutationWithSize(new Object[] { FuzzTestUtils.FAST_STEP_COUNT }, new Object[] { 3, 32, 32 * 32 }, |
100 | new Object[] { 2, 3 }, new Object[] { 1, 10, 100 }, new Object[] { 1, 2, 3 }, | 100 | new Object[] { 2, 3 }, new Object[] { 1, 10, 100 }, new Object[] { 1, 2, 3 }, |
101 | new Object[] { false, true }); | 101 | new Object[] { false, true }); |
102 | } | 102 | } |
@@ -111,6 +111,6 @@ class DiffCursorSmokeTest { | |||
111 | } | 111 | } |
112 | 112 | ||
113 | static Stream<Arguments> parametrizedSlowSmoke() { | 113 | static Stream<Arguments> parametrizedSlowSmoke() { |
114 | return SmokeTestUtils.changeStepCount(parametrizedSmoke(), 1); | 114 | return FuzzTestUtils.changeStepCount(parametrizedSmoke(), 1); |
115 | } | 115 | } |
116 | } | 116 | } |
diff --git a/model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/MutableSmokeTest.java b/model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/MutableFuzzTest.java index b91e927c..13ef1eb6 100644 --- a/model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/MutableSmokeTest.java +++ b/model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/MutableFuzzTest.java | |||
@@ -9,7 +9,7 @@ import org.eclipse.viatra.solver.data.map.ContinousHashProvider; | |||
9 | import org.eclipse.viatra.solver.data.map.VersionedMapStore; | 9 | import org.eclipse.viatra.solver.data.map.VersionedMapStore; |
10 | import org.eclipse.viatra.solver.data.map.VersionedMapStoreImpl; | 10 | import org.eclipse.viatra.solver.data.map.VersionedMapStoreImpl; |
11 | import org.eclipse.viatra.solver.data.map.internal.VersionedMapImpl; | 11 | import org.eclipse.viatra.solver.data.map.internal.VersionedMapImpl; |
12 | import org.eclipse.viatra.solver.data.map.tests.smoke.utils.SmokeTestUtils; | 12 | import org.eclipse.viatra.solver.data.map.tests.smoke.utils.FuzzTestUtils; |
13 | import org.eclipse.viatra.solver.data.map.tests.utils.MapTestEnvironment; | 13 | import org.eclipse.viatra.solver.data.map.tests.utils.MapTestEnvironment; |
14 | import org.junit.jupiter.api.Tag; | 14 | import org.junit.jupiter.api.Tag; |
15 | import org.junit.jupiter.api.Timeout; | 15 | import org.junit.jupiter.api.Timeout; |
@@ -17,7 +17,7 @@ import org.junit.jupiter.params.ParameterizedTest; | |||
17 | import org.junit.jupiter.params.provider.Arguments; | 17 | import org.junit.jupiter.params.provider.Arguments; |
18 | import org.junit.jupiter.params.provider.MethodSource; | 18 | import org.junit.jupiter.params.provider.MethodSource; |
19 | 19 | ||
20 | class MutableSmokeTest { | 20 | class MutableFuzzTest { |
21 | private void runSmokeTest(String scenario, int seed, int steps, int maxKey, int maxValue, boolean evilHash) { | 21 | private void runSmokeTest(String scenario, int seed, int steps, int maxKey, int maxValue, boolean evilHash) { |
22 | String[] values = MapTestEnvironment.prepareValues(maxValue); | 22 | String[] values = MapTestEnvironment.prepareValues(maxValue); |
23 | ContinousHashProvider<Integer> chp = MapTestEnvironment.prepareHashProvider(evilHash); | 23 | ContinousHashProvider<Integer> chp = MapTestEnvironment.prepareHashProvider(evilHash); |
@@ -70,7 +70,7 @@ class MutableSmokeTest { | |||
70 | } | 70 | } |
71 | 71 | ||
72 | static Stream<Arguments> parametrizedSmoke() { | 72 | static Stream<Arguments> parametrizedSmoke() { |
73 | return SmokeTestUtils.permutationWithSize(new Object[] { SmokeTestUtils.FAST_STEP_COUNT }, | 73 | return FuzzTestUtils.permutationWithSize(new Object[] { FuzzTestUtils.FAST_STEP_COUNT }, |
74 | new Object[] { 3, 32, 32 * 32, 32 * 32 * 32 * 32 }, new Object[] { 2, 3 }, new Object[] { 1, 2, 3 }, | 74 | new Object[] { 3, 32, 32 * 32, 32 * 32 * 32 * 32 }, new Object[] { 2, 3 }, new Object[] { 1, 2, 3 }, |
75 | new Object[] { false, true }); | 75 | new Object[] { false, true }); |
76 | } | 76 | } |
diff --git a/model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/MutableImmutableCompareSmokeTest.java b/model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/MutableImmutableCompareFuzzTest.java index 159a761c..77d55d5a 100644 --- a/model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/MutableImmutableCompareSmokeTest.java +++ b/model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/MutableImmutableCompareFuzzTest.java | |||
@@ -9,7 +9,7 @@ import org.eclipse.viatra.solver.data.map.ContinousHashProvider; | |||
9 | import org.eclipse.viatra.solver.data.map.VersionedMapStore; | 9 | import org.eclipse.viatra.solver.data.map.VersionedMapStore; |
10 | import org.eclipse.viatra.solver.data.map.VersionedMapStoreImpl; | 10 | import org.eclipse.viatra.solver.data.map.VersionedMapStoreImpl; |
11 | import org.eclipse.viatra.solver.data.map.internal.VersionedMapImpl; | 11 | import org.eclipse.viatra.solver.data.map.internal.VersionedMapImpl; |
12 | import org.eclipse.viatra.solver.data.map.tests.smoke.utils.SmokeTestUtils; | 12 | import org.eclipse.viatra.solver.data.map.tests.smoke.utils.FuzzTestUtils; |
13 | import org.eclipse.viatra.solver.data.map.tests.utils.MapTestEnvironment; | 13 | import org.eclipse.viatra.solver.data.map.tests.utils.MapTestEnvironment; |
14 | import org.junit.jupiter.api.Tag; | 14 | import org.junit.jupiter.api.Tag; |
15 | import org.junit.jupiter.api.Timeout; | 15 | import org.junit.jupiter.api.Timeout; |
@@ -17,7 +17,7 @@ import org.junit.jupiter.params.ParameterizedTest; | |||
17 | import org.junit.jupiter.params.provider.Arguments; | 17 | import org.junit.jupiter.params.provider.Arguments; |
18 | import org.junit.jupiter.params.provider.MethodSource; | 18 | import org.junit.jupiter.params.provider.MethodSource; |
19 | 19 | ||
20 | class MutableImmutableCompareSmokeTest { | 20 | class MutableImmutableCompareFuzzTest { |
21 | private void runSmokeTest(String scenario, int seed, int steps, int maxKey, int maxValue, int commitFrequency, | 21 | private void runSmokeTest(String scenario, int seed, int steps, int maxKey, int maxValue, int commitFrequency, |
22 | boolean evilHash) { | 22 | boolean evilHash) { |
23 | String[] values = MapTestEnvironment.prepareValues(maxValue); | 23 | String[] values = MapTestEnvironment.prepareValues(maxValue); |
@@ -67,7 +67,7 @@ class MutableImmutableCompareSmokeTest { | |||
67 | } | 67 | } |
68 | 68 | ||
69 | static Stream<Arguments> parametrizedFastSmoke() { | 69 | static Stream<Arguments> parametrizedFastSmoke() { |
70 | return SmokeTestUtils.permutationWithSize(new Object[] { SmokeTestUtils.FAST_STEP_COUNT }, new Object[] { 3, 32, 32 * 32 }, | 70 | return FuzzTestUtils.permutationWithSize(new Object[] { FuzzTestUtils.FAST_STEP_COUNT }, new Object[] { 3, 32, 32 * 32 }, |
71 | new Object[] { 2, 3 }, new Object[] { 1, 10, 100 }, new Object[] { 1, 2, 3 }, | 71 | new Object[] { 2, 3 }, new Object[] { 1, 10, 100 }, new Object[] { 1, 2, 3 }, |
72 | new Object[] { false, true }); | 72 | new Object[] { false, true }); |
73 | } | 73 | } |
@@ -83,6 +83,6 @@ class MutableImmutableCompareSmokeTest { | |||
83 | } | 83 | } |
84 | 84 | ||
85 | static Stream<Arguments> parametrizedSlowSmoke() { | 85 | static Stream<Arguments> parametrizedSlowSmoke() { |
86 | return SmokeTestUtils.changeStepCount(MutableImmutableCompareSmokeTest.parametrizedFastSmoke(), 1); | 86 | return FuzzTestUtils.changeStepCount(MutableImmutableCompareFuzzTest.parametrizedFastSmoke(), 1); |
87 | } | 87 | } |
88 | } | 88 | } |
diff --git a/model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/RestoreSmokeTest.java b/model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/RestoreFuzzTest.java index 0b06a6a9..5ce5734b 100644 --- a/model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/RestoreSmokeTest.java +++ b/model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/RestoreFuzzTest.java | |||
@@ -11,7 +11,7 @@ import org.eclipse.viatra.solver.data.map.ContinousHashProvider; | |||
11 | import org.eclipse.viatra.solver.data.map.VersionedMapStore; | 11 | import org.eclipse.viatra.solver.data.map.VersionedMapStore; |
12 | import org.eclipse.viatra.solver.data.map.VersionedMapStoreImpl; | 12 | import org.eclipse.viatra.solver.data.map.VersionedMapStoreImpl; |
13 | import org.eclipse.viatra.solver.data.map.internal.VersionedMapImpl; | 13 | import org.eclipse.viatra.solver.data.map.internal.VersionedMapImpl; |
14 | import org.eclipse.viatra.solver.data.map.tests.smoke.utils.SmokeTestUtils; | 14 | import org.eclipse.viatra.solver.data.map.tests.smoke.utils.FuzzTestUtils; |
15 | import org.eclipse.viatra.solver.data.map.tests.utils.MapTestEnvironment; | 15 | import org.eclipse.viatra.solver.data.map.tests.utils.MapTestEnvironment; |
16 | import org.junit.jupiter.api.Tag; | 16 | import org.junit.jupiter.api.Tag; |
17 | import org.junit.jupiter.api.Timeout; | 17 | import org.junit.jupiter.api.Timeout; |
@@ -19,7 +19,7 @@ import org.junit.jupiter.params.ParameterizedTest; | |||
19 | import org.junit.jupiter.params.provider.Arguments; | 19 | import org.junit.jupiter.params.provider.Arguments; |
20 | import org.junit.jupiter.params.provider.MethodSource; | 20 | import org.junit.jupiter.params.provider.MethodSource; |
21 | 21 | ||
22 | class RestoreSmokeTest { | 22 | class RestoreFuzzTest { |
23 | private void runSmokeTest(String scenario, int seed, int steps, int maxKey, int maxValue, int commitFrequency, | 23 | private void runSmokeTest(String scenario, int seed, int steps, int maxKey, int maxValue, int commitFrequency, |
24 | boolean evilHash) { | 24 | boolean evilHash) { |
25 | String[] values = MapTestEnvironment.prepareValues(maxValue); | 25 | String[] values = MapTestEnvironment.prepareValues(maxValue); |
@@ -87,7 +87,7 @@ class RestoreSmokeTest { | |||
87 | } | 87 | } |
88 | 88 | ||
89 | static Stream<Arguments> parametrizedFastSmoke() { | 89 | static Stream<Arguments> parametrizedFastSmoke() { |
90 | return SmokeTestUtils.permutationWithSize(new Object[] { SmokeTestUtils.FAST_STEP_COUNT }, new Object[] { 3, 32, 32 * 32 }, | 90 | return FuzzTestUtils.permutationWithSize(new Object[] { FuzzTestUtils.FAST_STEP_COUNT }, new Object[] { 3, 32, 32 * 32 }, |
91 | new Object[] { 2, 3 }, new Object[] { 1, 10, 100 }, new Object[] { 1, 2, 3 }, | 91 | new Object[] { 2, 3 }, new Object[] { 1, 10, 100 }, new Object[] { 1, 2, 3 }, |
92 | new Object[] { false, true }); | 92 | new Object[] { false, true }); |
93 | } | 93 | } |
@@ -103,6 +103,6 @@ class RestoreSmokeTest { | |||
103 | } | 103 | } |
104 | 104 | ||
105 | static Stream<Arguments> parametrizedSlowSmoke() { | 105 | static Stream<Arguments> parametrizedSlowSmoke() { |
106 | return SmokeTestUtils.changeStepCount(RestoreSmokeTest.parametrizedFastSmoke(), 1); | 106 | return FuzzTestUtils.changeStepCount(RestoreFuzzTest.parametrizedFastSmoke(), 1); |
107 | } | 107 | } |
108 | } | 108 | } |
diff --git a/model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/SharedStoreTest.java b/model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/SharedStoreFuzzTest.java index 44b30a29..0326ebfa 100644 --- a/model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/SharedStoreTest.java +++ b/model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/SharedStoreFuzzTest.java | |||
@@ -11,7 +11,7 @@ import org.eclipse.viatra.solver.data.map.ContinousHashProvider; | |||
11 | import org.eclipse.viatra.solver.data.map.VersionedMapStore; | 11 | import org.eclipse.viatra.solver.data.map.VersionedMapStore; |
12 | import org.eclipse.viatra.solver.data.map.VersionedMapStoreImpl; | 12 | import org.eclipse.viatra.solver.data.map.VersionedMapStoreImpl; |
13 | import org.eclipse.viatra.solver.data.map.internal.VersionedMapImpl; | 13 | import org.eclipse.viatra.solver.data.map.internal.VersionedMapImpl; |
14 | import org.eclipse.viatra.solver.data.map.tests.smoke.utils.SmokeTestUtils; | 14 | import org.eclipse.viatra.solver.data.map.tests.smoke.utils.FuzzTestUtils; |
15 | import org.eclipse.viatra.solver.data.map.tests.utils.MapTestEnvironment; | 15 | import org.eclipse.viatra.solver.data.map.tests.utils.MapTestEnvironment; |
16 | import org.junit.jupiter.api.Tag; | 16 | import org.junit.jupiter.api.Tag; |
17 | import org.junit.jupiter.api.Timeout; | 17 | import org.junit.jupiter.api.Timeout; |
@@ -19,7 +19,7 @@ import org.junit.jupiter.params.ParameterizedTest; | |||
19 | import org.junit.jupiter.params.provider.Arguments; | 19 | import org.junit.jupiter.params.provider.Arguments; |
20 | import org.junit.jupiter.params.provider.MethodSource; | 20 | import org.junit.jupiter.params.provider.MethodSource; |
21 | 21 | ||
22 | public class SharedStoreTest { | 22 | class SharedStoreFuzzTest { |
23 | private void runSmokeTest(String scenario, int seed, int steps, int maxKey, int maxValue, int commitFrequency, | 23 | private void runSmokeTest(String scenario, int seed, int steps, int maxKey, int maxValue, int commitFrequency, |
24 | boolean evilHash) { | 24 | boolean evilHash) { |
25 | String[] values = MapTestEnvironment.prepareValues(maxValue); | 25 | String[] values = MapTestEnvironment.prepareValues(maxValue); |
@@ -91,7 +91,7 @@ public class SharedStoreTest { | |||
91 | } | 91 | } |
92 | 92 | ||
93 | static Stream<Arguments> parametrizedFastSmoke() { | 93 | static Stream<Arguments> parametrizedFastSmoke() { |
94 | return SmokeTestUtils.permutationWithSize(new Object[] { SmokeTestUtils.FAST_STEP_COUNT }, new Object[] { 3, 32, 32 * 32 }, | 94 | return FuzzTestUtils.permutationWithSize(new Object[] { FuzzTestUtils.FAST_STEP_COUNT }, new Object[] { 3, 32, 32 * 32 }, |
95 | new Object[] { 2, 3 }, new Object[] { 1, 10, 100 }, new Object[] { 1, 2, 3 }, | 95 | new Object[] { 2, 3 }, new Object[] { 1, 10, 100 }, new Object[] { 1, 2, 3 }, |
96 | new Object[] { false, true }); | 96 | new Object[] { false, true }); |
97 | } | 97 | } |
@@ -107,6 +107,6 @@ public class SharedStoreTest { | |||
107 | } | 107 | } |
108 | 108 | ||
109 | static Stream<Arguments> parametrizedSlowSmoke() { | 109 | static Stream<Arguments> parametrizedSlowSmoke() { |
110 | return SmokeTestUtils.changeStepCount(RestoreSmokeTest.parametrizedFastSmoke(), 1); | 110 | return FuzzTestUtils.changeStepCount(RestoreFuzzTest.parametrizedFastSmoke(), 1); |
111 | } | 111 | } |
112 | } | 112 | } |
diff --git a/model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/utils/SmokeTestUtils.java b/model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/utils/FuzzTestUtils.java index f85fb2c1..1e85020a 100644 --- a/model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/utils/SmokeTestUtils.java +++ b/model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/utils/FuzzTestUtils.java | |||
@@ -7,11 +7,11 @@ import java.util.stream.Stream; | |||
7 | 7 | ||
8 | import org.junit.jupiter.params.provider.Arguments; | 8 | import org.junit.jupiter.params.provider.Arguments; |
9 | 9 | ||
10 | public final class SmokeTestUtils { | 10 | public final class FuzzTestUtils { |
11 | public static final int FAST_STEP_COUNT = 500; | 11 | public static final int FAST_STEP_COUNT = 500; |
12 | public static final int SLOW_STEP_COUNT = 32 * 32 * 32 * 32; | 12 | public static final int SLOW_STEP_COUNT = 32 * 32 * 32 * 32; |
13 | 13 | ||
14 | private SmokeTestUtils() { | 14 | private FuzzTestUtils() { |
15 | throw new IllegalStateException("This is a static utility class and should not be instantiated directly"); | 15 | throw new IllegalStateException("This is a static utility class and should not be instantiated directly"); |
16 | } | 16 | } |
17 | 17 | ||
diff --git a/model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/utils/SmokeTestUtilsTest.java b/model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/utils/FuzzTestUtilsTest.java index 80a53a20..e1b49dfd 100644 --- a/model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/utils/SmokeTestUtilsTest.java +++ b/model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/smoke/utils/FuzzTestUtilsTest.java | |||
@@ -6,24 +6,24 @@ import java.util.List; | |||
6 | 6 | ||
7 | import org.junit.jupiter.api.Test; | 7 | import org.junit.jupiter.api.Test; |
8 | 8 | ||
9 | class SmokeTestUtilsTest { | 9 | class FuzzTestUtilsTest { |
10 | @Test | 10 | @Test |
11 | void permutationInternalTest() { | 11 | void permutationInternalTest() { |
12 | List<List<Object>> res = SmokeTestUtils.permutationInternal(0, new Object[] { 1, 2, 3 }, | 12 | List<List<Object>> res = FuzzTestUtils.permutationInternal(0, new Object[] { 1, 2, 3 }, |
13 | new Object[] { 'a', 'b', 'c' }, new Object[] { "alpha", "beta", "gamma", "delta" }); | 13 | new Object[] { 'a', 'b', 'c' }, new Object[] { "alpha", "beta", "gamma", "delta" }); |
14 | assertEquals(3 * 3 * 4, res.size()); | 14 | assertEquals(3 * 3 * 4, res.size()); |
15 | } | 15 | } |
16 | 16 | ||
17 | @Test | 17 | @Test |
18 | void permutationTest1() { | 18 | void permutationTest1() { |
19 | var res = SmokeTestUtils.permutation(new Object[] { 1, 2, 3 }, new Object[] { 'a', 'b', 'c' }, | 19 | var res = FuzzTestUtils.permutation(new Object[] { 1, 2, 3 }, new Object[] { 'a', 'b', 'c' }, |
20 | new Object[] { "alpha", "beta", "gamma", "delta" }); | 20 | new Object[] { "alpha", "beta", "gamma", "delta" }); |
21 | assertEquals(3 * 3 * 4, res.count()); | 21 | assertEquals(3 * 3 * 4, res.count()); |
22 | } | 22 | } |
23 | 23 | ||
24 | @Test | 24 | @Test |
25 | void permutationTest2() { | 25 | void permutationTest2() { |
26 | var res = SmokeTestUtils.permutation(new Object[] { 1, 2, 3 }, new Object[] { 'a', 'b', 'c' }, | 26 | var res = FuzzTestUtils.permutation(new Object[] { 1, 2, 3 }, new Object[] { 'a', 'b', 'c' }, |
27 | new Object[] { "alpha", "beta", "gamma", "delta" }); | 27 | new Object[] { "alpha", "beta", "gamma", "delta" }); |
28 | var arguments = res.findFirst().get().get(); | 28 | var arguments = res.findFirst().get().get(); |
29 | assertEquals(1, arguments[0]); | 29 | assertEquals(1, arguments[0]); |
diff --git a/model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/utils/MapTestEnvironment.java b/model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/utils/MapTestEnvironment.java index 8fd4bece..3f276481 100644 --- a/model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/utils/MapTestEnvironment.java +++ b/model-data/src/test/java/org/eclipse/viatra/solver/data/map/tests/utils/MapTestEnvironment.java | |||
@@ -6,6 +6,7 @@ import static org.junit.jupiter.api.Assertions.fail; | |||
6 | 6 | ||
7 | import java.util.HashMap; | 7 | import java.util.HashMap; |
8 | import java.util.Iterator; | 8 | import java.util.Iterator; |
9 | import java.util.List; | ||
9 | import java.util.Map; | 10 | import java.util.Map; |
10 | import java.util.Map.Entry; | 11 | import java.util.Map.Entry; |
11 | import java.util.TreeMap; | 12 | import java.util.TreeMap; |
@@ -54,9 +55,13 @@ public class MapTestEnvironment<K, V> { | |||
54 | } | 55 | } |
55 | 56 | ||
56 | } | 57 | } |
57 | 58 | ||
58 | public static <K, V> void compareTwoMaps(String title, VersionedMapImpl<K, V> map1, | 59 | public static <K, V> void compareTwoMaps(String title, VersionedMapImpl<K, V> map1, |
59 | VersionedMapImpl<K, V> map2) { | 60 | VersionedMapImpl<K, V> map2) { |
61 | compareTwoMaps(title, map1, map2, null); | ||
62 | } | ||
63 | public static <K, V> void compareTwoMaps(String title, VersionedMapImpl<K, V> map1, | ||
64 | VersionedMapImpl<K, V> map2, List<Throwable> errors) { | ||
60 | // 1. Comparing cursors. | 65 | // 1. Comparing cursors. |
61 | Cursor<K, V> cursor1 = map1.getCursor(); | 66 | Cursor<K, V> cursor1 = map1.getCursor(); |
62 | Cursor<K, V> cursor2 = map2.getCursor(); | 67 | Cursor<K, V> cursor2 = map2.getCursor(); |
@@ -64,8 +69,8 @@ public class MapTestEnvironment<K, V> { | |||
64 | if (cursor2.isTerminated()) { | 69 | if (cursor2.isTerminated()) { |
65 | fail("cursor 2 terminated before cursor1"); | 70 | fail("cursor 2 terminated before cursor1"); |
66 | } | 71 | } |
67 | assertEquals(cursor1.getKey(), cursor2.getKey()); | 72 | assertEqualsList(cursor1.getKey(), cursor2.getKey(),"Keys not equal", errors); |
68 | assertEquals(cursor2.getValue(), cursor2.getValue()); | 73 | assertEqualsList(cursor2.getValue(), cursor2.getValue(), "Values not equal", errors); |
69 | cursor1.move(); | 74 | cursor1.move(); |
70 | cursor2.move(); | 75 | cursor2.move(); |
71 | } | 76 | } |
@@ -73,9 +78,21 @@ public class MapTestEnvironment<K, V> { | |||
73 | fail("cursor 1 terminated before cursor 2"); | 78 | fail("cursor 1 terminated before cursor 2"); |
74 | 79 | ||
75 | // 2.1. comparing hash codes | 80 | // 2.1. comparing hash codes |
76 | assertEquals(map1.hashCode(), map2.hashCode(), title + ": hash code check"); | 81 | assertEqualsList(map1.hashCode(), map2.hashCode(), title + ": hash code check",errors); |
77 | assertEquals(map1, map2, title + ": 1.equals(2)"); | 82 | assertEqualsList(map1, map2, title + ": 1.equals(2)",errors); |
78 | assertEquals(map2, map1, title + ": 2.equals(1)"); | 83 | assertEqualsList(map2, map1, title + ": 2.equals(1)",errors); |
84 | } | ||
85 | private static void assertEqualsList(Object o1, Object o2, String message, List<Throwable> errors) { | ||
86 | if(errors == null) { | ||
87 | assertEquals(o1, o2, message); | ||
88 | } else { | ||
89 | if(o1 != null) { | ||
90 | if(!(o1.equals(o2))) { | ||
91 | AssertionError error = new AssertionError((message != null ? message+" " : "") + "expected: " + o1 + " but was : " + o2); | ||
92 | errors.add(error); | ||
93 | } | ||
94 | } | ||
95 | } | ||
79 | } | 96 | } |
80 | 97 | ||
81 | public VersionedMapImpl<K, V> sut; | 98 | public VersionedMapImpl<K, V> sut; |