@Test public void testComputeSummary() { TableAnswerElement answer = new TableAnswerElement( new TableMetadata( ImmutableList.of(new ColumnMetadata("col", Schema.STRING, "desc")), "no desc")); answer.addRow(Row.builder().put("col", "val").build()); answer.addRow(Row.builder().put("col", "val").build()); Assertion assertion = new Assertion(AssertionType.countequals, new IntNode(1)); AnswerSummary summary = answer.computeSummary(assertion); assertThat(summary.getNumResults(), equalTo(2)); assertThat(summary.getNumFailed(), equalTo(1)); assertThat(summary.getNumPassed(), equalTo(0)); }
public AnswerSummary computeSummary(Assertion assertion) { String notes = "Found " + _rows.size() + " results"; return computeSummary(assertion, notes); }
TableAnswerElement extends AnswerElement { public AnswerSummary computeSummary(Assertion assertion) { String notes = "Found " + _rows.size() + " results"; return computeSummary(assertion, notes); } }
TableAnswerElement extends AnswerElement { public AnswerSummary computeSummary(Assertion assertion) { String notes = "Found " + _rows.size() + " results"; return computeSummary(assertion, notes); } @JsonCreator  TableAnswerElement(@Nonnull @JsonProperty(PROP_METADATA) TableMetadata tableMetadata); }
TableAnswerElement extends AnswerElement { public AnswerSummary computeSummary(Assertion assertion) { String notes = "Found " + _rows.size() + " results"; return computeSummary(assertion, notes); } @JsonCreator  TableAnswerElement(@Nonnull @JsonProperty(PROP_METADATA) TableMetadata tableMetadata); @Nonnull TableAnswerElement addRow(Row row); @Nonnull TableAnswerElement addExcludedRow(Row row, String exclusionName); AnswerSummary computeSummary(Assertion assertion); AnswerSummary computeSummary(Assertion assertion, String notes); boolean evaluateAssertion(Assertion assertion); @JsonProperty(PROP_EXCLUDED_ROWS) List<ExcludedRows> getExcludedRows(); @JsonProperty(PROP_METADATA) TableMetadata getMetadata(); @JsonIgnore Rows getRows(); @JsonProperty(PROP_ROWS) List<Row> getRowsList(); void postProcessAnswer(Question question, Iterable<Row> initialSet); }
TableAnswerElement extends AnswerElement { public AnswerSummary computeSummary(Assertion assertion) { String notes = "Found " + _rows.size() + " results"; return computeSummary(assertion, notes); } @JsonCreator  TableAnswerElement(@Nonnull @JsonProperty(PROP_METADATA) TableMetadata tableMetadata); @Nonnull TableAnswerElement addRow(Row row); @Nonnull TableAnswerElement addExcludedRow(Row row, String exclusionName); AnswerSummary computeSummary(Assertion assertion); AnswerSummary computeSummary(Assertion assertion, String notes); boolean evaluateAssertion(Assertion assertion); @JsonProperty(PROP_EXCLUDED_ROWS) List<ExcludedRows> getExcludedRows(); @JsonProperty(PROP_METADATA) TableMetadata getMetadata(); @JsonIgnore Rows getRows(); @JsonProperty(PROP_ROWS) List<Row> getRowsList(); void postProcessAnswer(Question question, Iterable<Row> initialSet);  }