public static HttpServer createTestServer(Configuration conf, AccessControlList adminsAcl) throws IOException { prepareTestWebapp(); return createServer(TEST, conf, adminsAcl); }
/** * Create but do not start the test webapp server. The test webapp dir is * prepared/checked in advance. * * @return the server instance * * @throws IOException if a problem occurs * @throws AssertionError if a condition was not met */ public static HttpServer createTestServer() throws IOException { prepareTestWebapp(); return createServer(TEST); }
/** * Create but do not start the test webapp server. The test webapp dir is * prepared/checked in advance. * @param conf the server configuration to use * @return the server instance * * @throws IOException if a problem occurs * @throws AssertionError if a condition was not met */ public static HttpServer createTestServer(Configuration conf) throws IOException { prepareTestWebapp(); return createServer(TEST, conf); }
/** * Create but do not start the test webapp server. The test webapp dir is * prepared/checked in advance. * @param conf the server configuration to use * @return the server instance * * @throws IOException if a problem occurs * @throws AssertionError if a condition was not met */ public static HttpServer createTestServer(Configuration conf, String[] pathSpecs) throws IOException { prepareTestWebapp(); return createServer(TEST, conf, pathSpecs); }
/** * Create an HttpServer instance on the given address for the given webapp * @param host to bind * @param port to bind * @return the server * @throws IOException if it could not be created */ public static HttpServer createServer(String host, int port) throws IOException { prepareTestWebapp(); return new HttpServer.Builder().setName(TEST) .addEndpoint(URI.create("http://" + host + ":" + port)) .setFindPort(true).build(); }
public static HttpServer createTestServerWithSecurity(Configuration conf) throws IOException { prepareTestWebapp(); return localServerBuilder(TEST).setFindPort(true).setConf(conf).setSecurityEnabled(true) // InfoServer normally sets these for us .setUsernameConfKey(HttpServer.HTTP_SPNEGO_AUTHENTICATION_PRINCIPAL_KEY) .setKeytabConfKey(HttpServer.HTTP_SPNEGO_AUTHENTICATION_KEYTAB_KEY) .build(); }