Class BaseAggregationTestCase<AB extends org.elasticsearch.search.aggregations.AbstractAggregationBuilder<AB>>

java.lang.Object
org.junit.Assert
org.apache.lucene.util.LuceneTestCase
org.elasticsearch.test.ESTestCase
org.elasticsearch.test.AbstractBuilderTestCase
org.elasticsearch.search.aggregations.BaseAggregationTestCase<AB>

public abstract class BaseAggregationTestCase<AB extends org.elasticsearch.search.aggregations.AbstractAggregationBuilder<AB>>
extends AbstractBuilderTestCase
  • Field Details

  • Constructor Details

    • BaseAggregationTestCase

      public BaseAggregationTestCase()
  • 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 org.elasticsearch.search.aggregations.AggregationBuilder parse​(org.elasticsearch.common.xcontent.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​(org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder<?> factory, java.lang.String field)