Package com.cloudera.lib.util

Examples of com.cloudera.lib.util.XConfiguration


  }

  @Test
  @TestDir
  public void startWithStatusNotNormal() throws Exception {
    XConfiguration conf = new XConfiguration();
    conf.set("server.startup.status", "ADMIN");
    Server server = createServer(conf);
    server.init();
    Assert.assertEquals(server.getStatus(), Server.Status.ADMIN);
    server.destroy();
  }
View Full Code Here


  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  @TestDir
  public void nonSeteableStatus() throws Exception {
    XConfiguration conf = new XConfiguration();
    Server server = createServer(conf);
    server.init();
    server.setStatus(Server.Status.SHUTDOWN);
  }
View Full Code Here

  @Test
  @TestDir
  public void changeStatus() throws Exception {
    TestService.LIFECYCLE.clear();
    XConfiguration conf = new XConfiguration();
    conf.set("server.services", TestService.class.getName());
    Server server = createServer(conf);
    server.init();
    server.setStatus(Server.Status.ADMIN);
    Assert.assertTrue(TestService.LIFECYCLE.contains("serverStatusChange"));
  }
View Full Code Here

  @Test(expectedExceptions = ServerException.class, expectedExceptionsMessageRegExp = "S11.*")
  @TestDir
  public void changeStatusServiceException() throws Exception {
    TestService.LIFECYCLE.clear();
    XConfiguration conf = new XConfiguration();
    conf.set("server.services", TestServiceExceptionOnStatusChange.class.getName());
    Server server = createServer(conf);
    server.init();
  }
View Full Code Here

  }

  @Test
  @TestDir
  public void setSameStatus() throws Exception {
    XConfiguration conf = new XConfiguration();
    conf.set("server.services", TestService.class.getName());
    Server server = createServer(conf);
    server.init();
    TestService.LIFECYCLE.clear();
    server.setStatus(server.getStatus());
    Assert.assertFalse(TestService.LIFECYCLE.contains("serverStatusChange"));
View Full Code Here

  @Test
  @TestDir
  public void serviceLifeCycle() throws Exception {
    TestService.LIFECYCLE.clear();
    XConfiguration conf = new XConfiguration();
    conf.set("server.services", TestService.class.getName());
    Server server = createServer(conf);
    server.init();
    Assert.assertNotNull(server.get(TestService.class));
    server.destroy();
    Assert.assertEquals(TestService.LIFECYCLE, Arrays.asList("init", "postInit", "serverStatusChange", "destroy"));
View Full Code Here

  }

  @Test(expectedExceptions = IllegalStateException.class)
  @TestDir
  public void illegalState1() throws Exception {
    Server server = new Server("server", getTestDir().getAbsolutePath(), new XConfiguration());
    server.destroy();
  }
View Full Code Here

  }

  @Test(expectedExceptions = IllegalStateException.class)
  @TestDir
  public void illegalState2() throws Exception {
    Server server = new Server("server", getTestDir().getAbsolutePath(), new XConfiguration());
    server.get(Object.class);
  }
View Full Code Here

  }

  @Test(expectedExceptions = IllegalStateException.class)
  @TestDir
  public void illegalState3() throws Exception {
    Server server = new Server("server", getTestDir().getAbsolutePath(), new XConfiguration());
    server.setService(null);
  }
View Full Code Here

  @Test(expectedExceptions = IllegalStateException.class)
  @TestDir
  public void illegalState4() throws Exception {
    String dir = getTestDir().getAbsolutePath();
    Server server = new Server("server", dir, dir, dir, dir, new XConfiguration());
    server.init();
    server.init();
  }
View Full Code Here

TOP

Related Classes of com.cloudera.lib.util.XConfiguration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.