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 after a successful registration of the client at the JobManager.
	 */
Tests that a  JobClientActorConnectionTimeoutException
is thrown after a successful registration of the client at the JobManager.
Tests that a JobClientActorConnectionTimeoutException is thrown after a successful registration of the client at the JobManager .
@Test(expected=JobClientActorConnectionTimeoutException.class)
	public void testConnectionTimeoutAfterJobRegistration() throws Exception {
		FiniteDuration jobClientActorTimeout = new FiniteDuration(1L, TimeUnit.SECONDS);
		FiniteDuration timeout = jobClientActorTimeout.$times(2L);
		UUID leaderSessionID = UUID.randomUUID();
		ActorRef jobManager = system.actorOf(
			Props.create(
				JobAcceptingActor.class,
				leaderSessionID));
		TestingLeaderRetrievalService testingLeaderRetrievalService = new TestingLeaderRetrievalService(
			jobManager.path().toString(),
			leaderSessionID
		);
		Props jobClientActorProps = JobAttachmentClientActor.createActorProps(
			testingLeaderRetrievalService,
			jobClientActorTimeout,
			false);
		ActorRef jobClientActor = system.actorOf(jobClientActorProps);
		Future<Object> jobExecutionResult = Patterns.ask(
			jobClientActor,
			new AttachToJobAndWait(testJobGraph.getJobID()),
			new Timeout(timeout));
		Future<Object> waitFuture = Patterns.ask(jobManager, new RegisterTest(), new Timeout(timeout));
		Await.result(waitFuture, timeout);
		jobManager.tell(PoisonPill.getInstance(), ActorRef.noSender());
		Await.result(jobExecutionResult, timeout);
	}
@ Test ( expected = JobClientActorConnectionTimeoutException . class ) public void testConnectionTimeoutAfterJobRegistration ( ) throws Exception { FiniteDuration jobClientActorTimeout = new FiniteDuration ( 1L , TimeUnit . SECONDS ) ; FiniteDuration timeout = jobClientActorTimeout . $times ( 2L ) ; UUID leaderSessionID = UUID . randomUUID ( ) ; ActorRef jobManager = system . actorOf ( Props . create ( JobAcceptingActor . class , leaderSessionID ) ) ; TestingLeaderRetrievalService testingLeaderRetrievalService = new TestingLeaderRetrievalService ( jobManager . path ( ) . toString ( ) , leaderSessionID ) ; Props jobClientActorProps = JobAttachmentClientActor . createActorProps ( testingLeaderRetrievalService , jobClientActorTimeout , false ) ; ActorRef jobClientActor = system . actorOf ( jobClientActorProps ) ; Future < Object > jobExecutionResult = Patterns . ask ( jobClientActor , new AttachToJobAndWait ( testJobGraph . getJobID ( ) ) , new Timeout ( timeout ) ) ; Future < Object > waitFuture = Patterns . ask ( jobManager , new RegisterTest ( ) , new Timeout ( timeout ) ) ; Await . result ( waitFuture , timeout ) ; jobManager . tell ( PoisonPill . getInstance ( ) , ActorRef . noSender ( ) ) ; Await . result ( jobExecutionResult , timeout ) ; }
Tests that a {@link JobClientActorConnectionTimeoutException}
 is thrown after a successful registration of the client at the JobManager.
Tests that a { @link JobClientActorConnectionTimeoutException } is thrown after a successful registration of the client at the JobManager .