From 411bf8f0dae524d70a0754049b5494182ade4a05 Mon Sep 17 00:00:00 2001 From: Marcin Chrzanowski Date: Sun, 12 Jan 2020 22:12:09 +0100 Subject: Set owner of ZMIs on our path --- .../java/pl/edu/mimuw/cloudatlas/agent/modules/StanikTest.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/test/java/pl/edu/mimuw/cloudatlas/agent/modules') 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 03a89c6..d16d917 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 @@ -39,7 +39,7 @@ public class StanikTest { @Before public void setupLocals() { - stanik = new Stanik(freshnessPeriod); + stanik = new Stanik(new PathName("/new"), freshnessPeriod); executor = new MockExecutor(stanik); testTime = ValueUtils.currentTime(); } @@ -57,8 +57,9 @@ public class StanikTest { ZMI zmi = stateMessage.getZMI(); assertNull(zmi.getFather()); assertTrue(zmi.getSons().isEmpty()); - assertEquals(2, TestUtil.iterableSize(zmi.getAttributes())); + assertEquals(3, TestUtil.iterableSize(zmi.getAttributes())); assertEquals(new ValueInt(0l), zmi.getAttributes().getOrNull("level")); + assertEquals(new ValueString("/new"), zmi.getAttributes().getOrNull("owner")); Map> queries = stateMessage.getQueries(); assertEquals(0, TestUtil.iterableSize(queries.keySet())); } @@ -126,10 +127,11 @@ public class StanikTest { StateMessage newReceivedMessage = (StateMessage) executor.messagesToPass.poll(); AttributesMap actualAttributes = newReceivedMessage.getZMI().findDescendant("/new").getAttributes(); - assertEquals(5, TestUtil.iterableSize(actualAttributes)); + assertEquals(6, 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(testTime, actualAttributes.getOrNull("timestamp")); assertEquals(new ValueInt(1l), actualAttributes.getOrNull("level")); } -- cgit v1.2.3