Package org.eclipse.rap.json

Examples of org.eclipse.rap.json.JsonObject


  @Test
  public void testFiresPresentationChangeToFullScreenOnce() {
    environment.getRemoteObject().setHandler( new VideoOperationHandler( video ) );
    video.addPresentationListener( presentationListener );
    environment.newRequest();
    JsonObject parameters = new JsonObject();
    parameters.add( PROPERTY_PRESENTATION, Presentation.FULL_SCREEN.name() );

    environment.dispatchNotify( Constants.EVENT_PRESENTATION, parameters );

    verify( presentationListener ).presentationChanged( Presentation.FULL_SCREEN );
    assertFalse( hasOperation( WidgetUtil.getId( video ), SET, null ) );
View Full Code Here


    lifeCycleAdapter.preserveValues( video );

    video.play();
    lifeCycleAdapter.renderChanges( video );

    JsonObject properties = MessageUtil.getOperationProperties( WidgetUtil.getId( video ), SET, null );
    assertEquals( keyForEnum( Playback.PLAY ), properties.get( keyForEnum( PlaybackOptions.PLAYBACK ) ).asString() );
  }
View Full Code Here

    lifeCycleAdapter.preserveValues( video );

    video.setFullscreen( true );
    lifeCycleAdapter.renderChanges( video );

    JsonObject properties = MessageUtil.getOperationProperties( WidgetUtil.getId( video ), SET, null );
    assertEquals( keyForEnum( Presentation.FULL_SCREEN ),
                  properties.get( keyForEnum( PlaybackOptions.PRESENTATION ) ).asString() );
  }
View Full Code Here

    lifeCycleAdapter.preserveValues( video );

    video.fastForward( 2 );
    lifeCycleAdapter.renderChanges( video );

    JsonObject properties = MessageUtil.getOperationProperties( WidgetUtil.getId( video ), SET, null );
    assertEquals( 2, properties.get( keyForEnum( PlaybackOptions.SPEED ) ).asDouble(), 0 );
  }
View Full Code Here

    lifeCycleAdapter.preserveValues( video );

    video.fastBackward( -2 );
    lifeCycleAdapter.renderChanges( video );

    JsonObject properties = MessageUtil.getOperationProperties( WidgetUtil.getId( video ), SET, null );
    assertEquals( -2, properties.get( keyForEnum( PlaybackOptions.SPEED ) ).asDouble(), 0 );
  }
View Full Code Here

    lifeCycleAdapter.preserveValues( video );

    video.setRepeat( true );
    lifeCycleAdapter.renderChanges( video );

    JsonObject properties = MessageUtil.getOperationProperties( WidgetUtil.getId( video ), SET, null );
    assertTrue( properties.get( keyForEnum( PlaybackOptions.REPEAT ) ).asBoolean() );
  }
View Full Code Here

    lifeCycleAdapter.preserveValues( video );

    video.setPlayerControlsVisible( false );
    lifeCycleAdapter.renderChanges( video );

    JsonObject properties = MessageUtil.getOperationProperties( WidgetUtil.getId( video ), SET, null );
    assertFalse( properties.get( keyForEnum( PlaybackOptions.CONTROLS_VISIBLE ) ).asBoolean() );
  }
View Full Code Here

    lifeCycleAdapter.preserveValues( video );

    video.stepToTime( 23 );
    lifeCycleAdapter.renderChanges( video );

    JsonObject properties = MessageUtil.getOperationProperties( WidgetUtil.getId( video ), SET, null );
    assertEquals( 23, properties.get( keyForEnum( PlaybackOptions.HEAD_POSITION ) ).asInt() );
  }
View Full Code Here

    lifeCycleAdapter.preserveValues( video );

    video.addPlaybackListener( playbackListener );
    lifeCycleAdapter.renderChanges( video );

    JsonObject properties = MessageUtil.getOperationProperties( WidgetUtil.getId( video ), LISTEN, null );
    assertNotNull( properties.get( Constants.EVENT_PLAYBACK ) );
  }
View Full Code Here

    lifeCycleAdapter.preserveValues( video );

    video.addPresentationListener( presentationListener );
    lifeCycleAdapter.renderChanges( video );

    JsonObject properties = MessageUtil.getOperationProperties( WidgetUtil.getId( video ), LISTEN, null );
    assertNotNull( properties.get( Constants.EVENT_PRESENTATION ) );
  }
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.