Search in sources :

Example 1 with DummyEndpoint

use of org.eclipse.jetty.websocket.jsr356.samples.DummyEndpoint in project jetty.project by eclipse.

the class JsrSessionTest method initSession.

@Before
public void initSession() {
    container = new ClientContainer();
    String id = JsrSessionTest.class.getSimpleName();
    URI requestURI = URI.create("ws://localhost/" + id);
    WebSocketPolicy policy = WebSocketPolicy.newClientPolicy();
    ClientEndpointConfig config = new EmptyClientEndpointConfig();
    DummyEndpoint websocket = new DummyEndpoint();
    SimpleEndpointMetadata metadata = new SimpleEndpointMetadata(websocket.getClass());
    // Executor executor = null;
    EndpointInstance ei = new EndpointInstance(websocket, config, metadata);
    EventDriver driver = new JsrEndpointEventDriver(policy, ei);
    DummyConnection connection = new DummyConnection();
    session = new JsrSession(container, id, requestURI, driver, connection);
}
Also used : WebSocketPolicy(org.eclipse.jetty.websocket.api.WebSocketPolicy) DummyEndpoint(org.eclipse.jetty.websocket.jsr356.samples.DummyEndpoint) SimpleEndpointMetadata(org.eclipse.jetty.websocket.jsr356.client.SimpleEndpointMetadata) DummyConnection(org.eclipse.jetty.websocket.common.test.DummyConnection) EndpointInstance(org.eclipse.jetty.websocket.jsr356.endpoints.EndpointInstance) URI(java.net.URI) EmptyClientEndpointConfig(org.eclipse.jetty.websocket.jsr356.client.EmptyClientEndpointConfig) EventDriver(org.eclipse.jetty.websocket.common.events.EventDriver) JsrEndpointEventDriver(org.eclipse.jetty.websocket.jsr356.endpoints.JsrEndpointEventDriver) JsrEndpointEventDriver(org.eclipse.jetty.websocket.jsr356.endpoints.JsrEndpointEventDriver) EmptyClientEndpointConfig(org.eclipse.jetty.websocket.jsr356.client.EmptyClientEndpointConfig) ClientEndpointConfig(javax.websocket.ClientEndpointConfig) Before(org.junit.Before)

Aggregations

URI (java.net.URI)1 ClientEndpointConfig (javax.websocket.ClientEndpointConfig)1 WebSocketPolicy (org.eclipse.jetty.websocket.api.WebSocketPolicy)1 EventDriver (org.eclipse.jetty.websocket.common.events.EventDriver)1 DummyConnection (org.eclipse.jetty.websocket.common.test.DummyConnection)1 EmptyClientEndpointConfig (org.eclipse.jetty.websocket.jsr356.client.EmptyClientEndpointConfig)1 SimpleEndpointMetadata (org.eclipse.jetty.websocket.jsr356.client.SimpleEndpointMetadata)1 EndpointInstance (org.eclipse.jetty.websocket.jsr356.endpoints.EndpointInstance)1 JsrEndpointEventDriver (org.eclipse.jetty.websocket.jsr356.endpoints.JsrEndpointEventDriver)1 DummyEndpoint (org.eclipse.jetty.websocket.jsr356.samples.DummyEndpoint)1 Before (org.junit.Before)1