use of org.apache.flink.runtime.shuffle.NettyShuffleDescriptor.NetworkPartitionConnectionInfo in project flink by apache.
the class ResultPartitionDeploymentDescriptorTest method testSerializationWithNettyShuffleDescriptor.
/**
* Tests simple de/serialization with {@link NettyShuffleDescriptor}.
*/
@Test
public void testSerializationWithNettyShuffleDescriptor() throws IOException {
ShuffleDescriptor shuffleDescriptor = new NettyShuffleDescriptor(producerLocation, new NetworkPartitionConnectionInfo(connectionID), resultPartitionID);
ResultPartitionDeploymentDescriptor copy = createCopyAndVerifyResultPartitionDeploymentDescriptor(shuffleDescriptor);
assertThat(copy.getShuffleDescriptor(), instanceOf(NettyShuffleDescriptor.class));
NettyShuffleDescriptor shuffleDescriptorCopy = (NettyShuffleDescriptor) copy.getShuffleDescriptor();
assertThat(shuffleDescriptorCopy.getResultPartitionID(), is(resultPartitionID));
assertThat(shuffleDescriptorCopy.isUnknown(), is(false));
assertThat(shuffleDescriptorCopy.isLocalTo(producerLocation), is(true));
assertThat(shuffleDescriptorCopy.getConnectionId(), is(connectionID));
}
Aggregations