/** * 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); }
public static HttpServer2 createTestServer(Configuration conf, AccessControlList adminsAcl) throws IOException { prepareTestWebapp(); return createServer(TEST, conf, adminsAcl); }
public static HttpServer2 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 HttpServer2 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 HttpServer2 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 HttpServer2 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. * * @return the server instance * * @throws IOException if a problem occurs * @throws AssertionError if a condition was not met */ public static HttpServer2 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 HttpServer2 createTestServer(Configuration conf, String[] pathSpecs) throws IOException { prepareTestWebapp(); return createServer(TEST, conf, pathSpecs); }
/** * 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 HttpServer2 createTestServer(Configuration conf, String[] pathSpecs) throws IOException { prepareTestWebapp(); return createServer(TEST, conf, pathSpecs); }
Configuration conf = new HdfsConfiguration(); NNStorage mockStorage = Mockito.mock(NNStorage.class); HttpServer2 testServer = HttpServerFunctionalTest.createServer("hdfs"); try { testServer.addServlet("ImageTransfer", ImageServlet.PATH_SPEC,
/** * Test to verify the read timeout */ @Test(timeout = 5000) public void testGetImageTimeout() throws Exception { HttpServer2 testServer = HttpServerFunctionalTest.createServer("hdfs"); try { testServer.addServlet("ImageTransfer", ImageServlet.PATH_SPEC, TestImageTransferServlet.class); testServer.start(); URL serverURL = HttpServerFunctionalTest.getServerURL(testServer); TransferFsImage.timeout = 2000; try { TransferFsImage.getFileClient(serverURL, "txid=1", null, null, false); fail("TransferImage Should fail with timeout"); } catch (SocketTimeoutException e) { assertEquals("Read should timeout", "Read timed out", e.getMessage()); } } finally { if (testServer != null) { testServer.stop(); } } }