diff options
author | Marcin Chrzanowski <marcin.j.chrzanowski@gmail.com> | 2020-01-12 16:20:01 +0100 |
---|---|---|
committer | Marcin Chrzanowski <marcin.j.chrzanowski@gmail.com> | 2020-01-12 16:20:01 +0100 |
commit | 37f413d69d8f60e327c564d2b9a604739f80080b (patch) | |
tree | 678c92f6d67fa3dc623168e77262740c49bee30e /src/test/java/pl/edu/mimuw/cloudatlas/agent | |
parent | 94d88e27bc6ac28a2c92de76f193920b664040dd (diff) |
Add test for live gossip
Diffstat (limited to 'src/test/java/pl/edu/mimuw/cloudatlas/agent')
-rw-r--r-- | src/test/java/pl/edu/mimuw/cloudatlas/agent/modules/GossipGirlTest.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/test/java/pl/edu/mimuw/cloudatlas/agent/modules/GossipGirlTest.java b/src/test/java/pl/edu/mimuw/cloudatlas/agent/modules/GossipGirlTest.java index 720a7e3..e35274b 100644 --- a/src/test/java/pl/edu/mimuw/cloudatlas/agent/modules/GossipGirlTest.java +++ b/src/test/java/pl/edu/mimuw/cloudatlas/agent/modules/GossipGirlTest.java @@ -432,6 +432,27 @@ public class GossipGirlTest { assertEquals(0, executor.messagesToPass.size()); } + @Test + public void dontCleanFreshGossips() throws Exception { + gossipGirl.handleTyped(hejkaMessage); + executor.messagesToPass.take(); + gossipGirl.handleTyped(stateMessage); + executor.messagesToPass.take(); + + gossipGirl.handleTyped(attributesMessage1); + executor.messagesToPass.take(); + executor.messagesToPass.take(); + executor.messagesToPass.take(); + executor.messagesToPass.take(); + executor.messagesToPass.take(); + executor.messagesToPass.take(); + + CleanOldGossipsMessage message = new CleanOldGossipsMessage("", 0, TestUtil.addToTime(testTime, -10)); + gossipGirl.handleTyped(message); + gossipGirl.handleTyped(attributesMessage2); + assertEquals(1, executor.messagesToPass.size()); + } + private void assertQueryMessage(AgentMessage message, String recipientPath, String name, String query) throws Exception { assertUDUPMessage( message, |