aboutsummaryrefslogtreecommitdiff
path: root/tests/StopStart.java
diff options
context:
space:
mode:
Diffstat (limited to 'tests/StopStart.java')
-rw-r--r--tests/StopStart.java30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/StopStart.java b/tests/StopStart.java
new file mode 100644
index 0000000..5962d27
--- /dev/null
+++ b/tests/StopStart.java
@@ -0,0 +1,30 @@
+import fr.dgac.ivy.* ;
+
+class StopStart {
+
+ Ivy bus;
+
+ public static void main(String[] args) throws IvyException {
+ String domain=Ivy.getDomainArgs("StopStartTest",args);
+ new StopStart(domain);
+ }
+
+ public StopStart(String domain) throws IvyException {
+ int n=1;
+ bus = new Ivy("StopStart","StopStart ready", null);
+ System.out.println("--------------- starting bus");
+ bus.start(domain);
+ System.out.println("--------------- sleeping "+n+" seconds");
+ try { Thread.sleep(n*1000); } catch (InterruptedException ie) { }
+ System.out.println("--------------- stopping bus");
+ bus.stop();
+ System.out.println("--------------- restarting bus");
+ bus.start(domain);
+ System.out.println("sleeping "+n+" seconds");
+ try { Thread.sleep(n*1000); } catch (InterruptedException ie) { }
+ System.out.println("--------------- restopping bus");
+ bus.stop();
+ System.out.println("--------------- good bye, program should exit now");
+ }
+
+}