Class BaseAggregationTestCase<AB extends AbstractAggregationBuilder<AB>>

java.lang.Object
org.junit.Assert

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

  • Constructor Details

  • Method Details

    • createTestAggregatorBuilder

      protected abstract AB createTestAggregatorBuilder()
    • testFromXContent

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

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

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

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

      protected AggregationBuilder parse​(XContentParser parser) throws java.io.IOException
      Throws:
      java.io.IOException
    • testSerialization

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

      public void testEqualsAndHashcode() throws java.io.IOException
      Throws:
      java.io.IOException
    • testShallowCopy

      public void testShallowCopy()
    • copyAggregation

      protected AB copyAggregation​(AB agg) throws java.io.IOException
      Throws:
      java.io.IOException
    • randomNumericField

      public java.lang.String randomNumericField()
    • randomFieldOrScript

      protected void randomFieldOrScript​(ValuesSourceAggregationBuilder<?,​?> factory, java.lang.String field)