Client { public void run(PactProgram prog) throws CompilerException, ProgramInvocationException, ErrorInPlanAssemblerException { run(prog, false); } Client(InetSocketAddress jobManagerAddress);  Client(Configuration nepheleConfig); OptimizedPlan getOptimizedPlan(PactProgram prog); String getJSONPlan(PactProgram prog); JobGraph getJobGraph(PactProgram prog, OptimizedPlan optPlan); void run(PactProgram prog); void run(PactProgram prog, boolean wait); void run(PactProgram prog, OptimizedPlan compiledPlan); void run(PactProgram prog, OptimizedPlan compiledPlan, boolean wait); void run(PactProgram program, JobGraph jobGraph); void run(PactProgram program, JobGraph jobGraph, boolean wait);  }
@Test public void shouldSubmitToJobClient() throws ProgramInvocationException, ErrorInPlanAssemblerException, IOException { when(jobSubmissionResultMock.getReturnCode()).thenReturn(ReturnCode.SUCCESS); Client out = new Client(configMock); out.run(program); verify(this.compilerMock, times(1)).compile(planMock); verify(this.generatorMock, times(1)).compileJobGraph(optimizedPlanMock); verify(this.jobClientMock, times(1)).submitJob(); }
@Test(expected=ProgramInvocationException.class) public void shouldThrowException() throws Exception { when(jobSubmissionResultMock.getReturnCode()).thenReturn(ReturnCode.ERROR); Client out = new Client(configMock); out.run(program); verify(this.jobClientMock).submitJob(); }