Fix cycle

Signed-off-by: Emmanuel Bigeon <emmanuel@bigeon.fr>
This commit is contained in:
Emmanuel Bigeon 2019-06-09 12:13:41 -04:00
parent 54a267092d
commit 5c7635f550
11 changed files with 29 additions and 59 deletions

View File

@ -49,7 +49,7 @@
<dependency>
<groupId>net.bigeon.test</groupId>
<artifactId>junitmt</artifactId>
<version>1.0.2</version>
<version>1.0.4</version>
<scope>test</scope>
</dependency>
</dependencies>

View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;
/**
* <p>
@ -513,10 +509,7 @@ 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 {
final TestFunction function = () -> {
assertEquals("value of " + str1 + "? ", buf.readLine());
in.type("");
assertEquals("value of " + str1 + "? (cannot be empty) ",
@ -525,9 +518,9 @@ public class ParametrizedCommandTest {
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 {
final TestFunction function = () -> {
assertEquals("value of " + str1 + "? ", buf.readLine());
in.type(str2);
}
};
final ATestRunnable testConsole = new FunctionalTestRunnable(function);

View File

@ -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;

View File

@ -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;
/**
* <p>

View File

@ -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;

View File

@ -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;
/**
* <p>

View File

@ -78,7 +78,6 @@ import java.io.IOException;
import org.junit.Test;
import net.bigeon.gclc.manager.PipedConsoleOutput;
import net.bigeon.gclc.utils.AOutputForwardRunnable;
/**
* <p>
@ -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()) {