HttpServer server = new HttpServer(new MyHttpRequestHandler());
server.start();
HttpClient client = new HttpClient();
IEventDataSource eventSource = client.openEventDataSource("http://localhost:" + server.getLocalPort() + "/Events", false);
Assert.assertEquals("test stream", eventSource.readMessage().getComment());
Assert.assertEquals("first event", eventSource.readMessage().getData());
Assert.assertEquals("second event", eventSource.readMessage().getData());