diff options
author | 2023-02-02 16:50:54 +0100 | |
---|---|---|
committer | 2023-02-02 16:50:54 +0100 | |
commit | 8cb6537188dd3ea3875798b35f07a5220f64dd21 (patch) | |
tree | b3387b93e5c4036ee505d10fcfe7d1f16994645f /subprojects/store-query-viatra/src/test | |
parent | feat: model query functional dependencies (diff) | |
download | refinery-8cb6537188dd3ea3875798b35f07a5220f64dd21.tar.gz refinery-8cb6537188dd3ea3875798b35f07a5220f64dd21.tar.zst refinery-8cb6537188dd3ea3875798b35f07a5220f64dd21.zip |
feat: track ModelQuery pending changes
Diffstat (limited to 'subprojects/store-query-viatra/src/test')
-rw-r--r-- | subprojects/store-query-viatra/src/test/java/tools/refinery/store/query/viatra/QueryTransactionTest.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/subprojects/store-query-viatra/src/test/java/tools/refinery/store/query/viatra/QueryTransactionTest.java b/subprojects/store-query-viatra/src/test/java/tools/refinery/store/query/viatra/QueryTransactionTest.java index 49087a8d..ec2e7647 100644 --- a/subprojects/store-query-viatra/src/test/java/tools/refinery/store/query/viatra/QueryTransactionTest.java +++ b/subprojects/store-query-viatra/src/test/java/tools/refinery/store/query/viatra/QueryTransactionTest.java | |||
@@ -10,7 +10,7 @@ import tools.refinery.store.query.view.KeyOnlyRelationView; | |||
10 | import tools.refinery.store.representation.Symbol; | 10 | import tools.refinery.store.representation.Symbol; |
11 | import tools.refinery.store.tuple.Tuple; | 11 | import tools.refinery.store.tuple.Tuple; |
12 | 12 | ||
13 | import static org.junit.jupiter.api.Assertions.assertEquals; | 13 | import static org.junit.jupiter.api.Assertions.*; |
14 | 14 | ||
15 | class QueryTransactionTest { | 15 | class QueryTransactionTest { |
16 | @Test | 16 | @Test |
@@ -38,6 +38,7 @@ class QueryTransactionTest { | |||
38 | var predicateResultSet = queryEngine.getResultSet(predicate); | 38 | var predicateResultSet = queryEngine.getResultSet(predicate); |
39 | 39 | ||
40 | assertEquals(0, predicateResultSet.countResults()); | 40 | assertEquals(0, predicateResultSet.countResults()); |
41 | assertFalse(queryEngine.hasPendingChanges()); | ||
41 | 42 | ||
42 | personInterpretation.put(Tuple.of(0), true); | 43 | personInterpretation.put(Tuple.of(0), true); |
43 | personInterpretation.put(Tuple.of(1), true); | 44 | personInterpretation.put(Tuple.of(1), true); |
@@ -46,14 +47,18 @@ class QueryTransactionTest { | |||
46 | assetInterpretation.put(Tuple.of(2), true); | 47 | assetInterpretation.put(Tuple.of(2), true); |
47 | 48 | ||
48 | assertEquals(0, predicateResultSet.countResults()); | 49 | assertEquals(0, predicateResultSet.countResults()); |
50 | assertTrue(queryEngine.hasPendingChanges()); | ||
49 | 51 | ||
50 | queryEngine.flushChanges(); | 52 | queryEngine.flushChanges(); |
51 | assertEquals(2, predicateResultSet.countResults()); | 53 | assertEquals(2, predicateResultSet.countResults()); |
54 | assertFalse(queryEngine.hasPendingChanges()); | ||
52 | 55 | ||
53 | personInterpretation.put(Tuple.of(4), true); | 56 | personInterpretation.put(Tuple.of(4), true); |
54 | assertEquals(2, predicateResultSet.countResults()); | 57 | assertEquals(2, predicateResultSet.countResults()); |
58 | assertTrue(queryEngine.hasPendingChanges()); | ||
55 | 59 | ||
56 | queryEngine.flushChanges(); | 60 | queryEngine.flushChanges(); |
57 | assertEquals(3, predicateResultSet.countResults()); | 61 | assertEquals(3, predicateResultSet.countResults()); |
62 | assertFalse(queryEngine.hasPendingChanges()); | ||
58 | } | 63 | } |
59 | } | 64 | } |