From 5c7635f550a4598c607a38984d1943110668022d Mon Sep 17 00:00:00 2001 From: Emmanuel Bigeon Date: Sun, 9 Jun 2019 12:13:41 -0400 Subject: [PATCH] Fix cycle Signed-off-by: Emmanuel Bigeon --- gclc/pom.xml | 2 +- .../AOutputForwardRunnable.java | 2 +- .../bigeon/gclc/ConsoleApplicationTest.java | 6 +-- .../gclc/command/CommandParametersTest.java | 6 +-- .../command/ParametrizedCommandDataTest.java | 3 +- .../gclc/command/ParametrizedCommandTest.java | 45 +++++++------------ .../bigeon/gclc/command/SubedCommandTest.java | 5 +-- .../gclc/manager/ReadingRunnableTest.java | 2 +- .../manager/SystemConsoleManagerTest.java | 5 +-- .../bigeon/gclc/prompt/CLIPrompterTest.java | 9 ++-- .../tools/AOutputForwardRunnableTest.java | 3 +- 11 files changed, 29 insertions(+), 59 deletions(-) rename gclc/src/main/java/net/bigeon/gclc/{utils => tools}/AOutputForwardRunnable.java (97%) diff --git a/gclc/pom.xml b/gclc/pom.xml index b7b6017..1f54431 100644 --- a/gclc/pom.xml +++ b/gclc/pom.xml @@ -49,7 +49,7 @@ net.bigeon.test junitmt - 1.0.2 + 1.0.4 test diff --git a/gclc/src/main/java/net/bigeon/gclc/utils/AOutputForwardRunnable.java b/gclc/src/main/java/net/bigeon/gclc/tools/AOutputForwardRunnable.java similarity index 97% rename from gclc/src/main/java/net/bigeon/gclc/utils/AOutputForwardRunnable.java rename to gclc/src/main/java/net/bigeon/gclc/tools/AOutputForwardRunnable.java index 596938f..f73248b 100644 --- a/gclc/src/main/java/net/bigeon/gclc/utils/AOutputForwardRunnable.java +++ b/gclc/src/main/java/net/bigeon/gclc/tools/AOutputForwardRunnable.java @@ -36,7 +36,7 @@ * gclc:net.bigeon.gclc.tools.AOutputForwardRunnable.java * Created on: Dec 1, 2016 */ -package net.bigeon.gclc.utils; +package net.bigeon.gclc.tools; /*- * #%L diff --git a/gclc/src/test/java/net/bigeon/gclc/ConsoleApplicationTest.java b/gclc/src/test/java/net/bigeon/gclc/ConsoleApplicationTest.java index e8b63ef..c718b30 100644 --- a/gclc/src/test/java/net/bigeon/gclc/ConsoleApplicationTest.java +++ b/gclc/src/test/java/net/bigeon/gclc/ConsoleApplicationTest.java @@ -71,11 +71,7 @@ package net.bigeon.gclc; * knowledge of the CeCILL license and that you accept its terms. * #L% */ -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.Assert.*; import java.io.BufferedReader; import java.io.IOException; diff --git a/gclc/src/test/java/net/bigeon/gclc/command/CommandParametersTest.java b/gclc/src/test/java/net/bigeon/gclc/command/CommandParametersTest.java index 1074d0b..6e6ea06 100644 --- a/gclc/src/test/java/net/bigeon/gclc/command/CommandParametersTest.java +++ b/gclc/src/test/java/net/bigeon/gclc/command/CommandParametersTest.java @@ -71,11 +71,7 @@ package net.bigeon.gclc.command; * knowledge of the CeCILL license and that you accept its terms. * #L% */ -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.Assert.*; import java.util.HashSet; import java.util.Set; diff --git a/gclc/src/test/java/net/bigeon/gclc/command/ParametrizedCommandDataTest.java b/gclc/src/test/java/net/bigeon/gclc/command/ParametrizedCommandDataTest.java index 8e36880..24de06b 100644 --- a/gclc/src/test/java/net/bigeon/gclc/command/ParametrizedCommandDataTest.java +++ b/gclc/src/test/java/net/bigeon/gclc/command/ParametrizedCommandDataTest.java @@ -33,8 +33,7 @@ package net.bigeon.gclc.command; * knowledge of the CeCILL license and that you accept its terms. * #L% */ - -import static org.junit.Assert.*; +import static org.junit.Assert.fail; import org.junit.Test; diff --git a/gclc/src/test/java/net/bigeon/gclc/command/ParametrizedCommandTest.java b/gclc/src/test/java/net/bigeon/gclc/command/ParametrizedCommandTest.java index a650f46..6aae911 100644 --- a/gclc/src/test/java/net/bigeon/gclc/command/ParametrizedCommandTest.java +++ b/gclc/src/test/java/net/bigeon/gclc/command/ParametrizedCommandTest.java @@ -71,11 +71,7 @@ package net.bigeon.gclc.command; * knowledge of the CeCILL license and that you accept its terms. * #L% */ -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.Assert.*; import java.io.BufferedReader; import java.io.IOException; @@ -93,10 +89,10 @@ import net.bigeon.gclc.manager.ConsoleInput; import net.bigeon.gclc.manager.ConsoleOutput; import net.bigeon.gclc.manager.PipedConsoleInput; import net.bigeon.gclc.manager.PipedConsoleOutput; -import net.bigeon.test.junitmt.ATestRunnable; import net.bigeon.test.junitmt.FunctionalTestRunnable; -import net.bigeon.test.junitmt.TestFunction; import net.bigeon.test.junitmt.ThreadTest; +import net.bigeon.test.junitmt.api.ATestRunnable; +import net.bigeon.test.junitmt.api.TestFunction; /** *

@@ -513,21 +509,18 @@ public class ParametrizedCommandTest { cmd.execute(out, in, "-" + str1, str2, "-" + addParam); cmd.execute(out, in, "-" + str1, str2, "-" + addParam, addParam); - final TestFunction function = new TestFunction() { - - @Override - public void apply() throws Exception { - assertEquals("value of " + str1 + "? ", buf.readLine()); - in.type(""); - assertEquals("value of " + str1 + "? (cannot be empty) ", - buf.readLine()); - in.type(""); - assertEquals("value of " + str1 + "? (cannot be empty) ", - buf.readLine()); - in.type(str2); - } + final TestFunction function = () -> { + assertEquals("value of " + str1 + "? ", buf.readLine()); + in.type(""); + assertEquals("value of " + str1 + "? (cannot be empty) ", + buf.readLine()); + in.type(""); + assertEquals("value of " + str1 + "? (cannot be empty) ", + buf.readLine()); + in.type(str2); }; - final ATestRunnable testConsole = new FunctionalTestRunnable(function); + final FunctionalTestRunnable testConsole = new FunctionalTestRunnable( + function); final Thread th = new Thread(testConsole); th.start(); @@ -543,13 +536,9 @@ public class ParametrizedCommandTest { new InputStreamReader(pis, StandardCharsets.UTF_8)); PipedConsoleInput in = new PipedConsoleInput(new PrintStream(pout))) { - final TestFunction function = new TestFunction() { - - @Override - public void apply() throws Exception { - assertEquals("value of " + str1 + "? ", buf.readLine()); - in.type(str2); - } + final TestFunction function = () -> { + assertEquals("value of " + str1 + "? ", buf.readLine()); + in.type(str2); }; final ATestRunnable testConsole = new FunctionalTestRunnable(function); diff --git a/gclc/src/test/java/net/bigeon/gclc/command/SubedCommandTest.java b/gclc/src/test/java/net/bigeon/gclc/command/SubedCommandTest.java index 2d5ddb8..8683a82 100644 --- a/gclc/src/test/java/net/bigeon/gclc/command/SubedCommandTest.java +++ b/gclc/src/test/java/net/bigeon/gclc/command/SubedCommandTest.java @@ -71,10 +71,7 @@ package net.bigeon.gclc.command; * knowledge of the CeCILL license and that you accept its terms. * #L% */ -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.fail; +import static org.junit.Assert.*; import java.io.IOException; diff --git a/gclc/src/test/java/net/bigeon/gclc/manager/ReadingRunnableTest.java b/gclc/src/test/java/net/bigeon/gclc/manager/ReadingRunnableTest.java index 1cddc6a..4b838a4 100644 --- a/gclc/src/test/java/net/bigeon/gclc/manager/ReadingRunnableTest.java +++ b/gclc/src/test/java/net/bigeon/gclc/manager/ReadingRunnableTest.java @@ -92,8 +92,8 @@ import org.junit.Test; import net.bigeon.gclc.utils.ReadingRunnable; import net.bigeon.test.junitmt.FunctionalTestRunnable; -import net.bigeon.test.junitmt.TestFunction; import net.bigeon.test.junitmt.ThreadTest; +import net.bigeon.test.junitmt.api.TestFunction; /** *

diff --git a/gclc/src/test/java/net/bigeon/gclc/manager/SystemConsoleManagerTest.java b/gclc/src/test/java/net/bigeon/gclc/manager/SystemConsoleManagerTest.java index 2025aae..9576904 100644 --- a/gclc/src/test/java/net/bigeon/gclc/manager/SystemConsoleManagerTest.java +++ b/gclc/src/test/java/net/bigeon/gclc/manager/SystemConsoleManagerTest.java @@ -71,10 +71,7 @@ package net.bigeon.gclc.manager; * knowledge of the CeCILL license and that you accept its terms. * #L% */ -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.Assert.*; import java.io.IOException; import java.io.InputStream; diff --git a/gclc/src/test/java/net/bigeon/gclc/prompt/CLIPrompterTest.java b/gclc/src/test/java/net/bigeon/gclc/prompt/CLIPrompterTest.java index dcbbd88..dd79041 100644 --- a/gclc/src/test/java/net/bigeon/gclc/prompt/CLIPrompterTest.java +++ b/gclc/src/test/java/net/bigeon/gclc/prompt/CLIPrompterTest.java @@ -71,10 +71,7 @@ package net.bigeon.gclc.prompt; * knowledge of the CeCILL license and that you accept its terms. * #L% */ -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.Assert.*; import java.io.BufferedReader; import java.io.IOException; @@ -94,10 +91,10 @@ import org.junit.Test; import net.bigeon.gclc.manager.PipedConsoleInput; import net.bigeon.gclc.manager.PipedConsoleOutput; -import net.bigeon.test.junitmt.ATestRunnable; import net.bigeon.test.junitmt.FunctionalTestRunnable; -import net.bigeon.test.junitmt.TestFunction; import net.bigeon.test.junitmt.ThreadTest; +import net.bigeon.test.junitmt.api.ATestRunnable; +import net.bigeon.test.junitmt.api.TestFunction; /** *

diff --git a/gclc/src/test/java/net/bigeon/gclc/tools/AOutputForwardRunnableTest.java b/gclc/src/test/java/net/bigeon/gclc/tools/AOutputForwardRunnableTest.java index 6b3b040..7e8f1e6 100644 --- a/gclc/src/test/java/net/bigeon/gclc/tools/AOutputForwardRunnableTest.java +++ b/gclc/src/test/java/net/bigeon/gclc/tools/AOutputForwardRunnableTest.java @@ -78,7 +78,6 @@ import java.io.IOException; import org.junit.Test; import net.bigeon.gclc.manager.PipedConsoleOutput; -import net.bigeon.gclc.utils.AOutputForwardRunnable; /** *

@@ -143,7 +142,7 @@ public class AOutputForwardRunnableTest { } /** Test method for - * {@link net.bigeon.gclc.utils.AOutputForwardRunnable#run()}. */ + * {@link net.bigeon.gclc.tools.AOutputForwardRunnable#run()}. */ @Test public final void testRun() { try (PipedConsoleOutput manager = new PipedConsoleOutput()) {