m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/pl
diff options
context:
space:
mode:
authorMarcin Chrzanowski <marcin.j.chrzanowski@gmail.com>2020-01-12 22:12:09 +0100
committerMarcin Chrzanowski <marcin.j.chrzanowski@gmail.com>2020-01-12 22:12:09 +0100
commit411bf8f0dae524d70a0754049b5494182ade4a05 (patch)
tree0ca12678f5acf95ad4a5cfa64893ba06c5d5c615 /src/test/java/pl
parent84df6c11a868e8cd98fa14455456d313e25234db (diff)
Set owner of ZMIs on our path
Diffstat (limited to 'src/test/java/pl')
-rw-r--r--src/test/java/pl/edu/mimuw/cloudatlas/agent/modules/StanikTest.java8
1 files changed, 5 insertions, 3 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 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<Attribute, Entry<ValueQuery, ValueTime>> 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"));
}