Package com.cloudera.lib.server

Examples of com.cloudera.lib.server.Server.destroy()


                                                                   ProxyUserService.class.getName()), ","));
    Server server = new Server("server", dir, dir, dir, dir, conf);
    server.init();
    ProxyUser proxyUser = server.get(ProxyUser.class);
    Assert.assertNotNull(proxyUser);
    server.destroy();
  }

  @Test(expectedExceptions = ServiceException.class, expectedExceptionsMessageRegExp = "PRXU02.*")
  @TestDir
  public void wrongConfigGroups() throws Exception {
View Full Code Here


    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", "bar");
    server.destroy();
  }

  @Test(expectedExceptions = AccessControlException.class)
  @TestDir
  public void invalidProxyUser() throws Exception {
View Full Code Here

    Server server = new Server("server", dir, dir, dir, dir, conf);
    server.init();
    ProxyUser proxyUser = server.get(ProxyUser.class);
    Assert.assertNotNull(proxyUser);
    proxyUser.validate("bar", "localhost", "foo");
    server.destroy();
  }

  @Test
  @TestDir
  public void validateHost() throws Exception {
View Full Code Here

    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", "bar");
    server.destroy();
  }

  private String getGroup() throws Exception {
    String dir = getTestDir().getAbsolutePath();
    XConfiguration conf = new XConfiguration();
View Full Code Here

    conf.set("server.services", StringUtils.toString(Arrays.asList(GroupsService.class.getName()), ","));
    Server server = new Server("server", dir, dir, dir, dir, conf);
    server.init();
    Groups groups = server.get(Groups.class);
    List<String> g = groups.getGroups(System.getProperty("user.name"));
    server.destroy();
    return g.get(0);
  }

  @Test
  @TestDir
View Full Code Here

    XConfiguration conf = new XConfiguration();
    conf.set("server.services", services);
    Server server = new Server("server", dir, dir, dir, dir, conf);
    server.init();
    Assert.assertNotNull(server.get(Hadoop.class));
    server.destroy();
  }

  @Test(expectedExceptions = ServiceException.class, expectedExceptionsMessageRegExp = "H01.*")
  @TestDir
  public void noKerberosKeytabProperty() throws Exception {
View Full Code Here

    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"));
    server.destroy();
  }


  @Test(expectedExceptions = AccessControlException.class)
  @TestDir
View Full Code Here

    Server server = new Server("server", dir, dir, dir, dir, conf);
    server.init();
    ProxyUser proxyUser = server.get(ProxyUser.class);
    Assert.assertNotNull(proxyUser);
    proxyUser.validate("foo", "unknownhost.bar.foo", "bar");
    server.destroy();
  }

  @Test(expectedExceptions = AccessControlException.class)
  @TestDir
  public void invalidHost() throws Exception {
View Full Code Here

    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");
    server.destroy();
  }

  @Test(expectedExceptions = AccessControlException.class)
  @TestDir
  public void invalidGroup() throws Exception {
View Full Code Here

    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();
  }

  @Test
  @TestDir
  public void inWhitelists() throws Exception {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.