flink-instrumentation/workspace/flink-1.4.1-instrumented/flink-1.4.1/flink-clients/src/test/java/org/apache/flink/client/CliFrontendSavepointTest.java
/**
	 * Tests disposal with a JAR file.
	 */
Tests disposal with a JAR file.
Tests disposal with a JAR file .
@Test
	public void testDisposeWithJar() throws Exception {
		replaceStdOutAndStdErr();
		try {
			ActorGateway jobManager = mock(ActorGateway.class);
			when(jobManager.ask(any(DisposeSavepoint.class), any(FiniteDuration.class)))
					.thenReturn(Futures.successful(JobManagerMessages.getDisposeSavepointSuccess()));
			CliFrontend frontend = new MockCliFrontend(CliFrontendTestUtils.getConfigDir(), jobManager);
			File f = tmp.newFile();
			ZipOutputStream out = new ZipOutputStream(new FileOutputStream(f));
			out.close();
			String[] parameters = { "-d", "any-path", "-j", f.getAbsolutePath() };
			int returnCode = frontend.savepoint(parameters);
			assertEquals(0, returnCode);
		} finally {
			restoreStdOutAndStdErr();
		}
	}
@ Test public void testDisposeWithJar ( ) throws Exception { replaceStdOutAndStdErr ( ) ; try { ActorGateway jobManager = mock ( ActorGateway . class ) ; when ( jobManager . ask ( any ( DisposeSavepoint . class ) , any ( FiniteDuration . class ) ) ) . thenReturn ( Futures . successful ( JobManagerMessages . getDisposeSavepointSuccess ( ) ) ) ; CliFrontend frontend = new MockCliFrontend ( CliFrontendTestUtils . getConfigDir ( ) , jobManager ) ; File f = tmp . newFile ( ) ; ZipOutputStream out = new ZipOutputStream ( new FileOutputStream ( f ) ) ; out . close ( ) ; String [ ] parameters = { "-d" , "any-path" , "-j" , f . getAbsolutePath ( ) } ; int returnCode = frontend . savepoint ( parameters ) ; assertEquals ( 0 , returnCode ) ; } finally { restoreStdOutAndStdErr ( ) ; } }
Tests disposal with a JAR file.
Tests disposal with a JAR file .
// Fake JAR file