Java Code Examples for org.apache.flink.api.common.typeutils.ComparatorTestBase

The following examples show how to use org.apache.flink.api.common.typeutils.ComparatorTestBase. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: beam   Source File:    License: Apache License 2.0 5 votes vote down vote up
private void testWriteAndReadConfigSnapshot(Coder<String> coder) throws IOException {
  CoderTypeSerializer<String> serializer = new CoderTypeSerializer<>(coder);

  TypeSerializerSnapshot writtenSnapshot = serializer.snapshotConfiguration();
  ComparatorTestBase.TestOutputView outView = new ComparatorTestBase.TestOutputView();

  TypeSerializerSnapshot readSnapshot = new CoderTypeSerializer.LegacySnapshot();
      writtenSnapshot.getCurrentVersion(), outView.getInputView(), getClass().getClassLoader());

  assertThat(readSnapshot.restoreSerializer(), is(serializer));