test getServiceNames
This commit is contained in:
		
							parent
							
								
									d95ff6f7b8
								
							
						
					
					
						commit
						5d440dcc14
					
				| @ -18,6 +18,10 @@ | |||||||
| 
 | 
 | ||||||
| package org.hyperic.sigar.win32.test; | package org.hyperic.sigar.win32.test; | ||||||
| 
 | 
 | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | import org.hyperic.sigar.Sigar; | ||||||
|  | 
 | ||||||
| import org.hyperic.sigar.test.SigarTestCase; | import org.hyperic.sigar.test.SigarTestCase; | ||||||
| 
 | 
 | ||||||
| import org.hyperic.sigar.win32.Service; | import org.hyperic.sigar.win32.Service; | ||||||
| @ -55,6 +59,25 @@ public class TestService extends SigarTestCase { | |||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     public void testServiceNames() throws Exception { | ||||||
|  |         List services = Service.getServiceNames(); | ||||||
|  |         assertGtZeroTrace("getServiceNames", services.size()); | ||||||
|  | 
 | ||||||
|  |         final String[] ptql = { | ||||||
|  |             "Service.Name.ct=Ev", | ||||||
|  |             "Service.Path.ew=.exe", | ||||||
|  |         }; | ||||||
|  |         Sigar sigar = new Sigar(); | ||||||
|  |         try { | ||||||
|  |             for (int i=0; i<ptql.length; i++) { | ||||||
|  |                 services = Service.getServiceNames(sigar, ptql[i]); | ||||||
|  |                 assertGtZeroTrace(ptql[i], services.size()); | ||||||
|  |             } | ||||||
|  |         } finally { | ||||||
|  |             sigar.close(); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     public void testServiceCreateDelete() throws Exception { |     public void testServiceCreateDelete() throws Exception { | ||||||
|         if (!TEST_CREATE) { |         if (!TEST_CREATE) { | ||||||
|             return; |             return; | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Doug MacEachern
						Doug MacEachern