use of org.eclipse.jetty.websocket.common.scopes.SimpleContainerScope in project jetty.project by eclipse.
the class EventDriverTest method wrap.
private EventDriver wrap(Object websocket) {
WebSocketPolicy policy = WebSocketPolicy.newServerPolicy();
EventDriverFactory factory = new EventDriverFactory(new SimpleContainerScope(policy));
return factory.wrap(websocket);
}
use of org.eclipse.jetty.websocket.common.scopes.SimpleContainerScope in project jetty.project by eclipse.
the class ExtensionStackTest method createExtensionStack.
private ExtensionStack createExtensionStack() {
WebSocketPolicy policy = WebSocketPolicy.newClientPolicy();
WebSocketContainerScope container = new SimpleContainerScope(policy, bufferPool);
WebSocketExtensionFactory factory = new WebSocketExtensionFactory(container);
return new ExtensionStack(factory);
}
use of org.eclipse.jetty.websocket.common.scopes.SimpleContainerScope in project jetty.project by eclipse.
the class EventDriverFactoryTest method testBadNotASocket.
/**
* Test Case for bad declaration (duplicate OnWebSocketBinary declarations)
*/
@Test
public void testBadNotASocket() {
EventDriverFactory factory = new EventDriverFactory(new SimpleContainerScope(WebSocketPolicy.newClientPolicy()));
try {
NotASocket bad = new NotASocket();
// Should toss exception
factory.wrap(bad);
} catch (InvalidWebSocketException e) {
// Validate that we have clear error message to the developer
Assert.assertThat(e.getMessage(), allOf(containsString(WebSocketListener.class.getSimpleName()), containsString(WebSocket.class.getSimpleName())));
}
}
Aggregations