flink-clients/src/test/java/org/apache/flink/client/CliFrontendSavepointTest.java
/**
	 * Tests that a disposal failure due a  ClassNotFoundException triggers a
	 * note about the JAR option.
	 */
Tests that a disposal failure due a  ClassNotFoundException triggers a
note about the JAR option.
Tests that a disposal failure due a ClassNotFoundException triggers a note about the JAR option .
@Test
	public void testDisposeClassNotFoundException() throws Exception {
		replaceStdOutAndStdErr();
		try {
			Future<Object> classNotFoundFailure = Futures
					.<Object>successful(new DisposeSavepointFailure(new ClassNotFoundException("Test exception")));
			ActorGateway jobManager = mock(ActorGateway.class);
			when(jobManager.ask(any(DisposeSavepoint.class), any(FiniteDuration.class)))
					.thenReturn(classNotFoundFailure);
			CliFrontend frontend = new MockCliFrontend(CliFrontendTestUtils.getConfigDir(), jobManager);
			String[] parameters = { "-d", "any-path" };
			int returnCode = frontend.savepoint(parameters);
			assertTrue(returnCode != 0);
			String out = buffer.toString();
			assertTrue(out.contains("Please provide the program jar with which you have created " +
					"the savepoint via -j <JAR> for disposal"));
		} finally {
			restoreStdOutAndStdErr();
		}
	}
@ Test public void testDisposeClassNotFoundException ( ) throws Exception { replaceStdOutAndStdErr ( ) ; try { Future < Object > classNotFoundFailure = Futures . < Object > successful ( new DisposeSavepointFailure ( new ClassNotFoundException ( "Test exception" ) ) ) ; ActorGateway jobManager = mock ( ActorGateway . class ) ; when ( jobManager . ask ( any ( DisposeSavepoint . class ) , any ( FiniteDuration . class ) ) ) . thenReturn ( classNotFoundFailure ) ; CliFrontend frontend = new MockCliFrontend ( CliFrontendTestUtils . getConfigDir ( ) , jobManager ) ; String [ ] parameters = { "-d" , "any-path" } ; int returnCode = frontend . savepoint ( parameters ) ; assertTrue ( returnCode != 0 ) ; String out = buffer . toString ( ) ; assertTrue ( out . contains ( "Please provide the program jar with which you have created " + "the savepoint via -j <JAR> for disposal" ) ) ; } finally { restoreStdOutAndStdErr ( ) ; } }
Tests that a disposal failure due a  ClassNotFoundException triggers a
 note about the JAR option.
Tests that a disposal failure due a ClassNotFoundException triggers a note about the JAR option .