diff options
author | 2023-02-02 16:33:45 +0100 | |
---|---|---|
committer | 2023-02-02 16:33:45 +0100 | |
commit | a69beacc266ba4462377cecb010a437cf6a12428 (patch) | |
tree | 01de8ad0ea53e6fbc9e446c7344340e96fd6eebd /subprojects/store-query-viatra/src/test | |
parent | refactor: VIATRA adapter fixes (diff) | |
download | refinery-a69beacc266ba4462377cecb010a437cf6a12428.tar.gz refinery-a69beacc266ba4462377cecb010a437cf6a12428.tar.zst refinery-a69beacc266ba4462377cecb010a437cf6a12428.zip |
feat: model query functional dependencies
Diffstat (limited to 'subprojects/store-query-viatra/src/test')
-rw-r--r-- | subprojects/store-query-viatra/src/test/java/tools/refinery/store/query/viatra/internal/cardinality/UpperCardinalitySumAggregationOperatorStreamTest.java | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/subprojects/store-query-viatra/src/test/java/tools/refinery/store/query/viatra/internal/cardinality/UpperCardinalitySumAggregationOperatorStreamTest.java b/subprojects/store-query-viatra/src/test/java/tools/refinery/store/query/viatra/internal/cardinality/UpperCardinalitySumAggregationOperatorStreamTest.java index 69491fda..c529117e 100644 --- a/subprojects/store-query-viatra/src/test/java/tools/refinery/store/query/viatra/internal/cardinality/UpperCardinalitySumAggregationOperatorStreamTest.java +++ b/subprojects/store-query-viatra/src/test/java/tools/refinery/store/query/viatra/internal/cardinality/UpperCardinalitySumAggregationOperatorStreamTest.java | |||
@@ -6,6 +6,7 @@ import org.junit.jupiter.params.provider.MethodSource; | |||
6 | import tools.refinery.store.representation.cardinality.UpperCardinalities; | 6 | import tools.refinery.store.representation.cardinality.UpperCardinalities; |
7 | import tools.refinery.store.representation.cardinality.UpperCardinality; | 7 | import tools.refinery.store.representation.cardinality.UpperCardinality; |
8 | 8 | ||
9 | import java.util.List; | ||
9 | import java.util.stream.Stream; | 10 | import java.util.stream.Stream; |
10 | 11 | ||
11 | import static org.hamcrest.MatcherAssert.assertThat; | 12 | import static org.hamcrest.MatcherAssert.assertThat; |
@@ -14,32 +15,32 @@ import static org.hamcrest.Matchers.equalTo; | |||
14 | class UpperCardinalitySumAggregationOperatorStreamTest { | 15 | class UpperCardinalitySumAggregationOperatorStreamTest { |
15 | @ParameterizedTest | 16 | @ParameterizedTest |
16 | @MethodSource | 17 | @MethodSource |
17 | void testStream(Stream<UpperCardinality> stream, UpperCardinality expected) { | 18 | void testStream(List<UpperCardinality> list, UpperCardinality expected) { |
18 | var result = UpperCardinalitySumAggregationOperator.INSTANCE.aggregateStream(stream); | 19 | var result = UpperCardinalitySumAggregationOperator.INSTANCE.aggregateStream(list.stream()); |
19 | assertThat(result, equalTo(expected)); | 20 | assertThat(result, equalTo(expected)); |
20 | } | 21 | } |
21 | 22 | ||
22 | static Stream<Arguments> testStream() { | 23 | static Stream<Arguments> testStream() { |
23 | return Stream.of( | 24 | return Stream.of( |
24 | Arguments.of(Stream.of(), UpperCardinalities.ZERO), | 25 | Arguments.of(List.of(), UpperCardinalities.ZERO), |
25 | Arguments.of(Stream.of(UpperCardinality.of(3)), UpperCardinality.of(3)), | 26 | Arguments.of(List.of(UpperCardinality.of(3)), UpperCardinality.of(3)), |
26 | Arguments.of( | 27 | Arguments.of( |
27 | Stream.of( | 28 | List.of( |
28 | UpperCardinality.of(2), | 29 | UpperCardinality.of(2), |
29 | UpperCardinality.of(3) | 30 | UpperCardinality.of(3) |
30 | ), | 31 | ), |
31 | UpperCardinality.of(5) | 32 | UpperCardinality.of(5) |
32 | ), | 33 | ), |
33 | Arguments.of(Stream.of(UpperCardinalities.UNBOUNDED), UpperCardinalities.UNBOUNDED), | 34 | Arguments.of(List.of(UpperCardinalities.UNBOUNDED), UpperCardinalities.UNBOUNDED), |
34 | Arguments.of( | 35 | Arguments.of( |
35 | Stream.of( | 36 | List.of( |
36 | UpperCardinalities.UNBOUNDED, | 37 | UpperCardinalities.UNBOUNDED, |
37 | UpperCardinalities.UNBOUNDED | 38 | UpperCardinalities.UNBOUNDED |
38 | ), | 39 | ), |
39 | UpperCardinalities.UNBOUNDED | 40 | UpperCardinalities.UNBOUNDED |
40 | ), | 41 | ), |
41 | Arguments.of( | 42 | Arguments.of( |
42 | Stream.of( | 43 | List.of( |
43 | UpperCardinalities.UNBOUNDED, | 44 | UpperCardinalities.UNBOUNDED, |
44 | UpperCardinality.of(3) | 45 | UpperCardinality.of(3) |
45 | ), | 46 | ), |