From 4fe5f84c59c74df9f5b408fa0f0c0a266504f340 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Sun, 26 Jun 2005 22:00:35 +0000 Subject: [PATCH] test bogus service name --- .../src/net/hyperic/sigar/win32/test/TestService.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bindings/java/src/net/hyperic/sigar/win32/test/TestService.java b/bindings/java/src/net/hyperic/sigar/win32/test/TestService.java index c502bfed..1fbae95a 100644 --- a/bindings/java/src/net/hyperic/sigar/win32/test/TestService.java +++ b/bindings/java/src/net/hyperic/sigar/win32/test/TestService.java @@ -4,6 +4,7 @@ import net.hyperic.sigar.test.SigarTestCase; import net.hyperic.sigar.win32.Service; import net.hyperic.sigar.win32.ServiceConfig; +import net.hyperic.sigar.win32.Win32Exception; public class TestService extends SigarTestCase { private static final String TEST_NAME = "MyTestService"; @@ -25,6 +26,15 @@ public class TestService extends SigarTestCase { Service service = new Service("Eventlog"); service.getConfig(); service.close(); + + String dummyName = "DOESNOTEXIST"; + try { + new Service(dummyName); + assertTrue(false); + } catch (Win32Exception e) { + traceln(dummyName + ": " + e.getMessage()); + assertTrue(true); + } } public void testServiceCreateDelete() throws Exception {