Package org.eclipse.rap.rwt.testfixture

Examples of org.eclipse.rap.rwt.testfixture.TestMessage


    }
    return new JsonObject();
  }

  private static SetOperation findSetOperation( TestMessage message, String target ) {
    TestMessage protocolMessage = Fixture.getProtocolMessage();
    int operationCount = protocolMessage.getOperationCount();
    for( int i = 0; i < operationCount; i++ ) {
      Operation operation = protocolMessage.getOperation( i );
      if( operation instanceof SetOperation ) {
        SetOperation set = ( SetOperation )operation;
        if( set.getTarget().equals( target ) ) {
          return set;
        }
View Full Code Here


    }
    return null;
  }

  private static ListenOperation findListenOperation( TestMessage message, String target ) {
    TestMessage protocolMessage = Fixture.getProtocolMessage();
    int operationCount = protocolMessage.getOperationCount();
    for( int i = 0; i < operationCount; i++ ) {
      Operation operation = protocolMessage.getOperation( i );
      if( operation instanceof ListenOperation ) {
        ListenOperation listen = ( ListenOperation )operation;
        if( listen.getTarget().equals( target ) ) {
          return listen;
        }
View Full Code Here

    Fixture.preserveWidgets();

    control.addListener( eventType, listener );
    getLCA( control ).renderChanges( control );

    TestMessage message = Fixture.getProtocolMessage();
    String listenerName = getListenerName( eventType );
    assertTrue( message.findListenProperty( control, listenerName ).asBoolean() );

    control.removeListener( eventType, listener );
  }
View Full Code Here

    Fixture.preserveWidgets();

    control.removeListener( eventType, listener );
    getLCA( control ).renderChanges( control );

    TestMessage message = Fixture.getProtocolMessage();
    String listenerName = getListenerName( eventType );
    assertFalse( message.findListenProperty( control, listenerName ).asBoolean() );
  }
View Full Code Here

    control.addListener( eventType, listener );
    Fixture.preserveWidgets();
    getLCA( control ).renderChanges( control );

    TestMessage message = Fixture.getProtocolMessage();
    String listenerName = getListenerName( eventType );
    assertNull( message.findListenOperation( control, listenerName ) );

    control.removeListener( eventType, listener );
  }
View Full Code Here

    CREATE, SET, CALL, LISTEN
  }

  public static boolean hasCreateOperation( String type ) {
    boolean found = false;
    TestMessage protocolMessage = Fixture.getProtocolMessage();
    int operationCount = protocolMessage.getOperationCount();
    for( int i = 0; i < operationCount; i++ ) {
      Operation operation = protocolMessage.getOperation( i );
      if( operation instanceof CreateOperation ) {
        CreateOperation create = ( CreateOperation )operation;
        if( create.getType().equals( type ) ) {
          found = true;
        }
View Full Code Here

    return found;
  }

  public static boolean isParentOfCreate( String type, String parentId ) {
    boolean found = false;
    TestMessage protocolMessage = Fixture.getProtocolMessage();
    int operationCount = protocolMessage.getOperationCount();
    for( int i = 0; i < operationCount; i++ ) {
      Operation operation = protocolMessage.getOperation( i );
      if( operation instanceof CreateOperation ) {
        CreateOperation create = ( CreateOperation )operation;
        if( create.getType().equals( type ) && create.getProperties().get( "parent" ).asString().equals( parentId ) ) {
          found = true;
        }
View Full Code Here

  public static JsonObject getHead() {
    return Fixture.getProtocolMessage().getHead();
  }

  public static boolean hasOperation( String target, OperationType type, String operationName ) {
    TestMessage message = Fixture.getProtocolMessage();
    if( type == OperationType.CREATE ) {
      CreateOperation operation = message.findCreateOperation( target );
      if( operation != null ) {
        return true;
      }
    } else if( type == OperationType.CALL ) {
      CallOperation operation = message.findCallOperation( target, operationName );
      if( operation != null ) {
        return true;
      }
    } else if( type == OperationType.SET ) {
      SetOperation operation = findSetOperation( message, target );
View Full Code Here

    }
    return false;
  }

  public static JsonObject getOperationProperties( String target, OperationType type, String operationName ) {
    TestMessage message = Fixture.getProtocolMessage();
    if( type == OperationType.CREATE ) {
      CreateOperation operation = message.findCreateOperation( target );
      if( operation != null ) {
        return operation.getProperties();
      }
    } else if( type == OperationType.CALL ) {
      CallOperation operation = message.findCallOperation( target, operationName );
      if( operation != null ) {
        return operation.getParameters();
      }
    } else if( type == OperationType.SET ) {
      SetOperation operation = findSetOperation( message, target );
View Full Code Here

TOP

Related Classes of org.eclipse.rap.rwt.testfixture.TestMessage

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.