Exemplo n.º 1
0
  /** testEndObjectStates */
  public void testEndObjectStates() {
    // create object and configure it
    Schema schema = new Schema();
    SchemaObject state = schema.createObject();
    String propertyName = "myProperty";
    state.addProperty(propertyName, "String");

    // build tests
    List<EventResult> goodList =
        this.createGoodList( //
            EnumSet.of(SchemaEventType.END_OBJECT, SchemaEventType.START_OBJECT_ENTRY), //
            propertyName //
            );

    // build initializer used before each test runs
    StateInitializer initializer =
        new StateInitializer() {
          public void initialize(IState state) {
            state.enter();
            state.transition(_context, SchemaEventType.START_OBJECT, null);
          }
        };

    this.testStates(state, initializer, goodList.toArray(new EventResult[goodList.size()]));
  }
Exemplo n.º 2
0
  /** testStartObjectStates */
  public void testStartObjectStates() {
    Schema schema = new Schema();
    SchemaObject state = schema.createObject();
    List<EventResult> goodList =
        this.createGoodList( //
            EnumSet.of(SchemaEventType.START_OBJECT), //
            "property" //
            );

    this.testStates(state, goodList.toArray(new EventResult[goodList.size()]));
  }