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 JobClientActorRegistrationTimeoutException} is thrown when the registration
	 * cannot be performed at the JobManager by the JobAttachmentClientActor. This is here the case, because the
	 * started JobManager never replies to a {@link RegisterJobClient} message.
	 */
Tests that a  JobClientActorRegistrationTimeoutException is thrown when the registration
cannot be performed at the JobManager by the JobAttachmentClientActor. This is here the case, because the
started JobManager never replies to a  RegisterJobClient message.
Tests that a JobClientActorRegistrationTimeoutException is thrown when the registration cannot be performed at the JobManager by the JobAttachmentClientActor . This is here the case because the started JobManager never replies to a RegisterJobClient message .
@Test(expected=JobClientActorRegistrationTimeoutException.class)
	public void testRegistrationTimeout() throws Exception {
		FiniteDuration jobClientActorTimeout = new FiniteDuration(1L, TimeUnit.SECONDS);
		FiniteDuration timeout = jobClientActorTimeout.$times(2);
		UUID leaderSessionID = UUID.randomUUID();
		ActorRef jobManager = system.actorOf(
			Props.create(
				PlainActor.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 JobClientMessages.AttachToJobAndWait(testJobGraph.getJobID()),
			new Timeout(timeout));
		Await.result(jobExecutionResult, timeout);
	}
@ Test ( expected = JobClientActorRegistrationTimeoutException . class ) public void testRegistrationTimeout ( ) throws Exception { FiniteDuration jobClientActorTimeout = new FiniteDuration ( 1L , TimeUnit . SECONDS ) ; FiniteDuration timeout = jobClientActorTimeout . $times ( 2 ) ; UUID leaderSessionID = UUID . randomUUID ( ) ; ActorRef jobManager = system . actorOf ( Props . create ( PlainActor . 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 JobClientMessages . AttachToJobAndWait ( testJobGraph . getJobID ( ) ) , new Timeout ( timeout ) ) ; Await . result ( jobExecutionResult , timeout ) ; }
Tests that a {@link JobClientActorRegistrationTimeoutException} is thrown when the registration
 cannot be performed at the JobManager by the JobAttachmentClientActor.
Tests that a { @link JobClientActorRegistrationTimeoutException } is thrown when the registration cannot be performed at the JobManager by the JobAttachmentClientActor .