public final class DiffableTestUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static int |
NUMBER_OF_DIFF_TEST_RUNS |
Modifier and Type | Method and Description |
---|---|
static <T extends Diffable<T>> |
assertDiffApplication(T remoteChanges,
T localInstance,
Diff<T> diffs)
Asserts that changes are applied correctly, i.e.
|
static <T extends Writeable> |
assertSerialization(T testInstance,
NamedWriteableRegistry namedWriteableRegistry,
Writeable.Reader<T> reader)
Asserts that testInstance can be correctly.
|
static <T extends Writeable> |
copyInstance(T diffs,
NamedWriteableRegistry namedWriteableRegistry,
Writeable.Reader<T> reader)
Simulates sending diffs over the wire
|
static <T extends Diffable<T>> |
testDiffableSerialization(java.util.function.Supplier<T> testInstance,
java.util.function.Function<T,T> modifier,
NamedWriteableRegistry namedWriteableRegistry,
Writeable.Reader<T> reader,
Writeable.Reader<Diff<T>> diffReader)
Tests making random changes to an object, calculating diffs for these changes, sending this
diffs over the wire and appling these diffs on the other side.
|
protected static final int NUMBER_OF_DIFF_TEST_RUNS
public static <T extends Diffable<T>> T assertDiffApplication(T remoteChanges, T localInstance, Diff<T> diffs)
public static <T extends Writeable> T copyInstance(T diffs, NamedWriteableRegistry namedWriteableRegistry, Writeable.Reader<T> reader) throws java.io.IOException
java.io.IOException
public static <T extends Diffable<T>> void testDiffableSerialization(java.util.function.Supplier<T> testInstance, java.util.function.Function<T,T> modifier, NamedWriteableRegistry namedWriteableRegistry, Writeable.Reader<T> reader, Writeable.Reader<Diff<T>> diffReader) throws java.io.IOException
java.io.IOException
public static <T extends Writeable> T assertSerialization(T testInstance, NamedWriteableRegistry namedWriteableRegistry, Writeable.Reader<T> reader) throws java.io.IOException
java.io.IOException