m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMagdalena Grodzińska <mag.grodzinska@gmail.com>2019-12-23 19:08:44 +0100
committerMagdalena Grodzińska <mag.grodzinska@gmail.com>2019-12-23 19:08:44 +0100
commit4456b71ab46b375eb21861051423222e6e5bb01e (patch)
tree31927cef618e29b116b4b6c5512e34973ac08b62 /src
parentb88b2866f5731491f1e7957a678559a1922c983a (diff)
Adjust executor tests to module changes
Diffstat (limited to 'src')
-rw-r--r--src/test/java/pl/edu/mimuw/cloudatlas/agent/ExecutorTest.java11
1 files changed, 8 insertions, 3 deletions
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 445a5b4..2a6ef49 100644
--- a/src/test/java/pl/edu/mimuw/cloudatlas/agent/ExecutorTest.java
+++ b/src/test/java/pl/edu/mimuw/cloudatlas/agent/ExecutorTest.java
@@ -9,6 +9,11 @@ import pl.edu.mimuw.cloudatlas.agent.message.AgentMessage.AgentModule;
public class ExecutorTest {
public class MessageCounterModule extends Module {
public int counter = 0;
+
+ MessageCounterModule(AgentModule moduleType) {
+ super(moduleType);
+ }
+
public void handle(AgentMessage m) {
counter++;
}
@@ -16,7 +21,7 @@ public class ExecutorTest {
@Test
public void testDoesntExecuteWhenNoMessages() throws Exception {
- MessageCounterModule module = new MessageCounterModule();
+ MessageCounterModule module = new MessageCounterModule(AgentModule.UDP);
Executor executor = new Executor(module);
Thread thread = new Thread(executor);
thread.start();
@@ -27,7 +32,7 @@ public class ExecutorTest {
@Test
public void testExecutesHandlerOnce() throws Exception {
- MessageCounterModule module = new MessageCounterModule();
+ MessageCounterModule module = new MessageCounterModule(AgentModule.UDP);
Executor executor = new Executor(module);
executor.addMessage(new AgentMessage("", AgentModule.UDP, 0) {});
Thread thread = new Thread(executor);
@@ -39,7 +44,7 @@ public class ExecutorTest {
@Test
public void testExecutesHandlerMultipleTimes() throws Exception {
- MessageCounterModule module = new MessageCounterModule();
+ MessageCounterModule module = new MessageCounterModule(AgentModule.UDP);
Executor executor = new Executor(module);
executor.addMessage(new AgentMessage("", AgentModule.UDP, 0) {});
executor.addMessage(new AgentMessage("", AgentModule.UDP, 0) {});