aboutsummaryrefslogtreecommitdiff
path: root/tests/Unitaire.java
diff options
context:
space:
mode:
authorjestin2012-05-13 08:54:38 +0000
committerjestin2012-05-13 08:54:38 +0000
commite854a58a81ec90e419a4b3effa5a83caac05df90 (patch)
tree16eb84a66b62ff38e744c8cd474df81561436b9f /tests/Unitaire.java
parent4ffe8b84071babe544086f94c66431380d301d59 (diff)
downloadivy-java-e854a58a81ec90e419a4b3effa5a83caac05df90.zip
ivy-java-e854a58a81ec90e419a4b3effa5a83caac05df90.tar.gz
ivy-java-e854a58a81ec90e419a4b3effa5a83caac05df90.tar.bz2
ivy-java-e854a58a81ec90e419a4b3effa5a83caac05df90.tar.xz
Modified the tests to remove bus.getDomain(null)
make Waiter and WaiterClient sons of WaitFor Added a few tests into svn
Diffstat (limited to 'tests/Unitaire.java')
-rw-r--r--tests/Unitaire.java32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/Unitaire.java b/tests/Unitaire.java
new file mode 100644
index 0000000..894bb88
--- /dev/null
+++ b/tests/Unitaire.java
@@ -0,0 +1,32 @@
+/**
+ * Ivy java library API tester.
+ *
+ * @author Yannick Jestin <mailto:yannick.jestin@enac.fr>
+ *
+ * (c) ENAC
+ *
+ * usage: java Unitaire
+ *
+ */
+import fr.dgac.ivy.*;
+
+public class Unitaire {
+
+ public static void main(final String[] args) {
+ Ivy bus = new Ivy("Test Unitaire" , "TU ready" , null);
+ final int PORT_TEST = 5000;
+ try {
+ bus.start(Ivy.getDomainArgs("IvyTest" , args));
+ System.out.println("waiting 5 seconds for a coucou");
+ System.out.println(((bus.waitForMsg("^coucou" , PORT_TEST)) != null) ? "coucou received" : "coucou not received");
+ System.out.println("waiting 5 seconds for IvyProbe");
+ System.out.println(((bus.waitForClient("IVYPROBE" , PORT_TEST)) != null) ? "Ivyprobe joined the bus" : "nobody came");
+ System.out.println("random values: " + bus.getWBUId() + ", " + bus.getWBUId() + ", " + bus.getWBUId());
+ bus.stop();
+ } catch (IvyException ie) {
+ System.out.println("Ivy main test error");
+ ie.printStackTrace();
+ }
+ }
+
+}