aboutsummaryrefslogtreecommitdiff
path: root/tests/TestApi.java
diff options
context:
space:
mode:
Diffstat (limited to 'tests/TestApi.java')
-rw-r--r--tests/TestApi.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/TestApi.java b/tests/TestApi.java
index 397208e..4902c82 100644
--- a/tests/TestApi.java
+++ b/tests/TestApi.java
@@ -20,6 +20,7 @@ class TestApi implements IvyMessageListener, IvyApplicationListener {
private String domain;
public TestApi(String domain) throws IvyException {
+ System.out.println("TestApi joining the bus");
bus = new Ivy("TestAPI",TestApiReadyMsg, null);
bus.addApplicationListener(this);
bus.bindMsg("^"+TestMsg+"$",this);
@@ -54,7 +55,9 @@ class TestApi implements IvyMessageListener, IvyApplicationListener {
System.out.println("[X] Die received");
test++;
System.out.println(test+ "/5 tests successful, good bye");
+ System.out.println("TestApi leaving the bus");
bus.stop();
+ System.out.println("TestApi has left");
}
class Sender implements IvyMessageListener {
@@ -62,6 +65,7 @@ class TestApi implements IvyMessageListener, IvyApplicationListener {
private String domain;
public Sender(String domain) {
try {
+ System.out.println("Sender joining the bus");
sbus = new Ivy("Sender","Sender ready", null);
sbus.bindMsg("^"+TestApiReadyMsg+"$",this);
sbus.start(this.domain=domain);
@@ -72,7 +76,9 @@ class TestApi implements IvyMessageListener, IvyApplicationListener {
public void receive(IvyClient c,String[] args) {
sbus.sendMsg(TestMsg);
c.sendDirectMsg(1,"bye bye");
+ System.out.println("Sender leaving the bus");
sbus.stop();
+ System.out.println("Sender has left the bus");
new Killer(domain);
}
}
@@ -81,6 +87,7 @@ class TestApi implements IvyMessageListener, IvyApplicationListener {
private Ivy kbus;
public Killer(String domain) {
try {
+ System.out.println("Killer joining the bus");
kbus = new Ivy("Killer","Killer ready", null);
kbus.bindMsg("^"+TestApiReadyMsg+"$",this);
kbus.start(domain);
@@ -90,7 +97,9 @@ class TestApi implements IvyMessageListener, IvyApplicationListener {
}
public void receive(IvyClient c,String[] args) {
c.sendDie("bye bye");
+ System.out.println("Killer leaving the bus");
kbus.stop();
+ System.out.println("Killer has left the bus");
}
}