Class BaseAggregationTestCase<AB extends AbstractAggregationBuilder<AB>>


public abstract class BaseAggregationTestCase<AB extends AbstractAggregationBuilder<AB>> extends AbstractBuilderTestCase
  • Field Details

  • Constructor Details

    • BaseAggregationTestCase

      public BaseAggregationTestCase()
  • Method Details

    • createTestAggregatorBuilder

      protected abstract AB createTestAggregatorBuilder()
    • testFromXContent

      public void testFromXContent() throws IOException
      Generic test that creates new AggregatorFactory from the test AggregatorFactory and checks both for equality and asserts equality on the two queries.
      Throws:
      IOException
    • testFromXContentMulti

      public void testFromXContentMulti() throws IOException
      Create at least 2 aggregations and test equality and hash
      Throws:
      IOException
    • testSerializationMulti

      public void testSerializationMulti() throws IOException
      Create at least 2 aggregations and test equality and hash
      Throws:
      IOException
    • testToString

      public void testToString() throws IOException
      Generic test that checks that the toString method renders the XContent correctly.
      Throws:
      IOException
    • parse

      protected AggregationBuilder parse(org.elasticsearch.xcontent.XContentParser parser) throws IOException
      Throws:
      IOException
    • testSerialization

      public void testSerialization() throws IOException
      Test serialization and deserialization of the test AggregatorFactory.
      Throws:
      IOException
    • assertToXContentAfterSerialization

      protected void assertToXContentAfterSerialization(AB original, AB deserialized) throws IOException
      Make sure serialization preserves toXContent.
      Throws:
      IOException
    • testEqualsAndHashcode

      public void testEqualsAndHashcode() throws IOException
      Throws:
      IOException
    • testShallowCopy

      public void testShallowCopy()
    • copyAggregation

      protected AB copyAggregation(AB agg) throws IOException
      Throws:
      IOException
    • randomNumericField

      public String randomNumericField()
    • randomFieldOrScript

      protected void randomFieldOrScript(ValuesSourceAggregationBuilder<?> factory, String field)