Search in sources :

Example 6 with AnnotatedClientEndpointMetadata

use of org.eclipse.jetty.websocket.jsr356.client.AnnotatedClientEndpointMetadata in project jetty.project by eclipse.

the class ClientAnnotatedEndpointScanner_GoodSignaturesTest method testScan_Basic.

@Test
public void testScan_Basic() throws Exception {
    AnnotatedClientEndpointMetadata metadata = new AnnotatedClientEndpointMetadata(container, testcase.pojo);
    AnnotatedEndpointScanner<ClientEndpoint, ClientEndpointConfig> scanner = new AnnotatedEndpointScanner<>(metadata);
    scanner.scan();
    Assert.assertThat("Metadata", metadata, notNullValue());
    JsrCallable cm = (JsrCallable) testcase.metadataField.get(metadata);
    Assert.assertThat(testcase.metadataField.toString(), cm, notNullValue());
    int len = testcase.expectedParameters.length;
    for (int i = 0; i < len; i++) {
        Class<?> expectedParam = testcase.expectedParameters[i];
        Class<?> actualParam = cm.getParamTypes()[i];
        Assert.assertTrue("Parameter[" + i + "] - expected:[" + expectedParam + "], actual:[" + actualParam + "]", actualParam.equals(expectedParam));
    }
}
Also used : JsrCallable(org.eclipse.jetty.websocket.jsr356.annotations.JsrCallable) AnnotatedEndpointScanner(org.eclipse.jetty.websocket.jsr356.annotations.AnnotatedEndpointScanner) ClientEndpointConfig(javax.websocket.ClientEndpointConfig) ClientEndpoint(javax.websocket.ClientEndpoint) AnnotatedClientEndpointMetadata(org.eclipse.jetty.websocket.jsr356.client.AnnotatedClientEndpointMetadata) ClientEndpoint(javax.websocket.ClientEndpoint) Test(org.junit.Test)

Aggregations

ClientEndpointConfig (javax.websocket.ClientEndpointConfig)6 ClientEndpoint (javax.websocket.ClientEndpoint)5 AnnotatedClientEndpointMetadata (org.eclipse.jetty.websocket.jsr356.client.AnnotatedClientEndpointMetadata)5 AnnotatedEndpointScanner (org.eclipse.jetty.websocket.jsr356.annotations.AnnotatedEndpointScanner)4 Test (org.junit.Test)3 JsrEvents (org.eclipse.jetty.websocket.jsr356.annotations.JsrEvents)2 EmptyClientEndpointConfig (org.eclipse.jetty.websocket.jsr356.client.EmptyClientEndpointConfig)2 SimpleEndpointMetadata (org.eclipse.jetty.websocket.jsr356.client.SimpleEndpointMetadata)2 EndpointInstance (org.eclipse.jetty.websocket.jsr356.endpoints.EndpointInstance)2 EndpointMetadata (org.eclipse.jetty.websocket.jsr356.metadata.EndpointMetadata)2 Endpoint (javax.websocket.Endpoint)1 InvalidWebSocketException (org.eclipse.jetty.websocket.api.InvalidWebSocketException)1 WebSocketPolicy (org.eclipse.jetty.websocket.api.WebSocketPolicy)1 CloseInfo (org.eclipse.jetty.websocket.common.CloseInfo)1 EventDriver (org.eclipse.jetty.websocket.common.events.EventDriver)1 InvalidSignatureException (org.eclipse.jetty.websocket.common.events.annotated.InvalidSignatureException)1 JsrCallable (org.eclipse.jetty.websocket.jsr356.annotations.JsrCallable)1 JsrAnnotatedEventDriver (org.eclipse.jetty.websocket.jsr356.endpoints.JsrAnnotatedEventDriver)1