You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by tr...@apache.org on 2018/03/19 15:53:39 UTC

[2/2] flink git commit: [FLINK-8906][flip6][tests] also test Flip6DefaultCLI in org.apache.flink.client.cli tests

[FLINK-8906][flip6][tests] also test Flip6DefaultCLI in org.apache.flink.client.cli tests

This closes #5671.


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/463b922a
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/463b922a
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/463b922a

Branch: refs/heads/master
Commit: 463b922abebc77420d0ec990ba18ad83ea33c0e4
Parents: 52475b3
Author: Nico Kruber <ni...@data-artisans.com>
Authored: Thu Mar 8 11:07:08 2018 +0100
Committer: Till Rohrmann <tr...@apache.org>
Committed: Sun Mar 18 19:12:02 2018 +0100

----------------------------------------------------------------------
 .../flink/client/cli/CliFrontendCancelTest.java | 19 +++---
 .../flink/client/cli/CliFrontendInfoTest.java   | 19 +++---
 .../flink/client/cli/CliFrontendListTest.java   |  7 +--
 .../flink/client/cli/CliFrontendModifyTest.java | 10 ++--
 .../flink/client/cli/CliFrontendRunTest.java    | 50 +++++++++-------
 .../client/cli/CliFrontendSavepointTest.java    | 15 +++--
 .../flink/client/cli/CliFrontendStopTest.java   | 11 ++--
 .../flink/client/cli/CliFrontendTestBase.java   | 61 ++++++++++++++++++++
 .../apache/flink/client/cli/DefaultCLITest.java | 24 +++++---
 9 files changed, 144 insertions(+), 72 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/463b922a/flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendCancelTest.java
----------------------------------------------------------------------
diff --git a/flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendCancelTest.java b/flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendCancelTest.java
index 837c564..638150a 100644
--- a/flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendCancelTest.java
+++ b/flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendCancelTest.java
@@ -22,7 +22,6 @@ import org.apache.flink.api.common.JobID;
 import org.apache.flink.client.cli.util.MockedCliFrontend;
 import org.apache.flink.client.program.ClusterClient;
 import org.apache.flink.configuration.Configuration;
-import org.apache.flink.util.TestLogger;
 
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
@@ -40,7 +39,7 @@ import static org.mockito.Mockito.times;
 /**
  * Tests for the CANCEL command.
  */
-public class CliFrontendCancelTest extends TestLogger {
+public class CliFrontendCancelTest extends CliFrontendTestBase {
 
 	@BeforeClass
 	public static void init() {
@@ -69,20 +68,20 @@ public class CliFrontendCancelTest extends TestLogger {
 	@Test(expected = CliArgsException.class)
 	public void testMissingJobId() throws Exception {
 		String[] parameters = {};
-		Configuration configuration = new Configuration();
+		Configuration configuration = getConfiguration();
 		CliFrontend testFrontend = new CliFrontend(
 			configuration,
-			Collections.singletonList(new DefaultCLI(configuration)));
+			Collections.singletonList(getCli(configuration)));
 		testFrontend.cancel(parameters);
 	}
 
 	@Test(expected = CliArgsException.class)
 	public void testUnrecognizedOption() throws Exception {
 		String[] parameters = {"-v", "-l"};
-		Configuration configuration = new Configuration();
+		Configuration configuration = getConfiguration();
 		CliFrontend testFrontend = new CliFrontend(
 			configuration,
-			Collections.singletonList(new DefaultCLI(configuration)));
+			Collections.singletonList(getCli(configuration)));
 		testFrontend.cancel(parameters);
 	}
 
@@ -122,10 +121,10 @@ public class CliFrontendCancelTest extends TestLogger {
 	public void testCancelWithSavepointWithoutJobId() throws Exception {
 		// Cancel with savepoint (with target directory), but no job ID
 		String[] parameters = { "-s", "targetDirectory" };
-		Configuration configuration = new Configuration();
+		Configuration configuration = getConfiguration();
 		CliFrontend testFrontend = new CliFrontend(
 			configuration,
-			Collections.singletonList(new DefaultCLI(configuration)));
+			Collections.singletonList(getCli(configuration)));
 		testFrontend.cancel(parameters);
 	}
 
@@ -133,10 +132,10 @@ public class CliFrontendCancelTest extends TestLogger {
 	public void testCancelWithSavepointWithoutParameters() throws Exception {
 		// Cancel with savepoint (no target directory) and no job ID
 		String[] parameters = { "-s" };
-		Configuration configuration = new Configuration();
+		Configuration configuration = getConfiguration();
 		CliFrontend testFrontend = new CliFrontend(
 			configuration,
-			Collections.singletonList(new DefaultCLI(configuration)));
+			Collections.singletonList(getCli(configuration)));
 		testFrontend.cancel(parameters);
 	}
 

http://git-wip-us.apache.org/repos/asf/flink/blob/463b922a/flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendInfoTest.java
----------------------------------------------------------------------
diff --git a/flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendInfoTest.java b/flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendInfoTest.java
index c284c61..47c799e 100644
--- a/flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendInfoTest.java
+++ b/flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendInfoTest.java
@@ -19,7 +19,6 @@
 package org.apache.flink.client.cli;
 
 import org.apache.flink.configuration.Configuration;
-import org.apache.flink.util.TestLogger;
 
 import org.junit.Test;
 
@@ -33,7 +32,7 @@ import static org.junit.Assert.fail;
 /**
  * Tests for the "info" command.
  */
-public class CliFrontendInfoTest extends TestLogger {
+public class CliFrontendInfoTest extends CliFrontendTestBase {
 
 	private static PrintStream stdOut;
 	private static PrintStream capture;
@@ -42,20 +41,20 @@ public class CliFrontendInfoTest extends TestLogger {
 	@Test(expected = CliArgsException.class)
 	public void testMissingOption() throws Exception {
 		String[] parameters = {};
-		Configuration configuration = new Configuration();
+		Configuration configuration = getConfiguration();
 		CliFrontend testFrontend = new CliFrontend(
 			configuration,
-			Collections.singletonList(new DefaultCLI(configuration)));
+			Collections.singletonList(getCli(configuration)));
 		testFrontend.cancel(parameters);
 	}
 
 	@Test(expected = CliArgsException.class)
 	public void testUnrecognizedOption() throws Exception {
 		String[] parameters = {"-v", "-l"};
-		Configuration configuration = new Configuration();
+		Configuration configuration = getConfiguration();
 		CliFrontend testFrontend = new CliFrontend(
 			configuration,
-			Collections.singletonList(new DefaultCLI(configuration)));
+			Collections.singletonList(getCli(configuration)));
 		testFrontend.cancel(parameters);
 	}
 
@@ -65,10 +64,10 @@ public class CliFrontendInfoTest extends TestLogger {
 		try {
 
 			String[] parameters = new String[]{CliFrontendTestUtils.getTestJarPath(), "-f", "true"};
-			Configuration configuration = new Configuration();
+			Configuration configuration = getConfiguration();
 			CliFrontend testFrontend = new CliFrontend(
 				configuration,
-				Collections.singletonList(new DefaultCLI(configuration)));
+				Collections.singletonList(getCli(configuration)));
 			testFrontend.info(parameters);
 			assertTrue(buffer.toString().contains("\"parallelism\": \"1\""));
 		}
@@ -82,10 +81,10 @@ public class CliFrontendInfoTest extends TestLogger {
 		replaceStdOut();
 		try {
 			String[] parameters = {"-p", "17", CliFrontendTestUtils.getTestJarPath()};
-			Configuration configuration = new Configuration();
+			Configuration configuration = getConfiguration();
 			CliFrontend testFrontend = new CliFrontend(
 				configuration,
-				Collections.singletonList(new DefaultCLI(configuration)));
+				Collections.singletonList(getCli(configuration)));
 			testFrontend.info(parameters);
 			assertTrue(buffer.toString().contains("\"parallelism\": \"17\""));
 		}

http://git-wip-us.apache.org/repos/asf/flink/blob/463b922a/flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendListTest.java
----------------------------------------------------------------------
diff --git a/flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendListTest.java b/flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendListTest.java
index 42399cb..a8a7f00 100644
--- a/flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendListTest.java
+++ b/flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendListTest.java
@@ -21,7 +21,6 @@ package org.apache.flink.client.cli;
 import org.apache.flink.client.cli.util.MockedCliFrontend;
 import org.apache.flink.client.program.ClusterClient;
 import org.apache.flink.configuration.Configuration;
-import org.apache.flink.util.TestLogger;
 
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
@@ -38,7 +37,7 @@ import static org.mockito.Mockito.when;
 /**
  * Tests for the LIST command.
  */
-public class CliFrontendListTest extends TestLogger {
+public class CliFrontendListTest extends CliFrontendTestBase {
 
 	@BeforeClass
 	public static void init() {
@@ -66,10 +65,10 @@ public class CliFrontendListTest extends TestLogger {
 	@Test(expected = CliArgsException.class)
 	public void testUnrecognizedOption() throws Exception {
 		String[] parameters = {"-v", "-k"};
-		Configuration configuration = new Configuration();
+		Configuration configuration = getConfiguration();
 		CliFrontend testFrontend = new CliFrontend(
 			configuration,
-			Collections.singletonList(new DefaultCLI(configuration)));
+			Collections.singletonList(getCli(configuration)));
 		testFrontend.list(parameters);
 	}
 

http://git-wip-us.apache.org/repos/asf/flink/blob/463b922a/flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendModifyTest.java
----------------------------------------------------------------------
diff --git a/flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendModifyTest.java b/flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendModifyTest.java
index 00d5241..a2d6c48 100644
--- a/flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendModifyTest.java
+++ b/flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendModifyTest.java
@@ -25,7 +25,6 @@ import org.apache.flink.client.program.StandaloneClusterClient;
 import org.apache.flink.configuration.Configuration;
 import org.apache.flink.runtime.highavailability.TestingHighAvailabilityServices;
 import org.apache.flink.runtime.messages.Acknowledge;
-import org.apache.flink.util.TestLogger;
 
 import org.hamcrest.Matchers;
 import org.junit.Test;
@@ -38,7 +37,7 @@ import static org.junit.Assert.fail;
 /**
  * Tests for the modify command.
  */
-public class CliFrontendModifyTest extends TestLogger {
+public class CliFrontendModifyTest extends CliFrontendTestBase {
 
 	@Test
 	public void testModifyJob() throws Exception {
@@ -106,7 +105,7 @@ public class CliFrontendModifyTest extends TestLogger {
 
 	private Tuple2<JobID, Integer> callModify(String[] args) throws Exception {
 		final CompletableFuture<Tuple2<JobID, Integer>> rescaleJobFuture = new CompletableFuture<>();
-		final TestingClusterClient clusterClient = new TestingClusterClient(rescaleJobFuture);
+		final TestingClusterClient clusterClient = new TestingClusterClient(rescaleJobFuture, getConfiguration());
 		final MockedCliFrontend cliFrontend = new MockedCliFrontend(clusterClient);
 
 		cliFrontend.modify(args);
@@ -120,8 +119,9 @@ public class CliFrontendModifyTest extends TestLogger {
 
 		private final CompletableFuture<Tuple2<JobID, Integer>> rescaleJobFuture;
 
-		public TestingClusterClient(CompletableFuture<Tuple2<JobID, Integer>> rescaleJobFuture) throws Exception {
-			super(new Configuration(), new TestingHighAvailabilityServices(), false);
+		TestingClusterClient(
+			CompletableFuture<Tuple2<JobID, Integer>> rescaleJobFuture, Configuration configuration) {
+			super(configuration, new TestingHighAvailabilityServices(), false);
 
 			this.rescaleJobFuture = rescaleJobFuture;
 		}

http://git-wip-us.apache.org/repos/asf/flink/blob/463b922a/flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendRunTest.java
----------------------------------------------------------------------
diff --git a/flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendRunTest.java b/flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendRunTest.java
index c7789a8..efa6a39 100644
--- a/flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendRunTest.java
+++ b/flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendRunTest.java
@@ -21,9 +21,7 @@ package org.apache.flink.client.cli;
 import org.apache.flink.client.program.ClusterClient;
 import org.apache.flink.client.program.PackagedProgram;
 import org.apache.flink.configuration.Configuration;
-import org.apache.flink.configuration.GlobalConfiguration;
 import org.apache.flink.runtime.jobgraph.SavepointRestoreSettings;
-import org.apache.flink.util.TestLogger;
 
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
@@ -39,7 +37,7 @@ import static org.junit.Assert.assertTrue;
 /**
  * Tests for the RUN command.
  */
-public class CliFrontendRunTest extends TestLogger {
+public class CliFrontendRunTest extends CliFrontendTestBase {
 
 	@BeforeClass
 	public static void init() {
@@ -53,33 +51,29 @@ public class CliFrontendRunTest extends TestLogger {
 
 	@Test
 	public void testRun() throws Exception {
-		final Configuration configuration = GlobalConfiguration.loadConfiguration(CliFrontendTestUtils.getConfigDir());
+		final Configuration configuration = getConfiguration();
 		// test without parallelism
 		{
 			String[] parameters = {"-v", getTestJarPath()};
-			RunTestingCliFrontend testFrontend = new RunTestingCliFrontend(configuration, 1, true, false);
-			testFrontend.run(parameters);
+			verifyCliFrontend(getCli(configuration), parameters, 1, true, false);
 		}
 
 		// test configure parallelism
 		{
 			String[] parameters = {"-v", "-p", "42",  getTestJarPath()};
-			RunTestingCliFrontend testFrontend = new RunTestingCliFrontend(configuration, 42, true, false);
-			testFrontend.run(parameters);
+			verifyCliFrontend(getCli(configuration), parameters, 42, true, false);
 		}
 
 		// test configure sysout logging
 		{
 			String[] parameters = {"-p", "2", "-q", getTestJarPath()};
-			RunTestingCliFrontend testFrontend = new RunTestingCliFrontend(configuration, 2, false, false);
-			testFrontend.run(parameters);
+			verifyCliFrontend(getCli(configuration), parameters, 2, false, false);
 		}
 
 		// test detached mode
 		{
 			String[] parameters = {"-p", "2", "-d", getTestJarPath()};
-			RunTestingCliFrontend testFrontend = new RunTestingCliFrontend(configuration, 2, true, true);
-			testFrontend.run(parameters);
+			verifyCliFrontend(getCli(configuration), parameters, 2, true, true);
 		}
 
 		// test configure savepoint path (no ignore flag)
@@ -119,10 +113,10 @@ public class CliFrontendRunTest extends TestLogger {
 	public void testUnrecognizedOption() throws Exception {
 		// test unrecognized option
 		String[] parameters = {"-v", "-l", "-a", "some", "program", "arguments"};
-		Configuration configuration = new Configuration();
+		Configuration configuration = getConfiguration();
 		CliFrontend testFrontend = new CliFrontend(
 			configuration,
-			Collections.singletonList(new DefaultCLI(configuration)));
+			Collections.singletonList(getCli(configuration)));
 		testFrontend.run(parameters);
 	}
 
@@ -130,10 +124,10 @@ public class CliFrontendRunTest extends TestLogger {
 	public void testInvalidParallelismOption() throws Exception {
 		// test configure parallelism with non integer value
 		String[] parameters = {"-v", "-p", "text",  getTestJarPath()};
-		Configuration configuration = new Configuration();
+		Configuration configuration = getConfiguration();
 		CliFrontend testFrontend = new CliFrontend(
 			configuration,
-			Collections.singletonList(new DefaultCLI(configuration)));
+			Collections.singletonList(getCli(configuration)));
 		testFrontend.run(parameters);
 	}
 
@@ -144,22 +138,38 @@ public class CliFrontendRunTest extends TestLogger {
 		Configuration configuration = new Configuration();
 		CliFrontend testFrontend = new CliFrontend(
 			configuration,
-			Collections.singletonList(new DefaultCLI(configuration)));
+			Collections.singletonList(getCli(configuration)));
 		testFrontend.run(parameters);
 	}
 
 	// --------------------------------------------------------------------------------------------
 
+	private static void verifyCliFrontend(
+			AbstractCustomCommandLine<?> cli,
+			String[] parameters,
+			int expectedParallelism,
+			boolean logging,
+			boolean isDetached) throws Exception {
+		RunTestingCliFrontend testFrontend =
+			new RunTestingCliFrontend(cli, expectedParallelism, logging,
+				isDetached);
+		testFrontend.run(parameters); // verifies the expected values (see below)
+	}
+
 	private static final class RunTestingCliFrontend extends CliFrontend {
 
 		private final int expectedParallelism;
 		private final boolean sysoutLogging;
 		private final boolean isDetached;
 
-		public RunTestingCliFrontend(Configuration configuration, int expectedParallelism, boolean logging, boolean isDetached) throws Exception {
+		private RunTestingCliFrontend(
+				AbstractCustomCommandLine<?> cli,
+				int expectedParallelism,
+				boolean logging,
+				boolean isDetached) throws Exception {
 			super(
-				configuration,
-				Collections.singletonList(new DefaultCLI(configuration)));
+				cli.getConfiguration(),
+				Collections.singletonList(cli));
 			this.expectedParallelism = expectedParallelism;
 			this.sysoutLogging = logging;
 			this.isDetached = isDetached;

http://git-wip-us.apache.org/repos/asf/flink/blob/463b922a/flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendSavepointTest.java
----------------------------------------------------------------------
diff --git a/flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendSavepointTest.java b/flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendSavepointTest.java
index f4c66eb..3195a6b 100644
--- a/flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendSavepointTest.java
+++ b/flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendSavepointTest.java
@@ -30,7 +30,6 @@ import org.apache.flink.runtime.messages.Acknowledge;
 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.hamcrest.Matchers;
 import org.junit.Rule;
@@ -61,7 +60,7 @@ import static org.mockito.Mockito.when;
 /**
  * Tests for the SAVEPOINT command.
  */
-public class CliFrontendSavepointTest extends TestLogger {
+public class CliFrontendSavepointTest extends CliFrontendTestBase {
 
 	private static PrintStream stdOut;
 	private static PrintStream stdErr;
@@ -137,7 +136,7 @@ public class CliFrontendSavepointTest extends TestLogger {
 
 		try {
 			CliFrontend frontend = new MockedCliFrontend(new StandaloneClusterClient(
-				new Configuration(),
+				getConfiguration(),
 				new TestingHighAvailabilityServices(),
 				false));
 
@@ -197,7 +196,7 @@ public class CliFrontendSavepointTest extends TestLogger {
 		String savepointPath = "expectedSavepointPath";
 
 		ClusterClient clusterClient = new DisposeSavepointClusterClient(
-			(String path, Time timeout) -> CompletableFuture.completedFuture(Acknowledge.get()));
+			(String path, Time timeout) -> CompletableFuture.completedFuture(Acknowledge.get()), getConfiguration());
 
 		try {
 
@@ -229,7 +228,7 @@ public class CliFrontendSavepointTest extends TestLogger {
 			(String savepointPath, Time timeout) -> {
 				disposeSavepointFuture.complete(savepointPath);
 				return CompletableFuture.completedFuture(Acknowledge.get());
-			});
+			}, getConfiguration());
 
 		try {
 			CliFrontend frontend = new MockedCliFrontend(clusterClient);
@@ -261,7 +260,7 @@ public class CliFrontendSavepointTest extends TestLogger {
 
 		Exception testException = new Exception("expectedTestException");
 
-		DisposeSavepointClusterClient clusterClient = new DisposeSavepointClusterClient((String path, Time timeout) -> FutureUtils.completedExceptionally(testException));
+		DisposeSavepointClusterClient clusterClient = new DisposeSavepointClusterClient((String path, Time timeout) -> FutureUtils.completedExceptionally(testException), getConfiguration());
 
 		try {
 			CliFrontend frontend = new MockedCliFrontend(clusterClient);
@@ -288,8 +287,8 @@ public class CliFrontendSavepointTest extends TestLogger {
 
 		private final BiFunction<String, Time, CompletableFuture<Acknowledge>> disposeSavepointFunction;
 
-		DisposeSavepointClusterClient(BiFunction<String, Time, CompletableFuture<Acknowledge>> disposeSavepointFunction) throws Exception {
-			super(new Configuration(), new TestingHighAvailabilityServices(), false);
+		DisposeSavepointClusterClient(BiFunction<String, Time, CompletableFuture<Acknowledge>> disposeSavepointFunction, Configuration configuration) {
+			super(configuration, new TestingHighAvailabilityServices(), false);
 
 			this.disposeSavepointFunction = Preconditions.checkNotNull(disposeSavepointFunction);
 		}

http://git-wip-us.apache.org/repos/asf/flink/blob/463b922a/flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendStopTest.java
----------------------------------------------------------------------
diff --git a/flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendStopTest.java b/flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendStopTest.java
index ec4ccdc..23bed00 100644
--- a/flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendStopTest.java
+++ b/flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendStopTest.java
@@ -24,7 +24,6 @@ import org.apache.flink.client.program.ClusterClient;
 import org.apache.flink.configuration.Configuration;
 import org.apache.flink.util.ExceptionUtils;
 import org.apache.flink.util.FlinkException;
-import org.apache.flink.util.TestLogger;
 
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
@@ -45,7 +44,7 @@ import static org.powermock.api.mockito.PowerMockito.doThrow;
 /**
  * Tests for the STOP command.
  */
-public class CliFrontendStopTest extends TestLogger {
+public class CliFrontendStopTest extends CliFrontendTestBase {
 
 	@BeforeClass
 	public static void setup() {
@@ -76,10 +75,10 @@ public class CliFrontendStopTest extends TestLogger {
 	public void testUnrecognizedOption() throws Exception {
 		// test unrecognized option
 		String[] parameters = { "-v", "-l" };
-		Configuration configuration = new Configuration();
+		Configuration configuration = getConfiguration();
 		CliFrontend testFrontend = new CliFrontend(
 			configuration,
-			Collections.singletonList(new DefaultCLI(configuration)));
+			Collections.singletonList(getCli(configuration)));
 		testFrontend.stop(parameters);
 	}
 
@@ -87,10 +86,10 @@ public class CliFrontendStopTest extends TestLogger {
 	public void testMissingJobId() throws Exception {
 		// test missing job id
 		String[] parameters = {};
-		Configuration configuration = new Configuration();
+		Configuration configuration = getConfiguration();
 		CliFrontend testFrontend = new CliFrontend(
 			configuration,
-			Collections.singletonList(new DefaultCLI(configuration)));
+			Collections.singletonList(getCli(configuration)));
 		testFrontend.stop(parameters);
 	}
 

http://git-wip-us.apache.org/repos/asf/flink/blob/463b922a/flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendTestBase.java
----------------------------------------------------------------------
diff --git a/flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendTestBase.java b/flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendTestBase.java
new file mode 100644
index 0000000..e2463f2
--- /dev/null
+++ b/flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendTestBase.java
@@ -0,0 +1,61 @@
+/*
+ * 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.client.cli;
+
+import org.apache.flink.configuration.Configuration;
+import org.apache.flink.configuration.CoreOptions;
+import org.apache.flink.configuration.GlobalConfiguration;
+import org.apache.flink.util.TestLogger;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * Base test class for {@link CliFrontend} tests that wraps the Flip-6 vs. non-Flip-6 modes.
+ */
+@RunWith(Parameterized.class)
+public abstract class CliFrontendTestBase extends TestLogger {
+	@Parameterized.Parameter
+	public String mode;
+
+	@Parameterized.Parameters(name = "Mode = {0}")
+	public static List<String> parameters() {
+		return Arrays.asList(CoreOptions.OLD_MODE, CoreOptions.FLIP6_MODE);
+	}
+
+	protected Configuration getConfiguration() {
+		final Configuration configuration = GlobalConfiguration
+			.loadConfiguration(CliFrontendTestUtils.getConfigDir());
+		configuration.setString(CoreOptions.MODE, mode);
+		return configuration;
+	}
+
+	static AbstractCustomCommandLine<?> getCli(Configuration configuration) {
+		switch (configuration.getString(CoreOptions.MODE)) {
+			case CoreOptions.OLD_MODE:
+				return new DefaultCLI(configuration);
+			case CoreOptions.FLIP6_MODE:
+				return new Flip6DefaultCLI(configuration);
+		}
+		throw new IllegalStateException();
+	}
+}

http://git-wip-us.apache.org/repos/asf/flink/blob/463b922a/flink-clients/src/test/java/org/apache/flink/client/cli/DefaultCLITest.java
----------------------------------------------------------------------
diff --git a/flink-clients/src/test/java/org/apache/flink/client/cli/DefaultCLITest.java b/flink-clients/src/test/java/org/apache/flink/client/cli/DefaultCLITest.java
index d89e988..8402b7e 100644
--- a/flink-clients/src/test/java/org/apache/flink/client/cli/DefaultCLITest.java
+++ b/flink-clients/src/test/java/org/apache/flink/client/cli/DefaultCLITest.java
@@ -18,12 +18,12 @@
 
 package org.apache.flink.client.cli;
 
-import org.apache.flink.client.deployment.StandaloneClusterDescriptor;
+import org.apache.flink.client.deployment.ClusterDescriptor;
+import org.apache.flink.client.deployment.StandaloneClusterId;
 import org.apache.flink.client.program.ClusterClient;
 import org.apache.flink.configuration.Configuration;
 import org.apache.flink.configuration.JobManagerOptions;
 import org.apache.flink.runtime.util.LeaderConnectionInfo;
-import org.apache.flink.util.TestLogger;
 
 import org.apache.commons.cli.CommandLine;
 import org.hamcrest.Matchers;
@@ -36,7 +36,7 @@ import static org.junit.Assert.assertThat;
 /**
  * Tests for the {@link DefaultCLI}.
  */
-public class DefaultCLITest extends TestLogger {
+public class DefaultCLITest extends CliFrontendTestBase {
 
 	@Rule
 	public TemporaryFolder temporaryFolder = new TemporaryFolder();
@@ -47,7 +47,7 @@ public class DefaultCLITest extends TestLogger {
 	 */
 	@Test
 	public void testConfigurationPassing() throws Exception {
-		final Configuration configuration = new Configuration();
+		final Configuration configuration = getConfiguration();
 
 		final String localhost = "localhost";
 		final int port = 1234;
@@ -55,13 +55,16 @@ public class DefaultCLITest extends TestLogger {
 		configuration.setString(JobManagerOptions.ADDRESS, localhost);
 		configuration.setInteger(JobManagerOptions.PORT, port);
 
-		final DefaultCLI defaultCLI = new DefaultCLI(configuration);
+		@SuppressWarnings("unchecked")
+		final AbstractCustomCommandLine<StandaloneClusterId> defaultCLI =
+			(AbstractCustomCommandLine<StandaloneClusterId>) getCli(configuration);
 
 		final String[] args = {};
 
 		CommandLine commandLine = defaultCLI.parseCommandLineOptions(args, false);
 
-		final StandaloneClusterDescriptor clusterDescriptor = defaultCLI.createClusterDescriptor(commandLine);
+		final ClusterDescriptor<StandaloneClusterId> clusterDescriptor =
+			defaultCLI.createClusterDescriptor(commandLine);
 
 		final ClusterClient<?> clusterClient = clusterDescriptor.retrieve(defaultCLI.getClusterId(commandLine));
 
@@ -78,12 +81,14 @@ public class DefaultCLITest extends TestLogger {
 	public void testManualConfigurationOverride() throws Exception {
 		final String localhost = "localhost";
 		final int port = 1234;
-		final Configuration configuration = new Configuration();
+		final Configuration configuration = getConfiguration();
 
 		configuration.setString(JobManagerOptions.ADDRESS, localhost);
 		configuration.setInteger(JobManagerOptions.PORT, port);
 
-		final DefaultCLI defaultCLI = new DefaultCLI(configuration);
+		@SuppressWarnings("unchecked")
+		final AbstractCustomCommandLine<StandaloneClusterId> defaultCLI =
+			(AbstractCustomCommandLine<StandaloneClusterId>) getCli(configuration);
 
 		final String manualHostname = "123.123.123.123";
 		final int manualPort = 4321;
@@ -91,7 +96,8 @@ public class DefaultCLITest extends TestLogger {
 
 		CommandLine commandLine = defaultCLI.parseCommandLineOptions(args, false);
 
-		final StandaloneClusterDescriptor clusterDescriptor = defaultCLI.createClusterDescriptor(commandLine);
+		final ClusterDescriptor<StandaloneClusterId> clusterDescriptor =
+			defaultCLI.createClusterDescriptor(commandLine);
 
 		final ClusterClient<?> clusterClient = clusterDescriptor.retrieve(defaultCLI.getClusterId(commandLine));