Search in sources :

Example 1 with ModularXmppClientToServerConnectionInternal

use of org.jivesoftware.smack.c2s.internal.ModularXmppClientToServerConnectionInternal in project Smack by igniterealtime.

the class XmppWebSocketTransportModuleTest method lookupConnectionEndpointsTest.

@Test
public void lookupConnectionEndpointsTest() throws URISyntaxException {
    XmppWebSocketTransportModuleDescriptor websocketTransportModuleDescriptor = getWebSocketDescriptor();
    ModularXmppClientToServerConnectionInternal connectionInternal = mock(ModularXmppClientToServerConnectionInternal.class);
    XmppWebSocketTransportModule transportModule = new XmppWebSocketTransportModule(websocketTransportModuleDescriptor, connectionInternal);
    XmppWebSocketTransportModule.XmppWebSocketTransport transport = transportModule.getTransport();
    assertNotNull(transport.lookupConnectionEndpoints());
}
Also used : ModularXmppClientToServerConnectionInternal(org.jivesoftware.smack.c2s.internal.ModularXmppClientToServerConnectionInternal) Test(org.junit.jupiter.api.Test)

Example 2 with ModularXmppClientToServerConnectionInternal

use of org.jivesoftware.smack.c2s.internal.ModularXmppClientToServerConnectionInternal in project Smack by igniterealtime.

the class WebSocketFactoryServiceTestUtil method createWebSocketTest.

public static void createWebSocketTest(Class<? extends AbstractWebSocket> expected) throws URISyntaxException {
    WebSocketRemoteConnectionEndpoint endpoint = WebSocketRemoteConnectionEndpoint.from("wss://example.org");
    ModularXmppClientToServerConnectionInternal connectionInternal = mock(ModularXmppClientToServerConnectionInternal.class);
    AbstractWebSocket websocket = WebSocketFactoryService.createWebSocket(endpoint, connectionInternal);
    assertEquals(expected, websocket.getClass());
}
Also used : ModularXmppClientToServerConnectionInternal(org.jivesoftware.smack.c2s.internal.ModularXmppClientToServerConnectionInternal) WebSocketRemoteConnectionEndpoint(org.jivesoftware.smack.websocket.rce.WebSocketRemoteConnectionEndpoint) AbstractWebSocket(org.jivesoftware.smack.websocket.impl.AbstractWebSocket)

Example 3 with ModularXmppClientToServerConnectionInternal

use of org.jivesoftware.smack.c2s.internal.ModularXmppClientToServerConnectionInternal in project Smack by igniterealtime.

the class Java11WebSocketFactoryTest method returnsNotNullTest.

public void returnsNotNullTest() {
    WebSocketRemoteConnectionEndpoint endpoint = mock(WebSocketRemoteConnectionEndpoint.class);
    ModularXmppClientToServerConnectionInternal connectionInternal = mock(ModularXmppClientToServerConnectionInternal.class);
    Java11WebSocket java11WebSocket = Java11WebSocketFactory.INSTANCE.create(endpoint, connectionInternal);
    assertNotNull(java11WebSocket);
}
Also used : ModularXmppClientToServerConnectionInternal(org.jivesoftware.smack.c2s.internal.ModularXmppClientToServerConnectionInternal) WebSocketRemoteConnectionEndpoint(org.jivesoftware.smack.websocket.rce.WebSocketRemoteConnectionEndpoint)

Aggregations

ModularXmppClientToServerConnectionInternal (org.jivesoftware.smack.c2s.internal.ModularXmppClientToServerConnectionInternal)3 WebSocketRemoteConnectionEndpoint (org.jivesoftware.smack.websocket.rce.WebSocketRemoteConnectionEndpoint)2 AbstractWebSocket (org.jivesoftware.smack.websocket.impl.AbstractWebSocket)1 Test (org.junit.jupiter.api.Test)1