From da6455dc0c4a9da05ae606daa891787b623bdd20 Mon Sep 17 00:00:00 2001 From: Marcin Chrzanowski Date: Mon, 30 Dec 2019 13:32:39 +0100 Subject: Reenable executor tests --- src/test/java/pl/edu/mimuw/cloudatlas/agent/ExecutorTest.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/test/java') diff --git a/src/test/java/pl/edu/mimuw/cloudatlas/agent/ExecutorTest.java b/src/test/java/pl/edu/mimuw/cloudatlas/agent/ExecutorTest.java index 0ff7a07..2898d3c 100644 --- a/src/test/java/pl/edu/mimuw/cloudatlas/agent/ExecutorTest.java +++ b/src/test/java/pl/edu/mimuw/cloudatlas/agent/ExecutorTest.java @@ -4,6 +4,7 @@ import org.junit.Test; import static org.junit.Assert.*; import pl.edu.mimuw.cloudatlas.agent.messages.AgentMessage; +import pl.edu.mimuw.cloudatlas.agent.messages.ResponseMessage; import pl.edu.mimuw.cloudatlas.agent.modules.Module; import pl.edu.mimuw.cloudatlas.agent.modules.ModuleType; @@ -33,12 +34,11 @@ public class ExecutorTest { assertEquals(0, module.counter); } - /* @Test public void testExecutesHandlerOnce() throws Exception { MessageCounterModule module = new MessageCounterModule(ModuleType.UDP); Executor executor = new Executor(module); - executor.addMessage(new AgentMessage("", ModuleType.UDP, 0) {}); + executor.addMessage(new ResponseMessage("", ModuleType.UDP, 0, ResponseMessage.Type.STATE, 0) {}); Thread thread = new Thread(executor); thread.start(); Thread.sleep(100); @@ -50,15 +50,14 @@ public class ExecutorTest { public void testExecutesHandlerMultipleTimes() throws Exception { MessageCounterModule module = new MessageCounterModule(ModuleType.UDP); Executor executor = new Executor(module); - executor.addMessage(new AgentMessage("", ModuleType.UDP, 0) {}); - executor.addMessage(new AgentMessage("", ModuleType.UDP, 0) {}); + executor.addMessage(new ResponseMessage("", ModuleType.UDP, 0, ResponseMessage.Type.STATE, 0) {}); + executor.addMessage(new ResponseMessage("", ModuleType.UDP, 0, ResponseMessage.Type.STATE, 0) {}); Thread thread = new Thread(executor); thread.start(); Thread.sleep(100); - executor.addMessage(new AgentMessage("", ModuleType.UDP, 0) {}); + executor.addMessage(new ResponseMessage("", ModuleType.UDP, 0, ResponseMessage.Type.STATE, 0) {}); Thread.sleep(100); thread.interrupt(); assertEquals(3, module.counter); } - */ } -- cgit v1.2.3