Ejemplo n.º 1
0
 @Test
 @TestDir
 public void setSameStatus() throws Exception {
   Configuration conf = new Configuration(false);
   conf.set("server.services", TestService.class.getName());
   Server server = createServer(conf);
   server.init();
   TestService.LIFECYCLE.clear();
   server.setStatus(server.getStatus());
   assertFalse(TestService.LIFECYCLE.contains("serverStatusChange"));
 }
Ejemplo n.º 2
0
 @Test
 @TestException(exception = ServerException.class, msgRegExp = "S11.*")
 @TestDir
 public void changeStatusServiceException() throws Exception {
   TestService.LIFECYCLE.clear();
   Configuration conf = new Configuration(false);
   conf.set("server.services", TestServiceExceptionOnStatusChange.class.getName());
   Server server = createServer(conf);
   server.init();
 }
Ejemplo n.º 3
0
 @Test
 @TestDir
 public void serviceLifeCycle() throws Exception {
   TestService.LIFECYCLE.clear();
   Configuration conf = new Configuration(false);
   conf.set("server.services", TestService.class.getName());
   Server server = createServer(conf);
   server.init();
   assertNotNull(server.get(TestService.class));
   server.destroy();
   assertEquals(
       TestService.LIFECYCLE, Arrays.asList("init", "postInit", "serverStatusChange", "destroy"));
 }