flink-instrumentation/workspace/flink-1.4.1-instrumented/flink-1.4.1/flink-core/src/test/java/org/apache/flink/api/common/typeutils/TypeSerializerSerializationUtilTest.java
/**
	 * Verifies that deserializing config snapshots fail if the config class could not be found.
	 */
Verifies that deserializing config snapshots fail if the config class could not be found.
Verifies that deserializing config snapshots fail if the config class could not be found .
@Test
	public void testFailsWhenConfigurationSnapshotClassNotFound() throws Exception {
		byte[] serializedConfig;
		try (ByteArrayOutputStream out = new ByteArrayOutputStream()) {
			TypeSerializerSerializationUtil.writeSerializerConfigSnapshot(
				new DataOutputViewStreamWrapper(out), new TypeSerializerSerializationUtilTest.TestConfigSnapshot(123, "foobar"));
			serializedConfig = out.toByteArray();
		}
		try (ByteArrayInputStream in = new ByteArrayInputStream(serializedConfig)) {
			TypeSerializerSerializationUtil.readSerializerConfigSnapshot(
				new DataInputViewStreamWrapper(in), new URLClassLoader(new URL[0], null));
			fail("Expected a ClassNotFoundException wrapped in IOException");
		} catch (IOException expected) {
		}
	}
@ Test public void testFailsWhenConfigurationSnapshotClassNotFound ( ) throws Exception { byte [ ] serializedConfig ; try ( ByteArrayOutputStream out = new ByteArrayOutputStream ( ) ) { TypeSerializerSerializationUtil . writeSerializerConfigSnapshot ( new DataOutputViewStreamWrapper ( out ) , new TypeSerializerSerializationUtilTest . TestConfigSnapshot ( 123 , "foobar" ) ) ; serializedConfig = out . toByteArray ( ) ; } try ( ByteArrayInputStream in = new ByteArrayInputStream ( serializedConfig ) ) { TypeSerializerSerializationUtil . readSerializerConfigSnapshot ( new DataInputViewStreamWrapper ( in ) , new URLClassLoader ( new URL [ 0 ] , null ) ) ; fail ( "Expected a ClassNotFoundException wrapped in IOException" ) ; } catch ( IOException expected ) { } }
Verifies that deserializing config snapshots fail if the config class could not be found.
Verifies that deserializing config snapshots fail if the config class could not be found .
// read using a dummy classloader // test passes