Package org.eclipse.rap.json

Examples of org.eclipse.rap.json.JsonObject


  }

  @Test
  public void testSetsVendor() {
    ClientDeviceImpl device = new ClientDeviceImpl();
    JsonObject properties = new JsonObject();
    properties.add( "vendor", "fooBar" );

    device.handleSet( properties );

    String vendor = device.getVendor();
    assertEquals( "fooBar", vendor );
View Full Code Here


  }

  @Test
  public void testSetsModel() {
    ClientDeviceImpl device = new ClientDeviceImpl();
    JsonObject properties = new JsonObject();
    properties.add( "model", "blub" );

    device.handleSet( properties );

    String model = device.getModel();
    assertEquals( "blub", model );
View Full Code Here

  }

  @Test
  public void testSetsOSVersion() {
    ClientDeviceImpl device = new ClientDeviceImpl();
    JsonObject properties = new JsonObject();
    properties.add( "osVersion", "7.1.0" );

    device.handleSet( properties );

    String version = device.getOSVersion();
    assertEquals( "7.1.0", version );
View Full Code Here

  }

  @Test
  public void testSetsScaleFactor() {
    ClientDeviceImpl device = new ClientDeviceImpl();
    JsonObject properties = new JsonObject();
    properties.add( "scaleFactor", 2.13F );

    device.handleSet( properties );

    float scaleFactor = device.getScaleFactor();
    assertEquals( 2.13F, scaleFactor, 0F );
View Full Code Here

    new RemoteAction( ui, uiRenderer, actionDescriptor );
    Action action = mock( Action.class );
    mockUI( mock( ActionListener.class ) );
    when( actionDescriptor.getAction() ).thenReturn( action );

    environment.dispatchNotify( "Selection", new JsonObject() );

    verify( action ).execute( ui );
  }
View Full Code Here

    mockUI( listener );
    new RemoteAction( ui, uiRenderer, actionDescriptor );
    Action action = mock( Action.class );
    when( actionDescriptor.getAction() ).thenReturn( action );

    environment.dispatchNotify( "Selection", new JsonObject() );

    verify( listener ).executed( ui, action );
  }
View Full Code Here

  }

  private void verifyDraw( PagingIndicator indicator ) {
    renderChanges( indicator );
    String gcId = WidgetUtil.getId( indicator.getCanvas() ) + ".gc";
    JsonObject properties = MessageUtil.getOperationProperties( gcId, CALL, "init" );
    assertNotNull( properties );
  }
View Full Code Here

  }

  @Test
  public void testSynchronizeCallAddsValues() {
    ClientStoreImpl store = new ClientStoreImpl();
    JsonObject properties = new JsonObject();
    properties.add( "foo", "bar" );
    properties.add( "foo1", "bar1" );

    environment.dispatchCallOnServiceObject( "synchronize", properties );

    assertEquals( "bar", store.get( "foo" ) );
    assertEquals( "bar1", store.get( "foo1" ) );
View Full Code Here

    ClientCanvas clientCanvas = new ClientCanvas( shell, SWT.NONE );
    ClientDrawListener drawListener = mock( ClientDrawListener.class );
    clientCanvas.addClientDrawListener( drawListener );
    ClientCanvasOperator operator = new ClientCanvasOperator( clientCanvas );
    environment.newRequest();
    JsonObject drawings = new JsonObject();
    drawings.add( ClientCanvasOperator.DRAWINGS_PROPERTY, JsonValue.valueOf( ClientCanvasTestUtil.createDrawings( 1 ) ) );
    environment.dispatchNotify( ClientCanvasOperator.DRAWING_EVENT, drawings );

    operator.handleNotify( clientCanvas, ClientCanvasOperator.DRAWING_EVENT, drawings );

    verify( drawListener ).receivedDrawing();
View Full Code Here

    ClientCanvas clientCanvas = new ClientCanvas( shell, SWT.NONE );
    ClientDrawListener drawListener = mock( ClientDrawListener.class );
    clientCanvas.addClientDrawListener( drawListener );
    ClientCanvasOperator operator = new ClientCanvasOperator( clientCanvas );
    environment.newRequest();
    JsonObject drawings = new JsonObject();
    drawings.add( ClientCanvasOperator.DRAWINGS_PROPERTY, JsonValue.valueOf( ClientCanvasTestUtil.createDrawings( 1 ) ) );
    environment.dispatchNotify( ClientCanvasOperator.DRAWING_EVENT, drawings );

    operator.handleNotify( clientCanvas, ClientCanvasOperator.DRAWING_EVENT, drawings );

    DrawingsCache cache = clientCanvas.getAdapter( DrawingsCache.class );
View Full Code Here

TOP

Related Classes of org.eclipse.rap.json.JsonObject

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.