Skip to content

Commit

Permalink
[FLINK-27467][cli][tests] Drop CliFrontendTestBase
Browse files Browse the repository at this point in the history
  • Loading branch information
zentol committed May 2, 2022
1 parent d1dcc94 commit f64e371
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 38 deletions.
Expand Up @@ -25,6 +25,7 @@
import org.apache.flink.core.execution.SavepointFormatType;
import org.apache.flink.core.testutils.OneShotLatch;
import org.apache.flink.runtime.messages.Acknowledge;
import org.apache.flink.util.TestLogger;

import org.junit.AfterClass;
import org.junit.BeforeClass;
Expand All @@ -33,13 +34,14 @@
import java.util.Collections;
import java.util.concurrent.CompletableFuture;

import static org.apache.flink.client.cli.CliFrontendTestUtils.getCli;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;

/** Tests for the CANCEL command. */
public class CliFrontendCancelTest extends CliFrontendTestBase {
public class CliFrontendCancelTest extends TestLogger {

@BeforeClass
public static void init() {
Expand Down
Expand Up @@ -23,6 +23,7 @@
import org.apache.flink.configuration.CoreOptions;
import org.apache.flink.runtime.execution.librarycache.FlinkUserCodeClassLoaders.ParentFirstClassLoader;
import org.apache.flink.util.ChildFirstClassLoader;
import org.apache.flink.util.TestLogger;

import org.apache.commons.cli.Options;
import org.junit.AfterClass;
Expand All @@ -39,7 +40,7 @@
import static org.junit.Assert.assertEquals;

/** Tests for the RUN command with Dynamic Properties. */
public class CliFrontendDynamicPropertiesTest extends CliFrontendTestBase {
public class CliFrontendDynamicPropertiesTest extends TestLogger {

private GenericCLI cliUnderTest;
private Configuration configuration;
Expand Down
Expand Up @@ -20,18 +20,20 @@

import org.apache.flink.configuration.Configuration;
import org.apache.flink.configuration.CoreOptions;
import org.apache.flink.util.TestLogger;

import org.junit.Test;

import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.util.Collections;

import static org.apache.flink.client.cli.CliFrontendTestUtils.getCli;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

/** Tests for the "info" command. */
public class CliFrontendInfoTest extends CliFrontendTestBase {
public class CliFrontendInfoTest extends TestLogger {

private static PrintStream stdOut;
private static PrintStream capture;
Expand Down
Expand Up @@ -24,6 +24,7 @@
import org.apache.flink.client.program.ClusterClient;
import org.apache.flink.configuration.Configuration;
import org.apache.flink.runtime.client.JobStatusMessage;
import org.apache.flink.util.TestLogger;

import org.junit.AfterClass;
import org.junit.BeforeClass;
Expand All @@ -34,14 +35,15 @@
import java.util.Collections;
import java.util.concurrent.CompletableFuture;

import static org.apache.flink.client.cli.CliFrontendTestUtils.getCli;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.when;

/** Tests for the LIST command. */
public class CliFrontendListTest extends CliFrontendTestBase {
public class CliFrontendListTest extends TestLogger {

@BeforeClass
public static void init() {
Expand Down
Expand Up @@ -25,6 +25,7 @@
import org.apache.flink.configuration.CoreOptions;
import org.apache.flink.runtime.jobgraph.RestoreMode;
import org.apache.flink.runtime.jobgraph.SavepointRestoreSettings;
import org.apache.flink.util.TestLogger;

import org.apache.commons.cli.CommandLine;
import org.junit.AfterClass;
Expand All @@ -33,13 +34,14 @@

import java.util.Collections;

import static org.apache.flink.client.cli.CliFrontendTestUtils.getCli;
import static org.apache.flink.client.cli.CliFrontendTestUtils.getTestJarPath;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

/** Tests for the RUN command. */
public class CliFrontendRunTest extends CliFrontendTestBase {
public class CliFrontendRunTest extends TestLogger {

@BeforeClass
public static void init() {
Expand Down
Expand Up @@ -30,6 +30,7 @@
import org.apache.flink.util.ExceptionUtils;
import org.apache.flink.util.FlinkException;
import org.apache.flink.util.Preconditions;
import org.apache.flink.util.TestLogger;
import org.apache.flink.util.concurrent.FutureUtils;

import org.hamcrest.Matchers;
Expand Down Expand Up @@ -59,7 +60,7 @@
import static org.mockito.Mockito.when;

/** Tests for the SAVEPOINT command. */
public class CliFrontendSavepointTest extends CliFrontendTestBase {
public class CliFrontendSavepointTest extends TestLogger {

private static PrintStream stdOut;
private static PrintStream stdErr;
Expand Down
Expand Up @@ -26,6 +26,7 @@
import org.apache.flink.core.testutils.OneShotLatch;
import org.apache.flink.util.ExceptionUtils;
import org.apache.flink.util.FlinkException;
import org.apache.flink.util.TestLogger;
import org.apache.flink.util.concurrent.FutureUtils;

import org.junit.AfterClass;
Expand All @@ -35,14 +36,15 @@
import java.util.Collections;
import java.util.concurrent.CompletableFuture;

import static org.apache.flink.client.cli.CliFrontendTestUtils.getCli;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

/** Tests for the STOP command. */
public class CliFrontendStopWithSavepointTest extends CliFrontendTestBase {
public class CliFrontendStopWithSavepointTest extends TestLogger {

@BeforeClass
public static void setup() {
Expand Down

This file was deleted.

Expand Up @@ -64,6 +64,10 @@ public static void restoreSystemOut() {
System.setOut(previousSysout);
}

public static AbstractCustomCommandLine getCli() {
return new DefaultCLI();
}

private static final class BlackholeOutputSteam extends java.io.OutputStream {
@Override
public void write(int b) {}
Expand Down
Expand Up @@ -19,14 +19,14 @@
package org.apache.flink.yarn;

import org.apache.flink.client.cli.CliFrontend;
import org.apache.flink.client.cli.CliFrontendTestBase;
import org.apache.flink.client.cli.CliFrontendTestUtils;
import org.apache.flink.client.deployment.ClusterClientServiceLoader;
import org.apache.flink.client.deployment.DefaultClusterClientServiceLoader;
import org.apache.flink.configuration.Configuration;
import org.apache.flink.configuration.JobManagerOptions;
import org.apache.flink.configuration.MemorySize;
import org.apache.flink.configuration.TaskManagerOptions;
import org.apache.flink.util.TestLogger;
import org.apache.flink.yarn.cli.FlinkYarnSessionCli;

import org.junit.AfterClass;
Expand All @@ -43,7 +43,7 @@
*
* @see org.apache.flink.client.cli.CliFrontendRunTest
*/
public class CliFrontendRunWithYarnTest extends CliFrontendTestBase {
public class CliFrontendRunWithYarnTest extends TestLogger {

@Rule public TemporaryFolder tmp = new TemporaryFolder();

Expand Down

0 comments on commit f64e371

Please sign in to comment.