Ejemplo 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()]));
  }