flink-instrumentation/workspace/flink-1.4.1-instrumented/flink-1.4.1/flink-runtime/src/test/java/org/apache/flink/runtime/state/StateBackendTestBase.java
/**
	 * Verify that {@link ValueStateDescriptor} allows {@code null} as default.
	 */
Verify that  ValueStateDescriptor allows  null as default.
Verify that ValueStateDescriptor allows null as default .
@Test
	public void testValueStateNullAsDefaultValue() throws Exception {
		AbstractKeyedStateBackend<Integer> backend = createKeyedBackend(IntSerializer.INSTANCE);
		ValueStateDescriptor<String> kvId = new ValueStateDescriptor<>("id", String.class, null);
		ValueState<String> state = backend.getPartitionedState(VoidNamespace.INSTANCE, VoidNamespaceSerializer.INSTANCE, kvId);
		backend.setCurrentKey(1);
		assertEquals(null, state.value());
		state.update("Ciao");
		assertEquals("Ciao", state.value());
		state.clear();
		assertEquals(null, state.value());
		backend.dispose();
	}
@ Test public void testValueStateNullAsDefaultValue ( ) throws Exception { AbstractKeyedStateBackend < Integer > backend = createKeyedBackend ( IntSerializer . INSTANCE ) ; ValueStateDescriptor < String > kvId = new ValueStateDescriptor < > ( "id" , String . class , null ) ; ValueState < String > state = backend . getPartitionedState ( VoidNamespace . INSTANCE , VoidNamespaceSerializer . INSTANCE , kvId ) ; backend . setCurrentKey ( 1 ) ; assertEquals ( null , state . value ( ) ) ; state . update ( "Ciao" ) ; assertEquals ( "Ciao" , state . value ( ) ) ; state . clear ( ) ; assertEquals ( null , state . value ( ) ) ; backend . dispose ( ) ; }
Verify that {@link ValueStateDescriptor} allows {@code null} as default.
Verify that { @link ValueStateDescriptor } allows { @code null } as default .