Ejemplo n.º 1
0
  @Test
  public void collectTuple() {
    stub = new FunctionCallStub.Builder<String>(FIELDS).build();
    assertThat(stub.result().asTupleEntryList().isEmpty(), is(true));

    stub.getOutputCollector().add(new Tuple(1));
    assertThat(stub.result().asTupleEntryList().size(), is(1));
    assertThat(stub.result().asTupleEntryList().get(0), is(new TupleEntry(FIELDS, new Tuple(1))));
  }
Ejemplo n.º 2
0
  @Test(expected = IllegalArgumentException.class)
  public void collectIrregularTupleEntry() {
    stub = new FunctionCallStub.Builder<String>(FIELDS).build();
    assertThat(stub.result().asTupleEntryList().isEmpty(), is(true));

    stub.getOutputCollector().add(new TupleEntry(new Fields("X", String.class), new Tuple(1)));
  }