Skip to content

Commit

Permalink
[FLINK-11903][tests] Improve FileStateBackendTest by using JUnit's pa…
Browse files Browse the repository at this point in the history
…rameterized

This closes apache#7973.
  • Loading branch information
klion26 authored and StefanRRichter committed Mar 14, 2019
1 parent 6c7ddf3 commit 76b9f8b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 32 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,35 @@
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;

import java.io.File;
import java.util.Arrays;
import java.util.List;

/**
* Tests for the keyed state backend and operator state backend, as created by the
* {@link FsStateBackend}.
*/
@RunWith(Parameterized.class)
public class FileStateBackendTest extends StateBackendTestBase<FsStateBackend> {

@Parameterized.Parameters
public static List<Boolean> modes() {
return Arrays.asList(true, false);
}

@Parameterized.Parameter
public boolean useAsyncMode;

@Rule
public final TemporaryFolder tempFolder = new TemporaryFolder();

@Override
protected FsStateBackend getStateBackend() throws Exception {
File checkpointPath = tempFolder.newFolder();
return new FsStateBackend(checkpointPath.toURI(), useAsyncMode());
}

protected boolean useAsyncMode() {
return false;
return new FsStateBackend(checkpointPath.toURI(), useAsyncMode);
}

@Override
Expand Down

0 comments on commit 76b9f8b

Please sign in to comment.