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 JobClientActorSubmissionTimeoutException} is thrown when the job cannot
	 * be submitted by the JobSubmissionClientActor. This is here the case, because the started JobManager
	 * never replies to a {@link SubmitJob} message.
	 *
	 * @throws Exception
	 */
Tests that a  JobClientActorSubmissionTimeoutException is thrown when the job cannot
be submitted by the JobSubmissionClientActor. This is here the case, because the started JobManager
never replies to a  SubmitJob message.

@throws Exception
Tests that a JobClientActorSubmissionTimeoutException is thrown when the job cannot be submitted by the JobSubmissionClientActor . This is here the case because the started JobManager never replies to a SubmitJob message . @throws Exception
@Test(expected=JobClientActorSubmissionTimeoutException.class)
	public void testSubmissionTimeout() 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 = JobSubmissionClientActor.createActorProps(
			testingLeaderRetrievalService,
			jobClientActorTimeout,
			false,
			clientConfig);
		ActorRef jobClientActor = system.actorOf(jobClientActorProps);
		Future<Object> jobExecutionResult = Patterns.ask(
			jobClientActor,
			new JobClientMessages.SubmitJobAndWait(testJobGraph),
			new Timeout(timeout));
		Await.result(jobExecutionResult, timeout);
	}
@ Test ( expected = JobClientActorSubmissionTimeoutException . class ) public void testSubmissionTimeout ( ) 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 = JobSubmissionClientActor . createActorProps ( testingLeaderRetrievalService , jobClientActorTimeout , false , clientConfig ) ; ActorRef jobClientActor = system . actorOf ( jobClientActorProps ) ; Future < Object > jobExecutionResult = Patterns . ask ( jobClientActor , new JobClientMessages . SubmitJobAndWait ( testJobGraph ) , new Timeout ( timeout ) ) ; Await . result ( jobExecutionResult , timeout ) ; }
Tests that a {@link JobClientActorSubmissionTimeoutException} is thrown when the job cannot
 be submitted by the JobSubmissionClientActor.
Tests that a { @link JobClientActorSubmissionTimeoutException } is thrown when the job cannot be submitted by the JobSubmissionClientActor .