This is an automated email from the ASF dual-hosted git repository. srichter pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/flink.git
The following commit(s) were added to refs/heads/master by this push: new 76b9f8b [FLINK-11903][tests] Improve FileStateBackendTest by using JUnit's parameterized 76b9f8b is described below commit 76b9f8b5a4a2e0384850ec1cfb3dfa7607189933 Author: Congxian Qiu <qcx978132...@gmail.com> AuthorDate: Thu Mar 14 19:12:04 2019 +0800 [FLINK-11903][tests] Improve FileStateBackendTest by using JUnit's parameterized This closes #7973. --- .../runtime/state/AsyncFileStateBackendTest.java | 27 ---------------------- .../flink/runtime/state/FileStateBackendTest.java | 19 +++++++++++---- 2 files changed, 14 insertions(+), 32 deletions(-) diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/state/AsyncFileStateBackendTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/state/AsyncFileStateBackendTest.java deleted file mode 100644 index dd73e42..0000000 --- a/flink-runtime/src/test/java/org/apache/flink/runtime/state/AsyncFileStateBackendTest.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.flink.runtime.state; - -public class AsyncFileStateBackendTest extends FileStateBackendTest { - - @Override - protected boolean useAsyncMode() { - return true; - } -} \ No newline at end of file diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/state/FileStateBackendTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/state/FileStateBackendTest.java index beea0c2..8b03745 100644 --- a/flink-runtime/src/test/java/org/apache/flink/runtime/state/FileStateBackendTest.java +++ b/flink-runtime/src/test/java/org/apache/flink/runtime/state/FileStateBackendTest.java @@ -24,26 +24,35 @@ import org.junit.Ignore; 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