diff options
Diffstat (limited to 'subprojects/store/src/test/java')
2 files changed, 8 insertions, 10 deletions
diff --git a/subprojects/store/src/test/java/tools/refinery/store/representation/cardinality/UpperCardinalitiesTest.java b/subprojects/store/src/test/java/tools/refinery/store/representation/cardinality/UpperCardinalitiesTest.java index e61f7b36..e403eec2 100644 --- a/subprojects/store/src/test/java/tools/refinery/store/representation/cardinality/UpperCardinalitiesTest.java +++ b/subprojects/store/src/test/java/tools/refinery/store/representation/cardinality/UpperCardinalitiesTest.java | |||
@@ -8,9 +8,6 @@ package tools.refinery.store.representation.cardinality; | |||
8 | import org.junit.jupiter.api.Test; | 8 | import org.junit.jupiter.api.Test; |
9 | import org.junit.jupiter.params.ParameterizedTest; | 9 | import org.junit.jupiter.params.ParameterizedTest; |
10 | import org.junit.jupiter.params.provider.ValueSource; | 10 | import org.junit.jupiter.params.provider.ValueSource; |
11 | import tools.refinery.store.representation.cardinality.FiniteUpperCardinality; | ||
12 | import tools.refinery.store.representation.cardinality.UnboundedUpperCardinality; | ||
13 | import tools.refinery.store.representation.cardinality.UpperCardinalities; | ||
14 | 11 | ||
15 | import static org.hamcrest.MatcherAssert.assertThat; | 12 | import static org.hamcrest.MatcherAssert.assertThat; |
16 | import static org.hamcrest.Matchers.equalTo; | 13 | import static org.hamcrest.Matchers.equalTo; |
@@ -20,14 +17,14 @@ class UpperCardinalitiesTest { | |||
20 | @ParameterizedTest | 17 | @ParameterizedTest |
21 | @ValueSource(ints = {0, 1, 255, 256, 1000, Integer.MAX_VALUE}) | 18 | @ValueSource(ints = {0, 1, 255, 256, 1000, Integer.MAX_VALUE}) |
22 | void valueOfBoundedTest(int value) { | 19 | void valueOfBoundedTest(int value) { |
23 | var upperCardinality = UpperCardinalities.valueOf(value); | 20 | var upperCardinality = UpperCardinalities.atMost(value); |
24 | assertThat(upperCardinality, instanceOf(FiniteUpperCardinality.class)); | 21 | assertThat(upperCardinality, instanceOf(FiniteUpperCardinality.class)); |
25 | assertThat(((FiniteUpperCardinality) upperCardinality).finiteUpperBound(), equalTo(value)); | 22 | assertThat(((FiniteUpperCardinality) upperCardinality).finiteUpperBound(), equalTo(value)); |
26 | } | 23 | } |
27 | 24 | ||
28 | @Test | 25 | @Test |
29 | void valueOfUnboundedTest() { | 26 | void valueOfUnboundedTest() { |
30 | var upperCardinality = UpperCardinalities.valueOf(-1); | 27 | var upperCardinality = UpperCardinalities.atMost(-1); |
31 | assertThat(upperCardinality, instanceOf(UnboundedUpperCardinality.class)); | 28 | assertThat(upperCardinality, instanceOf(UnboundedUpperCardinality.class)); |
32 | } | 29 | } |
33 | } | 30 | } |
diff --git a/subprojects/store/src/test/java/tools/refinery/store/statecoding/ExperimentalSetupTest.java b/subprojects/store/src/test/java/tools/refinery/store/statecoding/ExperimentalSetupTest.java index 25b5dca1..f5ffc18d 100644 --- a/subprojects/store/src/test/java/tools/refinery/store/statecoding/ExperimentalSetupTest.java +++ b/subprojects/store/src/test/java/tools/refinery/store/statecoding/ExperimentalSetupTest.java | |||
@@ -5,7 +5,8 @@ | |||
5 | */ | 5 | */ |
6 | package tools.refinery.store.statecoding; | 6 | package tools.refinery.store.statecoding; |
7 | 7 | ||
8 | import org.eclipse.collections.impl.map.mutable.primitive.IntObjectHashMap; | 8 | import org.eclipse.collections.api.factory.primitive.IntObjectMaps; |
9 | import org.eclipse.collections.api.map.primitive.MutableIntObjectMap; | ||
9 | import org.junit.jupiter.api.Tag; | 10 | import org.junit.jupiter.api.Tag; |
10 | import org.junit.jupiter.api.Test; | 11 | import org.junit.jupiter.api.Test; |
11 | import org.junit.jupiter.params.ParameterizedTest; | 12 | import org.junit.jupiter.params.ParameterizedTest; |
@@ -24,7 +25,6 @@ import java.util.Set; | |||
24 | import static org.junit.jupiter.api.Assertions.assertEquals; | 25 | import static org.junit.jupiter.api.Assertions.assertEquals; |
25 | import static org.junit.jupiter.api.Assertions.assertTrue; | 26 | import static org.junit.jupiter.api.Assertions.assertTrue; |
26 | 27 | ||
27 | |||
28 | class ExperimentalSetupTest { | 28 | class ExperimentalSetupTest { |
29 | static class ExperimentalSetupResult { | 29 | static class ExperimentalSetupResult { |
30 | int versions = 0; | 30 | int versions = 0; |
@@ -61,7 +61,7 @@ class ExperimentalSetupTest { | |||
61 | .build(); | 61 | .build(); |
62 | 62 | ||
63 | Set<Version> versions = new HashSet<>(); | 63 | Set<Version> versions = new HashSet<>(); |
64 | IntObjectHashMap<List<Version>> codes = new IntObjectHashMap<>(); | 64 | MutableIntObjectMap<List<Version>> codes = IntObjectMaps.mutable.empty(); |
65 | 65 | ||
66 | var empty = store.createEmptyModel(); | 66 | var empty = store.createEmptyModel(); |
67 | if (!permuteTypes) { | 67 | if (!permuteTypes) { |
@@ -123,8 +123,9 @@ class ExperimentalSetupTest { | |||
123 | return result; | 123 | return result; |
124 | } | 124 | } |
125 | 125 | ||
126 | private static void saveAsNewVersion(Set<Version> versions, IntObjectHashMap<List<Version>> codes, | 126 | private static void saveAsNewVersion(Set<Version> versions, MutableIntObjectMap<List<Version>> codes, |
127 | StateCoderStoreAdapter storeAdapter, ExperimentalSetupResult result, Model model) { | 127 | StateCoderStoreAdapter storeAdapter, ExperimentalSetupResult result, |
128 | Model model) { | ||
128 | Version version1 = model.commit(); | 129 | Version version1 = model.commit(); |
129 | 130 | ||
130 | var stateCode = model.getAdapter(StateCoderAdapter.class).calculateStateCode(); | 131 | var stateCode = model.getAdapter(StateCoderAdapter.class).calculateStateCode(); |