Package org.eclipse.rap.rwt.remote

Examples of org.eclipse.rap.rwt.remote.RemoteObject


public class RemoteObjectHelper {

  private static final Random random = new Random();

  public static RemoteObject mockRemoteObject() {
    RemoteObject serviceObject = createRemoteObject();
    RemoteObject remoteObject = createRemoteObject();
    ConnectionImpl connection = mock( ConnectionImpl.class );
    when( connection.createRemoteObject( anyString() ) ).thenReturn( remoteObject );
    when( connection.createServiceObject( anyString() ) ).thenReturn( serviceObject );
    Fixture.fakeConnection( connection );
    return remoteObject;
View Full Code Here


    return remoteObject;
  }

  private static RemoteObject createRemoteObject() {
    String id = "w" + random.nextInt();
    RemoteObject remoteObject = spy( new TestRemoteObject( id ) );
    remoteObject.setHandler( mock( OperationHandler.class ) );
    return remoteObject;
  }
View Full Code Here

  @Test
  public void testGetRemotObject() {
    RemoteAction remoteAction = new RemoteAction( ui, uiRenderer, actionDescriptor );

    RemoteObject actualRemoteObject = remoteAction.getRemoteObject();

    assertSame( remoteObject, actualRemoteObject );
  }
View Full Code Here

    assertEquals( "foo", title );
  }

  @Test
  public void testSetsTitleOnRemoteObject() {
    RemoteObject remoteObject = environment.getRemoteObject();
    ClientDialog dialog = new ClientDialog();

    dialog.setTitle( "foo" );

    verify( remoteObject ).set( "title", "foo" );
View Full Code Here

    assertEquals( "bar", message );
  }

  @Test
  public void testSetsMessageOnRemoteObject() {
    RemoteObject remoteObject = environment.getRemoteObject();
    ClientDialog dialog = new ClientDialog();

    dialog.setMessage( "bar" );

    verify( remoteObject ).set( "message", "bar" );
View Full Code Here

    assertSame( ERROR, severity );
  }

  @Test
  public void testSetsSeverityOnRemoteObject() {
    RemoteObject remoteObject = environment.getRemoteObject();
    ClientDialog dialog = new ClientDialog();

    dialog.setSeverity( ERROR );

    verify( remoteObject ).set( "severity", ERROR.toString() );
View Full Code Here

    assertSame( dialog, actualDialog );
  }

  @Test
  public void testOpenCreatesCallOperation() {
    RemoteObject remoteObject = environment.getRemoteObject();
    ClientDialog dialog = new ClientDialog();

    dialog.open();

    verify( remoteObject ).call( "open", null );
View Full Code Here

    verify( remoteObject ).call( "open", null );
  }

  @Test
  public void testCloseCreatesCallOperation() {
    RemoteObject remoteObject = environment.getRemoteObject();
    ClientDialog dialog = new ClientDialog();

    dialog.close();

    verify( remoteObject ).call( "close", null );
View Full Code Here

    assertSame( display, captor.getValue().display );
  }

  @Test
  public void testSetsButtonSetsButtonPropertyOnRemoteObject() {
    RemoteObject remoteObject = environment.getRemoteObject();
    ClientDialog dialog = new ClientDialog();
    Listener listener = mock( Listener.class );

    dialog.setButton( ButtonType.OK, "bar", listener );
View Full Code Here

    verify( remoteObject ).set( "buttonOk", "bar" );
  }

  @Test
  public void testSetsButtonCreateListenOnRemoteObject() {
    RemoteObject remoteObject = environment.getRemoteObject();
    ClientDialog dialog = new ClientDialog();
    Listener listener = mock( Listener.class );

    dialog.setButton( ButtonType.OK, "bar", listener );
View Full Code Here

TOP

Related Classes of org.eclipse.rap.rwt.remote.RemoteObject

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.