flink-instrumentation/workspace/flink-1.4.1-instrumented/flink-1.4.1/flink-runtime/src/test/java/org/apache/flink/runtime/state/StateBackendLoadingTest.java
/**
	 * This test makes sure that failures properly manifest when the state backend could not be loaded.
	 */
This test makes sure that failures properly manifest when the state backend could not be loaded.
This test makes sure that failures properly manifest when the state backend could not be loaded .
@Test
	public void testLoadingFails() throws Exception {
		final Configuration config = new Configuration();
		config.setString(backendKey, "does.not.exist");
		try {
			AbstractStateBackend.loadStateBackendFromConfigOrCreateDefault(config, cl, null);
			fail("should fail with an exception");
		} catch (DynamicCodeLoadingException ignored) {
		}
		config.setString(backendKey, java.io.File.class.getName());
		try {
			AbstractStateBackend.loadStateBackendFromConfigOrCreateDefault(config, cl, null);
			fail("should fail with an exception");
		} catch (DynamicCodeLoadingException ignored) {
		}
		config.setString(backendKey, FailingFactory.class.getName());
		try {
			AbstractStateBackend.loadStateBackendFromConfigOrCreateDefault(config, cl, null);
			fail("should fail with an exception");
		} catch (IOException ignored) {
		}
	}
@ Test public void testLoadingFails ( ) throws Exception { final Configuration config = new Configuration ( ) ; config . setString ( backendKey , "does.not.exist" ) ; try { AbstractStateBackend . loadStateBackendFromConfigOrCreateDefault ( config , cl , null ) ; fail ( "should fail with an exception" ) ; } catch ( DynamicCodeLoadingException ignored ) { } config . setString ( backendKey , java . io . File . class . getName ( ) ) ; try { AbstractStateBackend . loadStateBackendFromConfigOrCreateDefault ( config , cl , null ) ; fail ( "should fail with an exception" ) ; } catch ( DynamicCodeLoadingException ignored ) { } config . setString ( backendKey , FailingFactory . class . getName ( ) ) ; try { AbstractStateBackend . loadStateBackendFromConfigOrCreateDefault ( config , cl , null ) ; fail ( "should fail with an exception" ) ; } catch ( IOException ignored ) { } }
This test makes sure that failures properly manifest when the state backend could not be loaded.
This test makes sure that failures properly manifest when the state backend could not be loaded .
// try a value that is neither recognized as a name, nor corresponds to a class // expected // try a class that is not a factory // expected // a factory that fails // expected