Cut cycle

Signed-off-by: Emmanuel Bigeon <emmanuel@bigeon.fr>
This commit is contained in:
Emmanuel Bigeon 2019-05-06 21:19:42 -04:00
parent 92a664d193
commit b6b6ab9d36
16 changed files with 49 additions and 16 deletions

View File

@ -79,6 +79,9 @@ import org.eclipse.swt.widgets.Text;
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.gclc.swt.io.ConsoleInputManager;
import net.bigeon.gclc.swt.io.ConsoleOutputManager;
import net.bigeon.gclc.swt.io.ConsolePromptManager;
/** A shell containing a {@link SWTConsoleView} /** A shell containing a {@link SWTConsoleView}
* <p> * <p>

View File

@ -78,6 +78,9 @@ import org.eclipse.swt.widgets.Text;
import net.bigeon.gclc.ConsoleApplication; import net.bigeon.gclc.ConsoleApplication;
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.gclc.swt.io.ConsoleInputManager;
import net.bigeon.gclc.swt.io.ConsoleOutputManager;
import net.bigeon.gclc.swt.tools.HistoryTextKeyListener;
/** A SWT component to connect to gclc {@link ConsoleApplication}. /** A SWT component to connect to gclc {@link ConsoleApplication}.
* *

View File

@ -33,7 +33,7 @@
* gclc-swt:net.bigeon.gclc.swt.ConsoleDelayIO.java * gclc-swt:net.bigeon.gclc.swt.ConsoleDelayIO.java
* Created on: Nov 19, 2016 * Created on: Nov 19, 2016
*/ */
package net.bigeon.gclc.swt; package net.bigeon.gclc.swt.api;
import java.io.IOException; import java.io.IOException;

View File

@ -1,7 +1,7 @@
/** /**
* *
*/ */
package net.bigeon.gclc.swt; package net.bigeon.gclc.swt.api;
/*- /*-
* #%L * #%L

View File

@ -0,0 +1,8 @@
/**
*
*/
/**
* @author Emmanuel Bigeon
*
*/
package net.bigeon.gclc.swt.api;

View File

@ -1,7 +1,7 @@
/** /**
* *
*/ */
package net.bigeon.gclc.swt; package net.bigeon.gclc.swt.io;
/*- /*-
* #%L * #%L
@ -42,6 +42,7 @@ import java.io.IOException;
import org.eclipse.swt.widgets.Text; import org.eclipse.swt.widgets.Text;
import net.bigeon.gclc.manager.PipedConsoleInput; import net.bigeon.gclc.manager.PipedConsoleInput;
import net.bigeon.gclc.swt.api.ConsoleDelayIO;
/** The object managing the console input. /** The object managing the console input.
* *

View File

@ -1,7 +1,7 @@
/** /**
* *
*/ */
package net.bigeon.gclc.swt; package net.bigeon.gclc.swt.io;
/*- /*-
* #%L * #%L
@ -40,6 +40,8 @@ package net.bigeon.gclc.swt;
import org.eclipse.swt.widgets.Text; import org.eclipse.swt.widgets.Text;
import net.bigeon.gclc.manager.PipedConsoleOutput; import net.bigeon.gclc.manager.PipedConsoleOutput;
import net.bigeon.gclc.swt.api.ConsoleOutputDisplay;
import net.bigeon.gclc.swt.tools.TextAppendingRunnable;
import net.bigeon.gclc.swt.tools.ToSWTConsoleForwardRunnable; import net.bigeon.gclc.swt.tools.ToSWTConsoleForwardRunnable;
/** The manager for console output to insert in a text. /** The manager for console output to insert in a text.

View File

@ -1,7 +1,7 @@
/** /**
* *
*/ */
package net.bigeon.gclc.swt; package net.bigeon.gclc.swt.io;
/*- /*-
* #%L * #%L

View File

@ -0,0 +1,8 @@
/**
*
*/
/**
* @author Emmanuel Bigeon
*
*/
package net.bigeon.gclc.swt.io;

View File

@ -33,7 +33,7 @@
* gclc-swt:net.bigeon.gclc.swt.HistoryTextKeyListener.java * gclc-swt:net.bigeon.gclc.swt.HistoryTextKeyListener.java
* Created on: Jun 9, 2016 * Created on: Jun 9, 2016
*/ */
package net.bigeon.gclc.swt; package net.bigeon.gclc.swt.tools;
import java.io.IOException; import java.io.IOException;
import java.util.logging.Level; import java.util.logging.Level;
@ -78,6 +78,7 @@ import org.eclipse.swt.events.KeyEvent;
import net.bigeon.collections.Ribbon; import net.bigeon.collections.Ribbon;
import net.bigeon.collections.ribbon.ArrayRibbon; import net.bigeon.collections.ribbon.ArrayRibbon;
import net.bigeon.gclc.swt.api.ConsoleDelayIO;
/** A key listener to validate commands and manage the history of commands. /** A key listener to validate commands and manage the history of commands.
* *

View File

@ -1,7 +1,7 @@
/** /**
* *
*/ */
package net.bigeon.gclc.swt; package net.bigeon.gclc.swt.tools;
import org.eclipse.swt.widgets.Text; import org.eclipse.swt.widgets.Text;
@ -33,4 +33,4 @@ public class TextAppendingRunnable implements Runnable {
} }
text.append(next); text.append(next);
} }
} }

View File

@ -7,7 +7,7 @@ import org.eclipse.swt.widgets.Widget;
import net.bigeon.gclc.manager.PipedConsoleOutput; import net.bigeon.gclc.manager.PipedConsoleOutput;
import net.bigeon.gclc.manager.forwarding.AOutputForwardRunnable; import net.bigeon.gclc.manager.forwarding.AOutputForwardRunnable;
import net.bigeon.gclc.swt.ConsoleOutputDisplay; import net.bigeon.gclc.swt.api.ConsoleOutputDisplay;
/** The local implementation of the forwarding runnable. /** The local implementation of the forwarding runnable.
* *

View File

@ -47,6 +47,7 @@ import org.eclipse.swt.widgets.Text;
import org.junit.Test; import org.junit.Test;
import net.bigeon.gclc.manager.PipedConsoleInput; import net.bigeon.gclc.manager.PipedConsoleInput;
import net.bigeon.gclc.swt.io.ConsoleInputManager;
/** @author Emmanuel Bigeon */ /** @author Emmanuel Bigeon */
public class ConsoleInputManagerTest { public class ConsoleInputManagerTest {
@ -55,7 +56,7 @@ public class ConsoleInputManagerTest {
private final ConsoleInputManager cim = new ConsoleInputManager(text); private final ConsoleInputManager cim = new ConsoleInputManager(text);
/** Test method for /** Test method for
* {@link net.bigeon.gclc.swt.ConsoleInputManager#setInput(java.lang.String)}. */ * {@link net.bigeon.gclc.swt.io.ConsoleInputManager#setInput(java.lang.String)}. */
@Test @Test
public void testSetText() { public void testSetText() {
cim.setInput("Text"); cim.setInput("Text");
@ -63,7 +64,7 @@ public class ConsoleInputManagerTest {
} }
/** Test method for /** Test method for
* {@link net.bigeon.gclc.swt.ConsoleInputManager#validateInput()}. * {@link net.bigeon.gclc.swt.io.ConsoleInputManager#validateInput()}.
* *
* @throws IOException if an error occurred */ * @throws IOException if an error occurred */
@Test @Test
@ -101,7 +102,7 @@ public class ConsoleInputManagerTest {
} }
/** Test method for /** Test method for
* {@link net.bigeon.gclc.swt.ConsoleInputManager#getText()}. */ * {@link net.bigeon.gclc.swt.io.ConsoleInputManager#getText()}. */
@Test @Test
public void testGetText() { public void testGetText() {
assertEquals("Text component should be preserved", text, cim.getText()); assertEquals("Text component should be preserved", text, cim.getText());

View File

@ -49,6 +49,7 @@ import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer; import org.mockito.stubbing.Answer;
import net.bigeon.gclc.manager.PipedConsoleOutput; import net.bigeon.gclc.manager.PipedConsoleOutput;
import net.bigeon.gclc.swt.io.ConsoleOutputManager;
/** @author Emmanuel Bigeon */ /** @author Emmanuel Bigeon */
public class ConsoleOutputManagerTest { public class ConsoleOutputManagerTest {
@ -71,7 +72,7 @@ public class ConsoleOutputManagerTest {
} }
/** Test method for /** Test method for
* {@link net.bigeon.gclc.swt.ConsoleOutputManager#appendLine(java.lang.String)}. */ * {@link net.bigeon.gclc.swt.io.ConsoleOutputManager#appendLine(java.lang.String)}. */
@Test @Test
public void testAppendConsoleOutput() { public void testAppendConsoleOutput() {
when(text.getText()).thenReturn("", "abc", when(text.getText()).thenReturn("", "abc",

View File

@ -45,6 +45,8 @@ import java.io.BufferedReader;
import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Label;
import org.junit.Test; import org.junit.Test;
import net.bigeon.gclc.swt.io.ConsolePromptManager;
/** /**
* @author Emmanuel Bigeon * @author Emmanuel Bigeon
* *
@ -56,7 +58,7 @@ public class ConsolePromptManagerTest {
private final ConsolePromptManager manager = new ConsolePromptManager(label); private final ConsolePromptManager manager = new ConsolePromptManager(label);
/** /**
* Test method for {@link net.bigeon.gclc.swt.ConsolePromptManager#setPrompt(java.lang.String)}. * Test method for {@link net.bigeon.gclc.swt.io.ConsolePromptManager#setPrompt(java.lang.String)}.
*/ */
@Test @Test
public void testSetPrompt() { public void testSetPrompt() {
@ -65,7 +67,7 @@ public class ConsolePromptManagerTest {
} }
/** /**
* Test method for {@link net.bigeon.gclc.swt.ConsolePromptManager#setStream(java.io.BufferedReader)}. * Test method for {@link net.bigeon.gclc.swt.io.ConsolePromptManager#setStream(java.io.BufferedReader)}.
*/ */
@Test @Test
public void testSetStream() { public void testSetStream() {

View File

@ -75,6 +75,9 @@ import org.eclipse.swt.SWT;
import org.eclipse.swt.events.KeyEvent; import org.eclipse.swt.events.KeyEvent;
import org.junit.Test; import org.junit.Test;
import net.bigeon.gclc.swt.api.ConsoleDelayIO;
import net.bigeon.gclc.swt.tools.HistoryTextKeyListener;
/** /**
* <p> * <p>
* TODO * TODO
@ -83,7 +86,7 @@ import org.junit.Test;
public class HistoryTextKeyListenerTest { public class HistoryTextKeyListenerTest {
/** Test method for /** Test method for
* {@link net.bigeon.gclc.swt.HistoryTextKeyListener#keyPressed(org.eclipse.swt.events.KeyEvent)}. */ * {@link net.bigeon.gclc.swt.tools.HistoryTextKeyListener#keyPressed(org.eclipse.swt.events.KeyEvent)}. */
@Test @Test
public final void testKeyPressedKeyEvent() { public final void testKeyPressedKeyEvent() {
final ConsoleDelayIO io = new ConsoleDelayIO() { final ConsoleDelayIO io = new ConsoleDelayIO() {