Fix cycle
Signed-off-by: Emmanuel Bigeon <emmanuel@bigeon.fr>
This commit is contained in:
parent
54a267092d
commit
5c7635f550
@ -49,7 +49,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.bigeon.test</groupId>
|
<groupId>net.bigeon.test</groupId>
|
||||||
<artifactId>junitmt</artifactId>
|
<artifactId>junitmt</artifactId>
|
||||||
<version>1.0.2</version>
|
<version>1.0.4</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
* gclc:net.bigeon.gclc.tools.AOutputForwardRunnable.java
|
* gclc:net.bigeon.gclc.tools.AOutputForwardRunnable.java
|
||||||
* Created on: Dec 1, 2016
|
* Created on: Dec 1, 2016
|
||||||
*/
|
*/
|
||||||
package net.bigeon.gclc.utils;
|
package net.bigeon.gclc.tools;
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* #%L
|
* #%L
|
@ -71,11 +71,7 @@ package net.bigeon.gclc;
|
|||||||
* knowledge of the CeCILL license and that you accept its terms.
|
* knowledge of the CeCILL license and that you accept its terms.
|
||||||
* #L%
|
* #L%
|
||||||
*/
|
*/
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.*;
|
||||||
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 java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -71,11 +71,7 @@ package net.bigeon.gclc.command;
|
|||||||
* knowledge of the CeCILL license and that you accept its terms.
|
* knowledge of the CeCILL license and that you accept its terms.
|
||||||
* #L%
|
* #L%
|
||||||
*/
|
*/
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.*;
|
||||||
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 java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
@ -33,8 +33,7 @@ package net.bigeon.gclc.command;
|
|||||||
* knowledge of the CeCILL license and that you accept its terms.
|
* knowledge of the CeCILL license and that you accept its terms.
|
||||||
* #L%
|
* #L%
|
||||||
*/
|
*/
|
||||||
|
import static org.junit.Assert.fail;
|
||||||
import static org.junit.Assert.*;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
|
@ -71,11 +71,7 @@ package net.bigeon.gclc.command;
|
|||||||
* knowledge of the CeCILL license and that you accept its terms.
|
* knowledge of the CeCILL license and that you accept its terms.
|
||||||
* #L%
|
* #L%
|
||||||
*/
|
*/
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.*;
|
||||||
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 java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.IOException;
|
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.ConsoleOutput;
|
||||||
import net.bigeon.gclc.manager.PipedConsoleInput;
|
import net.bigeon.gclc.manager.PipedConsoleInput;
|
||||||
import net.bigeon.gclc.manager.PipedConsoleOutput;
|
import net.bigeon.gclc.manager.PipedConsoleOutput;
|
||||||
import net.bigeon.test.junitmt.ATestRunnable;
|
|
||||||
import net.bigeon.test.junitmt.FunctionalTestRunnable;
|
import net.bigeon.test.junitmt.FunctionalTestRunnable;
|
||||||
import net.bigeon.test.junitmt.TestFunction;
|
|
||||||
import net.bigeon.test.junitmt.ThreadTest;
|
import net.bigeon.test.junitmt.ThreadTest;
|
||||||
|
import net.bigeon.test.junitmt.api.ATestRunnable;
|
||||||
|
import net.bigeon.test.junitmt.api.TestFunction;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@ -513,10 +509,7 @@ public class ParametrizedCommandTest {
|
|||||||
cmd.execute(out, in, "-" + str1, str2, "-" + addParam);
|
cmd.execute(out, in, "-" + str1, str2, "-" + addParam);
|
||||||
cmd.execute(out, in, "-" + str1, str2, "-" + addParam, addParam);
|
cmd.execute(out, in, "-" + str1, str2, "-" + addParam, addParam);
|
||||||
|
|
||||||
final TestFunction function = new TestFunction() {
|
final TestFunction function = () -> {
|
||||||
|
|
||||||
@Override
|
|
||||||
public void apply() throws Exception {
|
|
||||||
assertEquals("value of " + str1 + "? ", buf.readLine());
|
assertEquals("value of " + str1 + "? ", buf.readLine());
|
||||||
in.type("");
|
in.type("");
|
||||||
assertEquals("value of " + str1 + "? (cannot be empty) ",
|
assertEquals("value of " + str1 + "? (cannot be empty) ",
|
||||||
@ -525,9 +518,9 @@ public class ParametrizedCommandTest {
|
|||||||
assertEquals("value of " + str1 + "? (cannot be empty) ",
|
assertEquals("value of " + str1 + "? (cannot be empty) ",
|
||||||
buf.readLine());
|
buf.readLine());
|
||||||
in.type(str2);
|
in.type(str2);
|
||||||
}
|
|
||||||
};
|
};
|
||||||
final ATestRunnable testConsole = new FunctionalTestRunnable(function);
|
final FunctionalTestRunnable testConsole = new FunctionalTestRunnable(
|
||||||
|
function);
|
||||||
|
|
||||||
final Thread th = new Thread(testConsole);
|
final Thread th = new Thread(testConsole);
|
||||||
th.start();
|
th.start();
|
||||||
@ -543,13 +536,9 @@ public class ParametrizedCommandTest {
|
|||||||
new InputStreamReader(pis, StandardCharsets.UTF_8));
|
new InputStreamReader(pis, StandardCharsets.UTF_8));
|
||||||
PipedConsoleInput in = new PipedConsoleInput(new PrintStream(pout))) {
|
PipedConsoleInput in = new PipedConsoleInput(new PrintStream(pout))) {
|
||||||
|
|
||||||
final TestFunction function = new TestFunction() {
|
final TestFunction function = () -> {
|
||||||
|
|
||||||
@Override
|
|
||||||
public void apply() throws Exception {
|
|
||||||
assertEquals("value of " + str1 + "? ", buf.readLine());
|
assertEquals("value of " + str1 + "? ", buf.readLine());
|
||||||
in.type(str2);
|
in.type(str2);
|
||||||
}
|
|
||||||
};
|
};
|
||||||
final ATestRunnable testConsole = new FunctionalTestRunnable(function);
|
final ATestRunnable testConsole = new FunctionalTestRunnable(function);
|
||||||
|
|
||||||
|
@ -71,10 +71,7 @@ package net.bigeon.gclc.command;
|
|||||||
* knowledge of the CeCILL license and that you accept its terms.
|
* knowledge of the CeCILL license and that you accept its terms.
|
||||||
* #L%
|
* #L%
|
||||||
*/
|
*/
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.*;
|
||||||
import static org.junit.Assert.assertNotNull;
|
|
||||||
import static org.junit.Assert.assertNull;
|
|
||||||
import static org.junit.Assert.fail;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
@ -92,8 +92,8 @@ import org.junit.Test;
|
|||||||
|
|
||||||
import net.bigeon.gclc.utils.ReadingRunnable;
|
import net.bigeon.gclc.utils.ReadingRunnable;
|
||||||
import net.bigeon.test.junitmt.FunctionalTestRunnable;
|
import net.bigeon.test.junitmt.FunctionalTestRunnable;
|
||||||
import net.bigeon.test.junitmt.TestFunction;
|
|
||||||
import net.bigeon.test.junitmt.ThreadTest;
|
import net.bigeon.test.junitmt.ThreadTest;
|
||||||
|
import net.bigeon.test.junitmt.api.TestFunction;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
|
@ -71,10 +71,7 @@ package net.bigeon.gclc.manager;
|
|||||||
* knowledge of the CeCILL license and that you accept its terms.
|
* knowledge of the CeCILL license and that you accept its terms.
|
||||||
* #L%
|
* #L%
|
||||||
*/
|
*/
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.*;
|
||||||
import static org.junit.Assert.assertFalse;
|
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
import static org.junit.Assert.fail;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
@ -71,10 +71,7 @@ package net.bigeon.gclc.prompt;
|
|||||||
* knowledge of the CeCILL license and that you accept its terms.
|
* knowledge of the CeCILL license and that you accept its terms.
|
||||||
* #L%
|
* #L%
|
||||||
*/
|
*/
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.*;
|
||||||
import static org.junit.Assert.assertFalse;
|
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
import static org.junit.Assert.fail;
|
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -94,10 +91,10 @@ import org.junit.Test;
|
|||||||
|
|
||||||
import net.bigeon.gclc.manager.PipedConsoleInput;
|
import net.bigeon.gclc.manager.PipedConsoleInput;
|
||||||
import net.bigeon.gclc.manager.PipedConsoleOutput;
|
import net.bigeon.gclc.manager.PipedConsoleOutput;
|
||||||
import net.bigeon.test.junitmt.ATestRunnable;
|
|
||||||
import net.bigeon.test.junitmt.FunctionalTestRunnable;
|
import net.bigeon.test.junitmt.FunctionalTestRunnable;
|
||||||
import net.bigeon.test.junitmt.TestFunction;
|
|
||||||
import net.bigeon.test.junitmt.ThreadTest;
|
import net.bigeon.test.junitmt.ThreadTest;
|
||||||
|
import net.bigeon.test.junitmt.api.ATestRunnable;
|
||||||
|
import net.bigeon.test.junitmt.api.TestFunction;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
|
@ -78,7 +78,6 @@ import java.io.IOException;
|
|||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import net.bigeon.gclc.manager.PipedConsoleOutput;
|
import net.bigeon.gclc.manager.PipedConsoleOutput;
|
||||||
import net.bigeon.gclc.utils.AOutputForwardRunnable;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@ -143,7 +142,7 @@ public class AOutputForwardRunnableTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Test method for
|
/** Test method for
|
||||||
* {@link net.bigeon.gclc.utils.AOutputForwardRunnable#run()}. */
|
* {@link net.bigeon.gclc.tools.AOutputForwardRunnable#run()}. */
|
||||||
@Test
|
@Test
|
||||||
public final void testRun() {
|
public final void testRun() {
|
||||||
try (PipedConsoleOutput manager = new PipedConsoleOutput()) {
|
try (PipedConsoleOutput manager = new PipedConsoleOutput()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user