Class AbstractBWCSerializationTestCase<T extends Writeable & org.elasticsearch.xcontent.ToXContent>


public abstract class AbstractBWCSerializationTestCase<T extends Writeable & org.elasticsearch.xcontent.ToXContent> extends AbstractXContentSerializingTestCase<T>
  • Constructor Details

    • AbstractBWCSerializationTestCase

      public AbstractBWCSerializationTestCase()
  • Method Details

    • mutateInstanceForVersion

      protected abstract T mutateInstanceForVersion(T instance, TransportVersion version)
      Returns the expected instance if serialized from the given version.
    • bwcVersions

      protected Collection<TransportVersion> bwcVersions()
      The bwc versions to test serialization against
    • testBwcSerialization

      public final void testBwcSerialization() throws IOException
      Test serialization and deserialization of the test instance across versions
      Throws:
      IOException
    • assertBwcSerialization

      protected final void assertBwcSerialization(T testInstance, TransportVersion version) throws IOException
      Assert that instances copied at a particular version are equal. 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.
      Throws:
      IOException
    • assertOnBWCObject

      protected void assertOnBWCObject(T bwcSerializedObject, T testInstance, TransportVersion version)
      Parameters:
      bwcSerializedObject - The object deserialized from the previous version
      testInstance - The original test instance
      version - The version which serialized