diff options
author | Marcin Chrzanowski <marcin.j.chrzanowski@gmail.com> | 2020-01-12 22:25:09 +0100 |
---|---|---|
committer | Marcin Chrzanowski <marcin.j.chrzanowski@gmail.com> | 2020-01-12 22:25:09 +0100 |
commit | cd247e8d64b2ef0aed7f0afdccd711008cd60fcd (patch) | |
tree | cf54497163b95e32fc8932b0ba13acc3fe2ca503 /src/test | |
parent | 411bf8f0dae524d70a0754049b5494182ade4a05 (diff) |
Add default queries for contacts and cardinality
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/java/pl/edu/mimuw/cloudatlas/agent/modules/StanikTest.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/test/java/pl/edu/mimuw/cloudatlas/agent/modules/StanikTest.java b/src/test/java/pl/edu/mimuw/cloudatlas/agent/modules/StanikTest.java index d16d917..92ba051 100644 --- a/src/test/java/pl/edu/mimuw/cloudatlas/agent/modules/StanikTest.java +++ b/src/test/java/pl/edu/mimuw/cloudatlas/agent/modules/StanikTest.java @@ -61,7 +61,7 @@ public class StanikTest { assertEquals(new ValueInt(0l), zmi.getAttributes().getOrNull("level")); assertEquals(new ValueString("/new"), zmi.getAttributes().getOrNull("owner")); Map<Attribute, Entry<ValueQuery, ValueTime>> queries = stateMessage.getQueries(); - assertEquals(0, TestUtil.iterableSize(queries.keySet())); + assertEquals(2, TestUtil.iterableSize(queries.keySet())); } @Test @@ -127,11 +127,12 @@ public class StanikTest { StateMessage newReceivedMessage = (StateMessage) executor.messagesToPass.poll(); AttributesMap actualAttributes = newReceivedMessage.getZMI().findDescendant("/new").getAttributes(); - assertEquals(6, TestUtil.iterableSize(actualAttributes)); + assertEquals(7, TestUtil.iterableSize(actualAttributes)); assertEquals(new ValueInt(1337l), actualAttributes.getOrNull("foo")); assertEquals(new ValueString("baz"), actualAttributes.getOrNull("bar")); assertEquals(new ValueString("new"), actualAttributes.getOrNull("name")); assertEquals(new ValueString("/new"), actualAttributes.getOrNull("owner")); + assertEquals(new ValueInt(1l), actualAttributes.getOrNull("cardinality")); assertEquals(testTime, actualAttributes.getOrNull("timestamp")); assertEquals(new ValueInt(1l), actualAttributes.getOrNull("level")); } @@ -223,7 +224,7 @@ public class StanikTest { stanik.handleTyped(message); HashMap<Attribute, Entry<ValueQuery, ValueTime>> actualQueries = stanik.getQueries(); - assertEquals(1, TestUtil.iterableSize(actualQueries.keySet())); + assertEquals(3, TestUtil.iterableSize(actualQueries.keySet())); assertTrue(actualQueries.containsKey(new Attribute("&query"))); Entry<ValueQuery, ValueTime> timestampedQuery = actualQueries.get(new Attribute("&query")); assertEquals(new ValueTime(42l), timestampedQuery.getValue()); @@ -247,7 +248,7 @@ public class StanikTest { stanik.handleTyped(otherMessage); HashMap<Attribute, Entry<ValueQuery, ValueTime>> actualQueries = stanik.getQueries(); - assertEquals(4, TestUtil.iterableSize(actualQueries.keySet())); + assertEquals(6, TestUtil.iterableSize(actualQueries.keySet())); assertTrue(actualQueries.containsKey(new Attribute("&query1"))); assertTrue(actualQueries.containsKey(new Attribute("&query2"))); assertTrue(actualQueries.containsKey(new Attribute("&query3"))); |