flink-instrumentation/workspace/flink-1.4.1-instrumented/flink-1.4.1/flink-runtime/src/test/java/org/apache/flink/runtime/client/JobClientActorTest.java
/** Tests that a {@link JobClientActorConnectionTimeoutException}
	 * is thrown when the JobAttachmentClientActor attach to a job at the JobManager
	 * but has not connected to a JobManager.
	 */
Tests that a  JobClientActorConnectionTimeoutException
is thrown when the JobAttachmentClientActor attach to a job at the JobManager
but has not connected to a JobManager.
Tests that a JobClientActorConnectionTimeoutException is thrown when the JobAttachmentClientActor attach to a job at the JobManager but has not connected to a JobManager .
@Test(expected=JobClientActorConnectionTimeoutException.class)
	public void testConnectionTimeoutWithoutJobManagerForRegistration() throws Exception {
		FiniteDuration jobClientActorTimeout = new FiniteDuration(1L, TimeUnit.SECONDS);
		FiniteDuration timeout = jobClientActorTimeout.$times(2);
		TestingLeaderRetrievalService testingLeaderRetrievalService = new TestingLeaderRetrievalService(
			"localhost",
			HighAvailabilityServices.DEFAULT_LEADER_ID);
		Props jobClientActorProps = JobAttachmentClientActor.createActorProps(
			testingLeaderRetrievalService,
			jobClientActorTimeout,
			false);
		ActorRef jobClientActor = system.actorOf(jobClientActorProps);
		Future<Object> jobExecutionResult = Patterns.ask(
			jobClientActor,
			new JobClientMessages.AttachToJobAndWait(testJobGraph.getJobID()),
			new Timeout(timeout));
		Await.result(jobExecutionResult, timeout);
	}
@ Test ( expected = JobClientActorConnectionTimeoutException . class ) public void testConnectionTimeoutWithoutJobManagerForRegistration ( ) throws Exception { FiniteDuration jobClientActorTimeout = new FiniteDuration ( 1L , TimeUnit . SECONDS ) ; FiniteDuration timeout = jobClientActorTimeout . $times ( 2 ) ; TestingLeaderRetrievalService testingLeaderRetrievalService = new TestingLeaderRetrievalService ( "localhost" , HighAvailabilityServices . DEFAULT_LEADER_ID ) ; Props jobClientActorProps = JobAttachmentClientActor . createActorProps ( testingLeaderRetrievalService , jobClientActorTimeout , false ) ; ActorRef jobClientActor = system . actorOf ( jobClientActorProps ) ; Future < Object > jobExecutionResult = Patterns . ask ( jobClientActor , new JobClientMessages . AttachToJobAndWait ( testJobGraph . getJobID ( ) ) , new Timeout ( timeout ) ) ; Await . result ( jobExecutionResult , timeout ) ; }
Tests that a {@link JobClientActorConnectionTimeoutException}
 is thrown when the JobAttachmentClientActor attach to a job at the JobManager
 but has not connected to a JobManager.
Tests that a { @link JobClientActorConnectionTimeoutException } is thrown when the JobAttachmentClientActor attach to a job at the JobManager but has not connected to a JobManager .