flink-instrumentation/workspace/flink-1.4.1-instrumented/flink-1.4.1/flink-runtime/src/test/java/org/apache/flink/runtime/jobmanager/JobManagerStartupTest.java
/**
	 * Verifies that the JobManager fails fast (and with expressive error message)
	 * when one of its components (here the BLOB server) fails to start properly.
	 */
Verifies that the JobManager fails fast (and with expressive error message)
when one of its components (here the BLOB server) fails to start properly.
Verifies that the JobManager fails fast ( and with expressive error message ) when one of its components ( here the BLOB server ) fails to start properly .
@Test
	public void testJobManagerStartupFails() {
		final int portNum;
		try {
			portNum = NetUtils.getAvailablePort();
		}
		catch (Throwable t) {
			return;
		}
		Configuration failConfig = new Configuration();
		String nonExistDirectory = new File(blobStorageDirectory, DOES_NOT_EXISTS_NO_SIR).getAbsolutePath();
		failConfig.setString(BlobServerOptions.STORAGE_DIRECTORY, nonExistDirectory);
		try {
			JobManager.runJobManager(failConfig, JobManagerMode.CLUSTER, "localhost", portNum);
			fail("this should fail with an exception");
		}
		catch (Exception e) {
		}
	}
@ Test public void testJobManagerStartupFails ( ) { final int portNum ; try { portNum = NetUtils . getAvailablePort ( ) ; } catch ( Throwable t ) { return ; } Configuration failConfig = new Configuration ( ) ; String nonExistDirectory = new File ( blobStorageDirectory , DOES_NOT_EXISTS_NO_SIR ) . getAbsolutePath ( ) ; failConfig . setString ( BlobServerOptions . STORAGE_DIRECTORY , nonExistDirectory ) ; try { JobManager . runJobManager ( failConfig , JobManagerMode . CLUSTER , "localhost" , portNum ) ; fail ( "this should fail with an exception" ) ; } catch ( Exception e ) { } }
Verifies that the JobManager fails fast (and with expressive error message)
 when one of its components (here the BLOB server) fails to start properly.
Verifies that the JobManager fails fast ( and with expressive error message ) when one of its components ( here the BLOB server ) fails to start properly .
// skip test if we cannot find a free port // expected