Package com.pusher.client.util

Examples of com.pusher.client.util.InstantExecutor


    @Before
    public void setUp() throws URISyntaxException, SSLException {
        when(factory.getChannelManager()).thenReturn(mockChannelManager);
        when(factory.newWebSocketClientWrapper(any(URI.class), any(WebSocketConnection.class)))
                .thenReturn(mockUnderlyingConnection);
        when(factory.getEventQueue()).thenReturn(new InstantExecutor());
        when(factory.getTimers()).thenReturn(new DoNothingExecutor());

        this.connection = new WebSocketConnection(URL, ACTIVITY_TIMEOUT, PONG_TIMEOUT, factory);
        this.connection.bind(ConnectionState.ALL, mockEventListener);
    }
View Full Code Here


    protected @Mock Factory factory;
    private @Mock ChannelEventListener mockListener;

    @Before
    public void setUp() {
        when(factory.getEventQueue()).thenReturn(new InstantExecutor());

        this.mockListener = getEventListener();
        this.channel = newInstance(getChannelName());
        this.channel.setEventListener(mockListener);
    }
View Full Code Here

    private @Mock Factory factory;

    @Before
    public void setUp() throws AuthorizationFailureException {

        when(factory.getEventQueue()).thenReturn(new InstantExecutor());
        when(mockInternalChannel.getName()).thenReturn(CHANNEL_NAME);
        when(mockInternalChannel.toSubscribeMessage()).thenReturn(
                OUTGOING_SUBSCRIBE_MESSAGE);
        when(mockInternalChannel.toUnsubscribeMessage()).thenReturn(
                OUTGOING_UNSUBSCRIBE_MESSAGE);
View Full Code Here

    when(factory.getConnection(eq(API_KEY), any(PusherOptions.class))).thenReturn(mockConnection);
    when(factory.getChannelManager()).thenReturn(mockChannelManager);
    when(factory.newPublicChannel(PUBLIC_CHANNEL_NAME)).thenReturn(mockPublicChannel);
    when(factory.newPrivateChannel(mockConnection, PRIVATE_CHANNEL_NAME, authorizer)).thenReturn(mockPrivateChannel);
    when(factory.newPresenceChannel(mockConnection, PRESENCE_CHANNEL_NAME, authorizer)).thenReturn(mockPresenceChannel);
    when(factory.getEventQueue()).thenReturn(new InstantExecutor());

        pusher = new Pusher(API_KEY, options, factory);
    }
View Full Code Here

    public void setUp() throws Exception {
        pusherOptions = new PusherOptions().setAuthorizer(mockAuthorizer).setEncrypted(false);

        connection = new WebSocketConnection(pusherOptions.buildUrl(API_KEY), ACTIVITY_TIMEOUT, PONG_TIMEOUT, factory);

        when(factory.getEventQueue()).thenReturn(new InstantExecutor());
        when(factory.getTimers()).thenReturn(new DoNothingExecutor());
        when(factory.newWebSocketClientWrapper(any(URI.class), any(WebSocketListener.class))).thenAnswer(new Answer<WebSocketClientWrapper>() {
            @Override
            public WebSocketClientWrapper answer(InvocationOnMock invocation) throws Throwable {
                URI uri = (URI) invocation.getArguments()[0];
View Full Code Here

TOP

Related Classes of com.pusher.client.util.InstantExecutor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.