use of org.atmosphere.runtime.AtmosphereRequest in project atmosphere by Atmosphere.
the class PathTest method testSingletonAtmosphereHandler.
@Test
public void testSingletonAtmosphereHandler() throws IOException, ServletException {
instanceCount = 0;
AtmosphereRequest request = new AtmosphereRequestImpl.Builder().pathInfo("/singleton/atmospherehandler/yes").method("GET").build();
framework.doCometSupport(request, AtmosphereResponseImpl.newInstance());
assertEquals(instanceCount, 0);
assertNotNull(r.get());
assertEquals(r.get(), "/singleton/atmospherehandler/yes");
}
use of org.atmosphere.runtime.AtmosphereRequest in project atmosphere by Atmosphere.
the class PathTest method testAtmosphereHandlerPath.
@Test
public void testAtmosphereHandlerPath() throws IOException, ServletException {
instanceCount = 0;
AtmosphereRequest request = new AtmosphereRequestImpl.Builder().pathInfo("/ah/test2").method("GET").build();
framework.doCometSupport(request, AtmosphereResponseImpl.newInstance());
assertEquals(instanceCount, 1);
assertNotNull(r.get());
assertEquals(r.get(), "/ah/test2");
}
use of org.atmosphere.runtime.AtmosphereRequest in project atmosphere by Atmosphere.
the class PathTest method testMeteorPath.
@Test
public void testMeteorPath() throws IOException, ServletException {
instanceCount = 0;
AtmosphereRequest request = new AtmosphereRequestImpl.Builder().pathInfo("/a/b/test2").method("GET").build();
framework.doCometSupport(request, AtmosphereResponseImpl.newInstance());
assertEquals(instanceCount, 1);
assertNotNull(r.get());
assertEquals(r.get(), "/a/b/test2");
}
use of org.atmosphere.runtime.AtmosphereRequest in project atmosphere by Atmosphere.
the class PathTest method testManagedWebSocketPathMessage.
@Test
public void testManagedWebSocketPathMessage() throws IOException, ServletException {
instanceCount = 0;
ByteArrayOutputStream b = new ByteArrayOutputStream();
final WebSocket w = new ArrayBaseWebSocket(b);
final WebSocketProcessor processor = WebSocketProcessorFactory.getDefault().getWebSocketProcessor(framework);
AtmosphereRequest request = new AtmosphereRequestImpl.Builder().pathInfo("/ws/bar").method("GET").build();
processor.open(w, request, AtmosphereResponseImpl.newInstance(framework.getAtmosphereConfig(), request, w));
assertEquals(instanceCount, 1);
assertNotNull(r.get());
assertEquals(r.get(), "/ws/bar");
}
use of org.atmosphere.runtime.AtmosphereRequest in project atmosphere by Atmosphere.
the class ManagedAtmosphereHandlerTest method testPostConstruct.
@Test
public void testPostConstruct() throws IOException, ServletException {
AtmosphereRequest request = new AtmosphereRequestImpl.Builder().pathInfo("/postConstruct").method("GET").build();
framework.doCometSupport(request, AtmosphereResponseImpl.newInstance());
assertNotNull(r.get());
r.get().resume();
assertNotNull(message.get());
assertEquals(message.get(), "postConstructmessage");
}
Aggregations