Examples of CloudPushListener


Examples of com.eclipsesource.tabris.push.CloudPushListener

  }

  @Test
  public void testRemoveListenerCreatesUnListenOperation() {
    CloudPushImpl cloudPush = new CloudPushImpl();
    CloudPushListener listenerMock = mock( CloudPushListener.class );

    cloudPush.addListener( listenerMock );
    cloudPush.removeListener( listenerMock );

    InOrder order = inOrder( environment.getServiceObject(), environment.getServiceObject() );
View Full Code Here

Examples of com.eclipsesource.tabris.push.CloudPushListener

  }

  @Test
  public void testRemoveOneOfManyListenersContinuesToListen() {
    CloudPushImpl cloudPush = new CloudPushImpl();
    CloudPushListener listenerMock1 = mock( CloudPushListener.class );
    CloudPushListener listenerMock2 = mock( CloudPushListener.class );

    cloudPush.addListener( listenerMock1 );
    cloudPush.addListener( listenerMock2 );
    cloudPush.removeListener( listenerMock1 );
View Full Code Here

Examples of com.eclipsesource.tabris.push.CloudPushListener

  }

  @Test
  public void testCallsListenerWithRegisteredEvent() {
    CloudPushImpl cloudPush = new CloudPushImpl();
    CloudPushListener listener = mock( CloudPushListener.class );
    cloudPush.addListener( listener );

    environment.dispatchNotifyOnServiceObject( "Registered", new JsonObject().add( "token", "foo" ) );

    verify( listener ).registered( "foo" );
View Full Code Here

Examples of com.eclipsesource.tabris.push.CloudPushListener

  }

  @Test
  public void testCallsAllListenersInOrderWithRegisteredEvent() {
    CloudPushImpl cloudPush = new CloudPushImpl();
    CloudPushListener listener = mock( CloudPushListener.class );
    CloudPushListener listener2 = mock( CloudPushListener.class );
    cloudPush.addListener( listener );
    cloudPush.addListener( listener2 );

    environment.dispatchNotifyOnServiceObject( "Registered", new JsonObject().add( "token", "foo" ) );
View Full Code Here

Examples of com.eclipsesource.tabris.push.CloudPushListener

  }

  @Test
  public void testCallsListenerWithMessageReceivedEvent() {
    CloudPushImpl cloudPush = new CloudPushImpl();
    CloudPushListener listener = mock( CloudPushListener.class );
    cloudPush.addListener( listener );

    environment.dispatchNotifyOnServiceObject( "MessageReceived", null );

    verify( listener ).messageReceived();
View Full Code Here

Examples of com.eclipsesource.tabris.push.CloudPushListener

  }

  @Test
  public void testCallsAllsListenersWithMessageReceivedEvent() {
    CloudPushImpl cloudPush = new CloudPushImpl();
    CloudPushListener listener = mock( CloudPushListener.class );
    CloudPushListener listener2 = mock( CloudPushListener.class );
    cloudPush.addListener( listener );
    cloudPush.addListener( listener2 );

    environment.dispatchNotifyOnServiceObject( "MessageReceived", null );
View Full Code Here

Examples of com.eclipsesource.tabris.push.CloudPushListener

  }

  @Test
  public void testCallsListenerWithErrorReceivedEvent() {
    CloudPushImpl cloudPush = new CloudPushImpl();
    CloudPushListener listener = mock( CloudPushListener.class );
    cloudPush.addListener( listener );

    environment.dispatchNotifyOnServiceObject( "ErrorReceived",
                                               new JsonObject().add( "errorMessage", "error" ) );
View Full Code Here

Examples of com.eclipsesource.tabris.push.CloudPushListener

  }

  @Test
  public void testCallsAllsListenersWithErrorReceivedEvent() {
    CloudPushImpl cloudPush = new CloudPushImpl();
    CloudPushListener listener = mock( CloudPushListener.class );
    CloudPushListener listener2 = mock( CloudPushListener.class );
    cloudPush.addListener( listener );
    cloudPush.addListener( listener2 );

    environment.dispatchNotifyOnServiceObject( "ErrorReceived",
                                               new JsonObject().add( "errorMessage", "error" ) );
View Full Code Here

Examples of com.eclipsesource.tabris.push.CloudPushListener

  }

  @Test(expected = UnsupportedOperationException.class)
  public void testThrowsUnsupportedOperationExceptionWithInvalidEvent() {
    CloudPushImpl cloudPush = new CloudPushImpl();
    CloudPushListener listener = mock( CloudPushListener.class );
    cloudPush.addListener( listener );

    environment.dispatchNotifyOnServiceObject( "blub", new JsonObject().add( "message", "foo" ) );
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.