aboutsummaryrefslogtreecommitdiff
path: root/tests/TestApi.java
diff options
context:
space:
mode:
authorjestin2003-01-07 17:13:27 +0000
committerjestin2003-01-07 17:13:27 +0000
commit5690d15d5fc2484c787a9a05ebc3f1a45d8e6eca (patch)
tree62e1bfbd270ab4b734f31bfaf104813bbb459202 /tests/TestApi.java
parent95d8c5dcb9b85b57cd9516c52690db5679d6fc78 (diff)
downloadivy-java-5690d15d5fc2484c787a9a05ebc3f1a45d8e6eca.zip
ivy-java-5690d15d5fc2484c787a9a05ebc3f1a45d8e6eca.tar.gz
ivy-java-5690d15d5fc2484c787a9a05ebc3f1a45d8e6eca.tar.bz2
ivy-java-5690d15d5fc2484c787a9a05ebc3f1a45d8e6eca.tar.xz
Ancienne API
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");
}
}