Skip to content

Commit

Permalink
fixup! [FLINK-8333] [flip6] Separate deployment options from command …
Browse files Browse the repository at this point in the history
…options
  • Loading branch information
tillrohrmann committed Jan 11, 2018
1 parent 27e367c commit 1806e04
Showing 1 changed file with 16 additions and 9 deletions.
Expand Up @@ -27,9 +27,11 @@
import org.apache.flink.runtime.concurrent.FutureUtils;
import org.apache.flink.runtime.highavailability.TestingHighAvailabilityServices;
import org.apache.flink.runtime.messages.Acknowledge;
import org.apache.flink.util.ExceptionUtils;
import org.apache.flink.util.Preconditions;
import org.apache.flink.util.TestLogger;

import org.hamcrest.Matchers;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
Expand All @@ -44,7 +46,9 @@

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyString;
import static org.mockito.Matchers.eq;
Expand Down Expand Up @@ -114,14 +118,14 @@ public void testTriggerSavepointFailure() throws Exception {

String[] parameters = { jobId.toString() };

int returnCode = frontend.savepoint(parameters);

assertNotEquals(0, returnCode);

assertTrue(buffer.toString().contains(expectedTestException));
try {
frontend.savepoint(parameters);
fail("This should have failed.");
} catch (Exception e) {
assertTrue(ExceptionUtils.findThrowableWithMessage(e, expectedTestException).isPresent());
}
}
finally {

clusterClient.shutdown();
restoreStdOutAndStdErr();
}
Expand All @@ -137,10 +141,13 @@ public void testTriggerSavepointFailureIllegalJobID() throws Exception {
new TestingHighAvailabilityServices()));

String[] parameters = { "invalid job id" };
int returnCode = frontend.savepoint(parameters);

assertTrue(buffer.toString().contains("not a valid ID"));
assertNotEquals(0, returnCode);
try {
frontend.savepoint(parameters);
fail("Should have failed.");
} catch (CliArgsException e) {
assertThat(e.getMessage(), Matchers.containsString("Cannot parse JobID"));
}
}
finally {
restoreStdOutAndStdErr();
Expand Down

0 comments on commit 1806e04

Please sign in to comment.