Package com.cloudera.lib.server

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


    Assert.assertNotNull(((Map<String, Map<String, Object>>) snapshot.get("samplers")).get("g").get("s"));

    StringWriter writer = new StringWriter();
    JSONObject.writeJSONString(snapshot, writer);
    writer.close();
    server.destroy();
  }

  @Test
  @TestDir
  @SuppressWarnings("unchecked")
View Full Code Here


                                                                   ACLService.class.getName()), ","));
    Server server = new Server("server", dir, dir, dir, dir, conf);
    server.init();
    ACL acl = server.get(ACL.class);
    Assert.assertNotNull(acl);
    server.destroy();
  }

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

    ACL acl = server.get(ACL.class);
    String user = System.getProperty("user.name");
    acl.validate(user, user, null);
    acl.validate(user, user, user);

    server.destroy();
  }

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

    Map<String, Map<String, ?>> snapshot = instrumentation.getSnapshot();
    Map<String, Map<String, Object>> samplers = (Map<String, Map<String, Object>>) snapshot.get("samplers");
    InstrumentationService.Sampler sampler = (InstrumentationService.Sampler) samplers.get("g").get("s");
    Assert.assertTrue(sampler.getRate() > 0);

    server.destroy();
  }

}
View Full Code Here

    server.init();
    ACL acl = server.get(ACL.class);
    String user = System.getProperty("user.name");
    acl.validate(user, "root", user);

    server.destroy();
  }

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

    ACL acl = server.get(ACL.class);
    String user = System.getProperty("user.name");
    Groups groups = server.get(Groups.class);
    String group = groups.getGroups(user).get(0);
    acl.validate(user, "root", "bar," + group);
    server.destroy();
  }

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

    server.init();
    ACL acl = server.get(ACL.class);
    String user = System.getProperty("user.name");
    Groups groups = server.get(Groups.class);
    acl.validate(user, "root", "nobody");
    server.destroy();
  }

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

    server.init();
    ACL acl = server.get(ACL.class);
    String user = System.getProperty("user.name");
    Groups groups = server.get(Groups.class);
    acl.validate(user, "root", null);
    server.destroy();
  }

}
View Full Code Here

    server.init();
    Groups groups = server.get(Groups.class);
    Assert.assertNotNull(groups);
    List<String> g = groups.getGroups(System.getProperty("user.name"));
    Assert.assertNotSame(g.size(), 0);
    server.destroy();
  }

  @Test(expectedExceptions = RuntimeException.class)
  @TestDir
  public void invalidGroupsMapping() 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.