diff options
Diffstat (limited to 'java/tests/ServiceConfigurator/reloadTest.java')
-rw-r--r-- | java/tests/ServiceConfigurator/reloadTest.java | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/java/tests/ServiceConfigurator/reloadTest.java b/java/tests/ServiceConfigurator/reloadTest.java new file mode 100644 index 00000000000..3e8ac599841 --- /dev/null +++ b/java/tests/ServiceConfigurator/reloadTest.java @@ -0,0 +1,64 @@ +/************************************************* + * + * = PACKAGE + * tests.ServiceConfigurator + * + * = FILENAME + * mainTest.java + * + *@author Prashant Jain, Everett Anderson + * + *************************************************/ +package tests.ServiceConfigurator; + +import JACE.ServiceConfigurator.*; +import JACE.OS.*; +import java.io.*; + +public class reloadTest +{ + + public static void main (String args []) + { + ServiceConfig daemon = new ServiceConfig (); + try + { + daemon.open (args); + Thread.sleep (10000); + + // ***** Note: reloading requires the user to remove the + // service and prepare for reload! + daemon.remove("TimeService"); + daemon.prepareForReload(); + + daemon.open (args); + } + catch (InterruptedException e) + { + ACE.ERROR (e); + } + catch (FileNotFoundException e) + { + ACE.ERROR (e); + } + catch (IOException e) + { + ACE.ERROR (e); + } + catch (ClassNotFoundException e) + { + ACE.ERROR (e + "foo"); + } + catch (IllegalAccessException e) + { + ACE.ERROR (e); + } + catch (InstantiationException e) + { + ACE.ERROR (e); + } + + System.err.println("End of reloadTest"); + } + +} |