Skip to content

Commit

Permalink
[hotfix][test] Clean up unnecessary type argument declarations in Cla…
Browse files Browse the repository at this point in the history
…ssLoaderITCase
  • Loading branch information
sunhaibotb authored and zentol committed Oct 2, 2019
1 parent c552f74 commit 2a182ff
Showing 1 changed file with 23 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,28 +142,28 @@ public void tearDown() {
}

@Test
public void testCustomSplitJobWithCustomClassLoaderJar() throws IOException, ProgramInvocationException {
public void testCustomSplitJobWithCustomClassLoaderJar() throws ProgramInvocationException {

PackagedProgram inputSplitTestProg = new PackagedProgram(new File(INPUT_SPLITS_PROG_JAR_FILE));

TestEnvironment.setAsContext(
miniClusterResource.getMiniCluster(),
parallelism,
Collections.singleton(new Path(INPUT_SPLITS_PROG_JAR_FILE)),
Collections.<URL>emptyList());
Collections.emptyList());

inputSplitTestProg.invokeInteractiveModeForExecution();
}

@Test
public void testStreamingCustomSplitJobWithCustomClassLoader() throws IOException, ProgramInvocationException {
public void testStreamingCustomSplitJobWithCustomClassLoader() throws ProgramInvocationException {
PackagedProgram streamingInputSplitTestProg = new PackagedProgram(new File(STREAMING_INPUT_SPLITS_PROG_JAR_FILE));

TestStreamEnvironment.setAsContext(
miniClusterResource.getMiniCluster(),
parallelism,
Collections.singleton(new Path(STREAMING_INPUT_SPLITS_PROG_JAR_FILE)),
Collections.<URL>emptyList());
Collections.emptyList());

streamingInputSplitTestProg.invokeInteractiveModeForExecution();
}
Expand All @@ -176,28 +176,28 @@ public void testCustomSplitJobWithCustomClassLoaderPath() throws IOException, Pr
TestEnvironment.setAsContext(
miniClusterResource.getMiniCluster(),
parallelism,
Collections.<Path>emptyList(),
Collections.emptyList(),
Collections.singleton(classpath));

inputSplitTestProg2.invokeInteractiveModeForExecution();
}

@Test
public void testStreamingClassloaderJobWithCustomClassLoader() throws IOException, ProgramInvocationException {
public void testStreamingClassloaderJobWithCustomClassLoader() throws ProgramInvocationException {
// regular streaming job
PackagedProgram streamingProg = new PackagedProgram(new File(STREAMING_PROG_JAR_FILE));

TestStreamEnvironment.setAsContext(
miniClusterResource.getMiniCluster(),
parallelism,
Collections.singleton(new Path(STREAMING_PROG_JAR_FILE)),
Collections.<URL>emptyList());
Collections.emptyList());

streamingProg.invokeInteractiveModeForExecution();
}

@Test
public void testCheckpointedStreamingClassloaderJobWithCustomClassLoader() throws IOException, ProgramInvocationException {
public void testCheckpointedStreamingClassloaderJobWithCustomClassLoader() throws ProgramInvocationException {
// checkpointed streaming job with custom classes for the checkpoint (FLINK-2543)
// the test also ensures that user specific exceptions are serializable between JobManager <--> JobClient.
PackagedProgram streamingCheckpointedProg = new PackagedProgram(new File(STREAMING_CHECKPOINTED_PROG_JAR_FILE));
Expand All @@ -206,7 +206,7 @@ public void testCheckpointedStreamingClassloaderJobWithCustomClassLoader() throw
miniClusterResource.getMiniCluster(),
parallelism,
Collections.singleton(new Path(STREAMING_CHECKPOINTED_PROG_JAR_FILE)),
Collections.<URL>emptyList());
Collections.emptyList());

try {
streamingCheckpointedProg.invokeInteractiveModeForExecution();
Expand All @@ -233,7 +233,7 @@ public void testCheckpointedStreamingClassloaderJobWithCustomClassLoader() throw
}

@Test
public void testKMeansJobWithCustomClassLoader() throws IOException, ProgramInvocationException {
public void testKMeansJobWithCustomClassLoader() throws ProgramInvocationException {
PackagedProgram kMeansProg = new PackagedProgram(
new File(KMEANS_JAR_PATH),
new String[] {
Expand All @@ -246,20 +246,20 @@ public void testKMeansJobWithCustomClassLoader() throws IOException, ProgramInvo
miniClusterResource.getMiniCluster(),
parallelism,
Collections.singleton(new Path(KMEANS_JAR_PATH)),
Collections.<URL>emptyList());
Collections.emptyList());

kMeansProg.invokeInteractiveModeForExecution();
}

@Test
public void testUserCodeTypeJobWithCustomClassLoader() throws IOException, ProgramInvocationException {
public void testUserCodeTypeJobWithCustomClassLoader() throws ProgramInvocationException {
PackagedProgram userCodeTypeProg = new PackagedProgram(new File(USERCODETYPE_JAR_PATH));

TestEnvironment.setAsContext(
miniClusterResource.getMiniCluster(),
parallelism,
Collections.singleton(new Path(USERCODETYPE_JAR_PATH)),
Collections.<URL>emptyList());
Collections.emptyList());

userCodeTypeProg.invokeInteractiveModeForExecution();
}
Expand All @@ -280,10 +280,10 @@ public void testCheckpointingCustomKvStateJobWithCustomClassLoader() throws IOEx
miniClusterResource.getMiniCluster(),
parallelism,
Collections.singleton(new Path(CHECKPOINTING_CUSTOM_KV_STATE_JAR_PATH)),
Collections.<URL>emptyList());
Collections.emptyList());

expectedException.expectCause(
Matchers.<Throwable>hasProperty("cause", isA(SuccessException.class)));
Matchers.hasProperty("cause", isA(SuccessException.class)));

program.invokeInteractiveModeForExecution();
}
Expand Down Expand Up @@ -313,20 +313,17 @@ public void testDisposeSavepointWithCustomKvState() throws Exception {
miniClusterResource.getMiniCluster(),
parallelism,
Collections.singleton(new Path(CUSTOM_KV_STATE_JAR_PATH)),
Collections.<URL>emptyList()
Collections.emptyList()
);

// Execute detached
Thread invokeThread = new Thread(new Runnable() {
@Override
public void run() {
try {
program.invokeInteractiveModeForExecution();
} catch (ProgramInvocationException ignored) {
if (ignored.getCause() == null ||
!(ignored.getCause() instanceof JobCancellationException)) {
ignored.printStackTrace();
}
Thread invokeThread = new Thread(() -> {
try {
program.invokeInteractiveModeForExecution();
} catch (ProgramInvocationException ex) {
if (ex.getCause() == null ||
!(ex.getCause() instanceof JobCancellationException)) {
ex.printStackTrace();
}
}
});
Expand Down

0 comments on commit 2a182ff

Please sign in to comment.