Package org.eclipse.rap.json

Examples of org.eclipse.rap.json.JsonObject


  public void testRenderMessage() {
    composite.setMessage( "foo" );

    lca.renderMessage( composite );

    JsonObject properties = getOperationProperties( WidgetUtil.getId( composite ), SET, null );
    assertEquals( "foo", properties.get( "message" ).asString() );
  }
View Full Code Here


  public void testRenderDone() {
    composite.done();

    lca.renderDone( composite );

    JsonObject properties = getOperationProperties( WidgetUtil.getId( composite ), CALL, "done" );
    assertTrue( properties.isEmpty() );
  }
View Full Code Here

    composite.setSize( 110, 120 );

    lca.renderClientArea( composite );

    Rectangle clientArea = composite.getClientArea();
    JsonObject properties = getOperationProperties( WidgetUtil.getId( composite ), SET, null );
    assertEquals( clientArea, toRectangle( properties.get( "clientArea" ) ) );
  }
View Full Code Here

    composite.setSize( 0, 0 );

    lca.renderClientArea( composite );

    Rectangle clientArea = new Rectangle( 0, 0, 0, 0 );
    JsonObject properties = getOperationProperties( WidgetUtil.getId( composite ), SET, null );
    assertEquals( clientArea, toRectangle( properties.get( "clientArea" ) ) );
  }
View Full Code Here

  public void testRenderChangesRendersClientListener() throws IOException {
    composite.addListener( SWT.MouseDown, new ClientListener( "" ) );

    lca.renderChanges( composite );

    JsonObject properties = getOperationProperties( WidgetUtil.getId( composite ), CALL, "addListener" );
    assertNotNull( properties );
  }
View Full Code Here

  @Test
  public void testDelegatesError() {
    PrinterImpl print = new PrinterImpl();
    PrintListener listener = mock( PrintListener.class );
    print.addPrintListener( listener );
    JsonObject properties = new JsonObject();
    properties.add( "printer", "" );
    properties.add( "jobName", "" );
    properties.add( "message", "" );

    print.print( "http://localhost/file.pdf", createOptions() );
    environment.dispatchNotifyOnServiceObject( "Error", properties );

    verify( listener ).printFailed( any( PrintError.class ) );
View Full Code Here

    PrinterImpl print = new PrinterImpl();
    PrintListener listener = mock( PrintListener.class );
    print.addPrintListener( listener );

    print.print( "http://localhost/file.pdf", createOptions() );
    environment.dispatchNotifyOnServiceObject( "Error", new JsonObject() );

    verify( listener ).printFailed( any( PrintError.class ) );
  }
View Full Code Here

    PrinterImpl print = new PrinterImpl();
    PrintListener listener1 = mock( PrintListener.class );
    PrintListener listener2 = mock( PrintListener.class );
    print.addPrintListener( listener1 );
    print.addPrintListener( listener2 );
    JsonObject properties = new JsonObject();
    properties.add( "printer", "" );
    properties.add( "jobName", "" );
    properties.add( "message", "" );

    print.print( "http://localhost/file.pdf", createOptions() );
    environment.dispatchNotifyOnServiceObject( "Error", properties );

    InOrder order = inOrder( listener1, listener2 );
View Full Code Here

  @Test
  public void testDelegatesCancel() {
    PrinterImpl print = new PrinterImpl();
    PrintListener listener = mock( PrintListener.class );
    print.addPrintListener( listener );
    JsonObject properties = new JsonObject();
    properties.add( "printer", "" );
    properties.add( "jobName", "" );

    print.print( "http://localhost/file.pdf", createOptions() );
    environment.dispatchNotifyOnServiceObject( "Cancel", properties );

    verify( listener ).printCanceled( any( String.class ), any( String.class ) );
View Full Code Here

    PrinterImpl print = new PrinterImpl();
    PrintListener listener = mock( PrintListener.class );
    print.addPrintListener( listener );

    print.print( "http://localhost/file.pdf", createOptions() );
    environment.dispatchNotifyOnServiceObject( "Cancel", new JsonObject() );

    verify( listener ).printCanceled( null, null );
  }
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.