From 1c5d4da0b5be2f8532c96e9bc477c34e5687ae19 Mon Sep 17 00:00:00 2001 From: jestin Date: Wed, 2 Aug 2006 16:23:18 +0000 Subject: ibid --- tests/StopStart.java | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 tests/StopStart.java (limited to 'tests/StopStart.java') 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"); + } + +} -- cgit v1.1