Package com.cloudera.lib.util

Examples of com.cloudera.lib.util.XConfiguration


  @TestDir
  public void noKerberosPrincipalProperty() throws Exception {
    String dir = getTestDir().getAbsolutePath();
    String services = StringUtils.toString(Arrays.asList(InstrumentationService.class.getName(),
                                                         HadoopService.class.getName()), ",");
    XConfiguration conf = new XConfiguration();
    conf.set("server.services", services);
    conf.set("server.hadoop.authentication.type", "kerberos");
    conf.set("server.hadoop.authentication.kerberos.keytab", "/tmp/foo");
    conf.set("server.hadoop.authentication.kerberos.principal", " ");
    Server server = new Server("server", dir, dir, dir, dir, conf);
    server.init();
  }
View Full Code Here


  @Test(expectedExceptions = AccessControlException.class)
  @TestDir
  public void invalidHost() throws Exception {
    String dir = getTestDir().getAbsolutePath();
    XConfiguration conf = new XConfiguration();
    conf.set("server.services", StringUtils.toString(Arrays.asList(GroupsService.class.getName(),
                                                                   ProxyUserService.class.getName()), ","));
    conf.set("server.proxyuser.foo.hosts", "localhost");
    conf.set("server.proxyuser.foo.groups", "*");
    Server server = new Server("server", dir, dir, dir, dir, conf);
    server.init();
    ProxyUser proxyUser = server.get(ProxyUser.class);
    Assert.assertNotNull(proxyUser);
    proxyUser.validate("foo", "www.yahoo.com", "bar");
View Full Code Here

  @TestDir
  public void kerberosInitializationFailure() throws Exception {
    String dir = getTestDir().getAbsolutePath();
    String services = StringUtils.toString(Arrays.asList(InstrumentationService.class.getName(),
                                                         HadoopService.class.getName()), ",");
    XConfiguration conf = new XConfiguration();
    conf.set("server.services", services);
    conf.set("server.hadoop.authentication.type", "kerberos");
    conf.set("server.hadoop.authentication.kerberos.keytab", "/tmp/foo");
    conf.set("server.hadoop.authentication.kerberos.principal", "foo@FOO");
    Server server = new Server("server", dir, dir, dir, dir, conf);
    server.init();
  }
View Full Code Here

  @TestDir
  public void invalidSecurity() throws Exception {
    String dir = getTestDir().getAbsolutePath();
    String services = StringUtils.toString(Arrays.asList(InstrumentationService.class.getName(),
                                                         HadoopService.class.getName()), ",");
    XConfiguration conf = new XConfiguration();
    conf.set("server.services", services);
    conf.set("server.hadoop.authentication.type", "foo");
    Server server = new Server("server", dir, dir, dir, dir, conf);
    server.init();
  }
View Full Code Here

  @Test(expectedExceptions = AccessControlException.class)
  @TestDir
  public void invalidGroup() throws Exception {
    String dir = getTestDir().getAbsolutePath();
    XConfiguration conf = new XConfiguration();
    conf.set("server.services", StringUtils.toString(Arrays.asList(GroupsService.class.getName(),
                                                                   ProxyUserService.class.getName()), ","));
    conf.set("server.proxyuser.foo.hosts", "localhost");
    conf.set("server.proxyuser.foo.groups", "nobody");
    Server server = new Server("server", dir, dir, dir, dir, conf);
    server.init();
    ProxyUser proxyUser = server.get(ProxyUser.class);
    Assert.assertNotNull(proxyUser);
    proxyUser.validate("foo", "localhost", System.getProperty("user.name"));
View Full Code Here

  @TestDir
  public void serviceHadoopConf() throws Exception {
    String dir = getTestDir().getAbsolutePath();
    String services = StringUtils.toString(Arrays.asList(InstrumentationService.class.getName(),
                                                         HadoopService.class.getName()), ",");
    XConfiguration conf = new XConfiguration();
    conf.set("server.services", services);
    conf.set("server.hadoop.conf:foo", "FOO");
    Server server = new Server("server", dir, dir, dir, dir, conf);
    server.init();
    HadoopService hadoop = (HadoopService) server.get(Hadoop.class);
    Assert.assertEquals(hadoop.serviceHadoopConf.get("foo"), "FOO");
    server.destroy();
View Full Code Here

  @TestDir
  public void inWhitelists() throws Exception {
    String dir = getTestDir().getAbsolutePath();
    String services = StringUtils.toString(Arrays.asList(InstrumentationService.class.getName(),
                                                         HadoopService.class.getName()), ",");
    XConfiguration conf = new XConfiguration();
    conf.set("server.services", services);
    Server server = new Server("server", dir, dir, dir, dir, conf);
    server.init();
    HadoopService hadoop = (HadoopService) server.get(Hadoop.class);
    hadoop.validateJobtracker("JT");
    hadoop.validateNamenode("NN");
    server.destroy();

    conf = new XConfiguration();
    conf.set("server.services", services);
    conf.set("server.hadoop.job.tracker.whitelist", "*");
    conf.set("server.hadoop.name.node.whitelist", "*");
    server = new Server("server", dir, dir, dir, dir, conf);
    server.init();
    hadoop = (HadoopService) server.get(Hadoop.class);
    hadoop.validateJobtracker("JT");
    hadoop.validateNamenode("NN");
    server.destroy();

    conf = new XConfiguration();
    conf.set("server.services", services);
    conf.set("server.hadoop.job.tracker.whitelist", "JT");
    conf.set("server.hadoop.name.node.whitelist", "NN");
    server = new Server("server", dir, dir, dir, dir, conf);
    server.init();
    hadoop = (HadoopService) server.get(Hadoop.class);
    hadoop.validateJobtracker("JT");
    hadoop.validateNamenode("NN");
View Full Code Here

  @TestDir
  public void JobTrackerNotinWhitelist() throws Exception {
    String dir = getTestDir().getAbsolutePath();
    String services = StringUtils.toString(Arrays.asList(InstrumentationService.class.getName(),
                                                         HadoopService.class.getName()), ",");
    XConfiguration conf = new XConfiguration();
    conf.set("server.services", services);
    conf.set("server.hadoop.job.tracker.whitelist", "JT");
    Server server = new Server("server", dir, dir, dir, dir, conf);
    server.init();
    HadoopService hadoop = (HadoopService) server.get(Hadoop.class);
    hadoop.validateJobtracker("JTT");
  }
View Full Code Here

  @TestDir
  public void NameNodeNotinWhitelists() throws Exception {
    String dir = getTestDir().getAbsolutePath();
    String services = StringUtils.toString(Arrays.asList(InstrumentationService.class.getName(),
                                                         HadoopService.class.getName()), ",");
    XConfiguration conf = new XConfiguration();
    conf.set("server.services", services);
    conf.set("server.hadoop.name.node.whitelist", "NN");
    Server server = new Server("server", dir, dir, dir, dir, conf);
    server.init();
    HadoopService hadoop = (HadoopService) server.get(Hadoop.class);
    hadoop.validateNamenode("NNx");
  }
View Full Code Here

  @TestHadoop
  public void createFileSystem() throws Exception {
    String dir = getTestDir().getAbsolutePath();
    String services = StringUtils.toString(Arrays.asList(InstrumentationService.class.getName(),
                                                         HadoopService.class.getName()), ",");
    XConfiguration conf = new XConfiguration();
    conf.set("server.services", services);
    Server server = new Server("server", dir, dir, dir, dir, conf);
    server.init();
    Hadoop hadoop = server.get(Hadoop.class);
    FileSystem fs = hadoop.createFileSystem("u", getHadoopConf());
    Assert.assertNotNull(fs);
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.