Package com.cloudera.lib.util

Examples of com.cloudera.lib.util.XConfiguration


  @Test(expectedExceptions = ServerException.class, expectedExceptionsMessageRegExp = "S01.*")
  @TestDir
  public void initNoHomeDir() throws Exception {
    File homeDir = new File(getTestDir(), "home");
    XConfiguration conf = new XConfiguration();
    conf.set("server.services", TestService.class.getName());
    Server server = new Server("server", homeDir.getAbsolutePath(), conf);
    server.init();
  }
View Full Code Here


  @Test(expectedExceptions = ServerException.class, expectedExceptionsMessageRegExp = "S02.*")
  @TestDir
  public void initHomeDirNotDir() throws Exception {
    File homeDir = new File(getTestDir(), "home");
    new FileOutputStream(homeDir).close();
    XConfiguration conf = new XConfiguration();
    conf.set("server.services", TestService.class.getName());
    Server server = new Server("server", homeDir.getAbsolutePath(), conf);
    server.init();
  }
View Full Code Here

  public void initNoConfigDir() throws Exception {
    File homeDir = new File(getTestDir(), "home");
    Assert.assertTrue(homeDir.mkdir());
    Assert.assertTrue(new File(homeDir, "log").mkdir());
    Assert.assertTrue(new File(homeDir, "temp").mkdir());
    XConfiguration conf = new XConfiguration();
    conf.set("server.services", TestService.class.getName());
    Server server = new Server("server", homeDir.getAbsolutePath(), conf);
    server.init();
  }
View Full Code Here

    Assert.assertTrue(homeDir.mkdir());
    Assert.assertTrue(new File(homeDir, "log").mkdir());
    Assert.assertTrue(new File(homeDir, "temp").mkdir());
    File configDir = new File(homeDir, "conf");
    new FileOutputStream(configDir).close();
    XConfiguration conf = new XConfiguration();
    conf.set("server.services", TestService.class.getName());
    Server server = new Server("server", homeDir.getAbsolutePath(), conf);
    server.init();
  }
View Full Code Here

  public void initNoLogDir() throws Exception {
    File homeDir = new File(getTestDir(), "home");
    Assert.assertTrue(homeDir.mkdir());
    Assert.assertTrue(new File(homeDir, "conf").mkdir());
    Assert.assertTrue(new File(homeDir, "temp").mkdir());
    XConfiguration conf = new XConfiguration();
    conf.set("server.services", TestService.class.getName());
    Server server = new Server("server", homeDir.getAbsolutePath(), conf);
    server.init();
  }
View Full Code Here

    Assert.assertTrue(homeDir.mkdir());
    Assert.assertTrue(new File(homeDir, "conf").mkdir());
    Assert.assertTrue(new File(homeDir, "temp").mkdir());
    File logDir = new File(homeDir, "log");
    new FileOutputStream(logDir).close();
    XConfiguration conf = new XConfiguration();
    conf.set("server.services", TestService.class.getName());
    Server server = new Server("server", homeDir.getAbsolutePath(), conf);
    server.init();
  }
View Full Code Here

  public void initNoTempDir() throws Exception {
    File homeDir = new File(getTestDir(), "home");
    Assert.assertTrue(homeDir.mkdir());
    Assert.assertTrue(new File(homeDir, "conf").mkdir());
    Assert.assertTrue(new File(homeDir, "log").mkdir());
    XConfiguration conf = new XConfiguration();
    conf.set("server.services", TestService.class.getName());
    Server server = new Server("server", homeDir.getAbsolutePath(), conf);
    server.init();
  }
View Full Code Here

    Assert.assertTrue(homeDir.mkdir());
    Assert.assertTrue(new File(homeDir, "conf").mkdir());
    Assert.assertTrue(new File(homeDir, "log").mkdir());
    File tempDir = new File(homeDir, "temp");
    new FileOutputStream(tempDir).close();
    XConfiguration conf = new XConfiguration();
    conf.set("server.services", TestService.class.getName());
    Server server = new Server("server", homeDir.getAbsolutePath(), conf);
    server.init();
  }
View Full Code Here

    InputStream is = ClassUtils.getResource("default-log4j.properties");
    OutputStream os = new FileOutputStream(new File(getTestDir(), "server-log4j.properties"));
    IOUtils.copy(is, os);
    is.close();
    os.close();
    XConfiguration conf = new XConfiguration();
    Server server = createServer(conf);
    server.init();
  }
View Full Code Here

  }

  @Test
  @TestDir
  public void lifeCycle() throws Exception {
    XConfiguration conf = new XConfiguration();
    conf.set("server.services", LifeCycleService.class.getName());
    Server server = createServer(conf);
    Assert.assertEquals(server.getStatus(), Server.Status.UNDEF);
    server.init();
    Assert.assertNotNull(server.get(LifeCycleService.class));
    Assert.assertEquals(server.getStatus(), Server.Status.NORMAL);
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.