Class AbstractNamedWriteableTestCase<T extends org.elasticsearch.common.io.stream.NamedWriteable>

java.lang.Object
org.junit.Assert
org.apache.lucene.util.LuceneTestCase
org.elasticsearch.test.ESTestCase
org.elasticsearch.test.AbstractWireTestCase<T>
org.elasticsearch.test.AbstractNamedWriteableTestCase<T>
Direct Known Subclasses:
InternalAggregationTestCase

public abstract class AbstractNamedWriteableTestCase<T extends org.elasticsearch.common.io.stream.NamedWriteable>
extends AbstractWireTestCase<T>
Standard test case for testing the wire serialization of subclasses of NamedWriteable. See AbstractWireSerializingTestCase for subclasses of Writeable. While you *can* use AbstractWireSerializingTestCase to test susbclasses of NamedWriteable this superclass will also test reading and writing the name.
  • Constructor Details

  • Method Details

    • getNamedWriteableRegistry

      protected abstract org.elasticsearch.common.io.stream.NamedWriteableRegistry getNamedWriteableRegistry()
      Description copied from class: AbstractWireTestCase
      Get the NamedWriteableRegistry to use when de-serializing the object. Override this method if you need to register NamedWriteables for the test object to de-serialize. By default this will return a NamedWriteableRegistry with no registered NamedWriteables
      Overrides:
      getNamedWriteableRegistry in class AbstractWireTestCase<T extends org.elasticsearch.common.io.stream.NamedWriteable>
    • categoryClass

      protected abstract java.lang.Class<T> categoryClass()
      The type of NamedWriteable to read.
    • copyInstance

      protected T copyInstance​(T instance, org.elasticsearch.Version version) throws java.io.IOException
      Description copied from class: AbstractWireTestCase
      Copy the instance as by reading and writing using the code specific to the provided version. The version is useful for sanity checking the backwards compatibility of the wire. It isn't a substitute for real backwards compatibility tests but it is *so* much faster.
      Specified by:
      copyInstance in class AbstractWireTestCase<T extends org.elasticsearch.common.io.stream.NamedWriteable>
      Throws:
      java.io.IOException