Moved console input/output implementations
Signed-off-by: Emmanuel Bigeon <emmanuel@bigeon.fr>
This commit is contained in:
parent
b671474f64
commit
c4bbfd8434
@ -95,8 +95,8 @@ import net.bigeon.gclc.manager.ConsoleOutput;
|
|||||||
* A typical use case is the following:
|
* A typical use case is the following:
|
||||||
*
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
* {@link ConsoleOutput} out = new {@link net.bigeon.gclc.utils.StreamConsoleOutput StreamConsoleOutput}();
|
* {@link ConsoleOutput} out = new {@link net.bigeon.gclc.manager.StreamConsoleOutput StreamConsoleOutput}();
|
||||||
* {@link ConsoleInput} in = new {@link net.bigeon.gclc.utils.StreamConsoleInput StreamConsoleInput}();
|
* {@link ConsoleInput} in = new {@link net.bigeon.gclc.manager.StreamConsoleInput StreamConsoleInput}();
|
||||||
* {@link ConsoleApplication} app = new {@link ConsoleApplication}(out, in, "welcome", "see you latter")};
|
* {@link ConsoleApplication} app = new {@link ConsoleApplication}(out, in, "welcome", "see you latter")};
|
||||||
* app.{@link ConsoleApplication#add(ICommand) add}("my_command", new {@link ICommand MyCommand()});
|
* app.{@link ConsoleApplication#add(ICommand) add}("my_command", new {@link ICommand MyCommand()});
|
||||||
* app.{@link ConsoleApplication#start() start()};
|
* app.{@link ConsoleApplication#start() start()};
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
* gclc-test:net.bigeon.gclc.test.TestConsoleManager.java
|
* gclc-test:net.bigeon.gclc.test.TestConsoleManager.java
|
||||||
* Created on: Nov 18, 2016
|
* Created on: Nov 18, 2016
|
||||||
*/
|
*/
|
||||||
package net.bigeon.gclc.utils;
|
package net.bigeon.gclc.manager;
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* #%L
|
* #%L
|
||||||
@ -78,7 +78,7 @@ import java.io.PrintStream;
|
|||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
import net.bigeon.gclc.manager.ConsoleInput;
|
import net.bigeon.gclc.utils.WritingRunnable;
|
||||||
|
|
||||||
/** This console input allows to enter commands and retrieve the output as an
|
/** This console input allows to enter commands and retrieve the output as an
|
||||||
* input.
|
* input.
|
@ -36,7 +36,7 @@
|
|||||||
* gclc-test:net.bigeon.gclc.test.TestConsoleManager.java
|
* gclc-test:net.bigeon.gclc.test.TestConsoleManager.java
|
||||||
* Created on: Nov 18, 2016
|
* Created on: Nov 18, 2016
|
||||||
*/
|
*/
|
||||||
package net.bigeon.gclc.utils;
|
package net.bigeon.gclc.manager;
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* #%L
|
* #%L
|
||||||
@ -79,7 +79,7 @@ import java.io.PipedOutputStream;
|
|||||||
import java.io.PrintStream;
|
import java.io.PrintStream;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
import net.bigeon.gclc.manager.ConsoleOutput;
|
import net.bigeon.gclc.utils.ReadingRunnable;
|
||||||
|
|
||||||
/** This console output allows to retrieve the output as an input.
|
/** This console output allows to retrieve the output as an input.
|
||||||
* <p>
|
* <p>
|
@ -36,7 +36,7 @@
|
|||||||
* gclc:net.bigeon.gclc.system.SystemConsoleManager.java
|
* gclc:net.bigeon.gclc.system.SystemConsoleManager.java
|
||||||
* Created on: Dec 19, 2014
|
* Created on: Dec 19, 2014
|
||||||
*/
|
*/
|
||||||
package net.bigeon.gclc.utils;
|
package net.bigeon.gclc.manager;
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* #%L
|
* #%L
|
||||||
@ -79,8 +79,8 @@ import java.io.PrintStream;
|
|||||||
import java.nio.charset.Charset;
|
import java.nio.charset.Charset;
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
import net.bigeon.gclc.manager.ConsoleInput;
|
|
||||||
import net.bigeon.gclc.tools.ConstantString;
|
import net.bigeon.gclc.tools.ConstantString;
|
||||||
|
import net.bigeon.gclc.utils.ReadingRunnable;
|
||||||
|
|
||||||
/** A console using the input stream and print stream.
|
/** A console using the input stream and print stream.
|
||||||
* <p>
|
* <p>
|
@ -36,7 +36,7 @@
|
|||||||
* gclc:net.bigeon.gclc.system.SystemConsoleManager.java
|
* gclc:net.bigeon.gclc.system.SystemConsoleManager.java
|
||||||
* Created on: Dec 19, 2014
|
* Created on: Dec 19, 2014
|
||||||
*/
|
*/
|
||||||
package net.bigeon.gclc.utils;
|
package net.bigeon.gclc.manager;
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* #%L
|
* #%L
|
||||||
@ -74,8 +74,6 @@ package net.bigeon.gclc.utils;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.PrintStream;
|
import java.io.PrintStream;
|
||||||
|
|
||||||
import net.bigeon.gclc.manager.ConsoleOutput;
|
|
||||||
|
|
||||||
/** A console using the input stream and print stream.
|
/** A console using the input stream and print stream.
|
||||||
* <p>
|
* <p>
|
||||||
* The default constructor will use the system standart input and output.
|
* The default constructor will use the system standart input and output.
|
@ -75,6 +75,8 @@ import java.io.IOException;
|
|||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
|
import net.bigeon.gclc.manager.PipedConsoleOutput;
|
||||||
|
|
||||||
/** An incomplete implematation used to forward messages from a piped console.
|
/** An incomplete implematation used to forward messages from a piped console.
|
||||||
* <p>
|
* <p>
|
||||||
* This forwarding can be interrupted without closing the piped manager.
|
* This forwarding can be interrupted without closing the piped manager.
|
||||||
|
@ -75,8 +75,8 @@ import java.io.IOException;
|
|||||||
|
|
||||||
import net.bigeon.gclc.command.ICommand;
|
import net.bigeon.gclc.command.ICommand;
|
||||||
import net.bigeon.gclc.exception.InvalidCommandName;
|
import net.bigeon.gclc.exception.InvalidCommandName;
|
||||||
import net.bigeon.gclc.utils.PipedConsoleInput;
|
import net.bigeon.gclc.manager.PipedConsoleInput;
|
||||||
import net.bigeon.gclc.utils.PipedConsoleOutput;
|
import net.bigeon.gclc.manager.PipedConsoleOutput;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
|
@ -95,8 +95,8 @@ import net.bigeon.gclc.exception.InvalidCommandName;
|
|||||||
import net.bigeon.gclc.i18n.Messages;
|
import net.bigeon.gclc.i18n.Messages;
|
||||||
import net.bigeon.gclc.manager.ConsoleInput;
|
import net.bigeon.gclc.manager.ConsoleInput;
|
||||||
import net.bigeon.gclc.manager.ConsoleOutput;
|
import net.bigeon.gclc.manager.ConsoleOutput;
|
||||||
import net.bigeon.gclc.utils.PipedConsoleInput;
|
import net.bigeon.gclc.manager.PipedConsoleInput;
|
||||||
import net.bigeon.gclc.utils.PipedConsoleOutput;
|
import net.bigeon.gclc.manager.PipedConsoleOutput;
|
||||||
|
|
||||||
/** Test class for ConsoleApplication
|
/** Test class for ConsoleApplication
|
||||||
*
|
*
|
||||||
|
@ -82,7 +82,7 @@ import org.junit.Test;
|
|||||||
import net.bigeon.gclc.exception.CommandRunException;
|
import net.bigeon.gclc.exception.CommandRunException;
|
||||||
import net.bigeon.gclc.manager.ConsoleInput;
|
import net.bigeon.gclc.manager.ConsoleInput;
|
||||||
import net.bigeon.gclc.manager.ConsoleOutput;
|
import net.bigeon.gclc.manager.ConsoleOutput;
|
||||||
import net.bigeon.gclc.utils.PipedConsoleOutput;
|
import net.bigeon.gclc.manager.PipedConsoleOutput;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
|
@ -83,7 +83,7 @@ import net.bigeon.gclc.command.base.MockCommand;
|
|||||||
import net.bigeon.gclc.exception.CommandRunException;
|
import net.bigeon.gclc.exception.CommandRunException;
|
||||||
import net.bigeon.gclc.manager.ConsoleInput;
|
import net.bigeon.gclc.manager.ConsoleInput;
|
||||||
import net.bigeon.gclc.manager.ConsoleOutput;
|
import net.bigeon.gclc.manager.ConsoleOutput;
|
||||||
import net.bigeon.gclc.utils.PipedConsoleOutput;
|
import net.bigeon.gclc.manager.PipedConsoleOutput;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
|
@ -91,8 +91,8 @@ import net.bigeon.gclc.exception.CommandRunException;
|
|||||||
import net.bigeon.gclc.exception.InvalidParameterException;
|
import net.bigeon.gclc.exception.InvalidParameterException;
|
||||||
import net.bigeon.gclc.manager.ConsoleInput;
|
import net.bigeon.gclc.manager.ConsoleInput;
|
||||||
import net.bigeon.gclc.manager.ConsoleOutput;
|
import net.bigeon.gclc.manager.ConsoleOutput;
|
||||||
import net.bigeon.gclc.utils.PipedConsoleInput;
|
import net.bigeon.gclc.manager.PipedConsoleInput;
|
||||||
import net.bigeon.gclc.utils.PipedConsoleOutput;
|
import net.bigeon.gclc.manager.PipedConsoleOutput;
|
||||||
import net.bigeon.test.junitmt.ATestRunnable;
|
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.TestFunction;
|
||||||
|
@ -85,8 +85,8 @@ import net.bigeon.gclc.ConsoleTestApplication;
|
|||||||
import net.bigeon.gclc.command.base.ScriptExecution;
|
import net.bigeon.gclc.command.base.ScriptExecution;
|
||||||
import net.bigeon.gclc.exception.CommandRunException;
|
import net.bigeon.gclc.exception.CommandRunException;
|
||||||
import net.bigeon.gclc.exception.CommandRunExceptionType;
|
import net.bigeon.gclc.exception.CommandRunExceptionType;
|
||||||
import net.bigeon.gclc.utils.PipedConsoleInput;
|
import net.bigeon.gclc.manager.PipedConsoleInput;
|
||||||
import net.bigeon.gclc.utils.PipedConsoleOutput;
|
import net.bigeon.gclc.manager.PipedConsoleOutput;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
|
@ -85,7 +85,7 @@ import net.bigeon.gclc.exception.CommandRunException;
|
|||||||
import net.bigeon.gclc.exception.InvalidCommandName;
|
import net.bigeon.gclc.exception.InvalidCommandName;
|
||||||
import net.bigeon.gclc.manager.ConsoleInput;
|
import net.bigeon.gclc.manager.ConsoleInput;
|
||||||
import net.bigeon.gclc.manager.ConsoleOutput;
|
import net.bigeon.gclc.manager.ConsoleOutput;
|
||||||
import net.bigeon.gclc.utils.PipedConsoleOutput;
|
import net.bigeon.gclc.manager.PipedConsoleOutput;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
|
@ -9,7 +9,7 @@ import java.io.IOException;
|
|||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import net.bigeon.gclc.exception.CommandRunException;
|
import net.bigeon.gclc.exception.CommandRunException;
|
||||||
import net.bigeon.gclc.utils.PipedConsoleOutput;
|
import net.bigeon.gclc.manager.PipedConsoleOutput;
|
||||||
|
|
||||||
public class EchoCommandTest {
|
public class EchoCommandTest {
|
||||||
|
|
||||||
|
@ -85,8 +85,6 @@ import java.nio.charset.Charset;
|
|||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import net.bigeon.gclc.utils.StreamConsoleInput;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* TODO
|
* TODO
|
||||||
|
@ -92,8 +92,8 @@ import org.junit.After;
|
|||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import net.bigeon.gclc.utils.PipedConsoleInput;
|
import net.bigeon.gclc.manager.PipedConsoleInput;
|
||||||
import net.bigeon.gclc.utils.PipedConsoleOutput;
|
import net.bigeon.gclc.manager.PipedConsoleOutput;
|
||||||
import net.bigeon.test.junitmt.ATestRunnable;
|
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.TestFunction;
|
||||||
|
@ -77,8 +77,8 @@ import java.io.IOException;
|
|||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import net.bigeon.gclc.manager.PipedConsoleOutput;
|
||||||
import net.bigeon.gclc.utils.AOutputForwardRunnable;
|
import net.bigeon.gclc.utils.AOutputForwardRunnable;
|
||||||
import net.bigeon.gclc.utils.PipedConsoleOutput;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
|
Loading…
Reference in New Issue
Block a user