use of org.apache.samza.coordinator.server.HttpServer in project samza by apache.
the class TestHttpFileSystem method testHttpFileSystemReadTimeouts.
@Test
public void testHttpFileSystemReadTimeouts() throws Exception {
HttpServer server = new HttpServer("/", 0, null, new ServletHolder(DefaultServlet.class));
try {
server.addServlet("/download", new PartialFileFetchServlet());
server.start();
String serverUrl = server.getUrl().toString() + "download";
FileSystemClientThread fileSystemClientThread = new FileSystemClientThread(new URI(serverUrl));
fileSystemClientThread.start();
fileSystemClientThread.join();
Assert.assertEquals(fileSystemClientThread.getTotalBytesRead(), THRESHOLD_BYTES);
Assert.assertNull(clientException);
Assert.assertNull(serverException);
} finally {
server.stop();
}
}
Aggregations