Package org.apache.hadoop.lib.server

Examples of org.apache.hadoop.lib.server.Server.destroy()


    conf.set("server.services", StringUtils.join(",", 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


    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(expected = 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(expected = 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(expected = AccessControlException.class)
  @TestDir
  public void invalidGroup() 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();
  }
}
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

                                                                    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
  @TestException(exception = ServiceException.class, msgRegExp = "PRXU02.*")
  @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", "localhost", "bar");
    server.destroy();
  }

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

    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

      Arrays.asList(DelegationTokenManagerService.class.getName())));
    Server server = new Server("server", dir, dir, dir, dir, conf);
    server.init();
    DelegationTokenManager tm = server.get(DelegationTokenManager.class);
    Assert.assertNotNull(tm);
    server.destroy();
  }

  @Test
  @TestDir
  @SuppressWarnings("unchecked")
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.