Skip to content

Commit

Permalink
Add CoreValuesSourceTypeTests for histogram (elastic#49751)
Browse files Browse the repository at this point in the history
  • Loading branch information
iverase authored and SivagurunathanV committed Jan 21, 2020
1 parent 2b7cea8 commit a8b6c23
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public void testValidOrdinals() {
assertThat(CoreValuesSourceType.BYTES.ordinal(), equalTo(2));
assertThat(CoreValuesSourceType.GEOPOINT.ordinal(), equalTo(3));
assertThat(CoreValuesSourceType.RANGE.ordinal(), equalTo(4));
assertThat(CoreValuesSourceType.HISTOGRAM.ordinal(), equalTo(5));
}

@Override
Expand All @@ -47,6 +48,7 @@ public void testFromString() {
assertThat(CoreValuesSourceType.fromString("bytes"), equalTo(CoreValuesSourceType.BYTES));
assertThat(CoreValuesSourceType.fromString("geopoint"), equalTo(CoreValuesSourceType.GEOPOINT));
assertThat(CoreValuesSourceType.fromString("range"), equalTo(CoreValuesSourceType.RANGE));
assertThat(CoreValuesSourceType.fromString("histogram"), equalTo(CoreValuesSourceType.HISTOGRAM));
IllegalArgumentException e = expectThrows(IllegalArgumentException.class,
() -> CoreValuesSourceType.fromString("does_not_exist"));
assertThat(e.getMessage(),
Expand All @@ -61,6 +63,7 @@ public void testReadFrom() throws IOException {
assertReadFromStream(2, CoreValuesSourceType.BYTES);
assertReadFromStream(3, CoreValuesSourceType.GEOPOINT);
assertReadFromStream(4, CoreValuesSourceType.RANGE);
assertReadFromStream(5, CoreValuesSourceType.HISTOGRAM);
}

@Override
Expand All @@ -70,5 +73,6 @@ public void testWriteTo() throws IOException {
assertWriteToStream(CoreValuesSourceType.BYTES, 2);
assertWriteToStream(CoreValuesSourceType.GEOPOINT, 3);
assertWriteToStream(CoreValuesSourceType.RANGE, 4);
assertWriteToStream(CoreValuesSourceType.HISTOGRAM, 5);
}
}

0 comments on commit a8b6c23

Please sign in to comment.