Removed duplicate method. Added test on swt console view

Signed-off-by: Emmanuel Bigeon <emmanuel@bigeon.fr>
This commit is contained in:
Emmanuel Bigeon 2016-12-04 09:55:51 -05:00
parent 3b6ba337f1
commit d2bc86fffc
2 changed files with 8 additions and 8 deletions

View File

@ -180,13 +180,6 @@ public class SWTConsoleView extends Composite implements ConsoleDelayIO {
consoleInput.setText(string); consoleInput.setText(string);
} }
/**
*
*/
public void validateCommand() {
validateInput();
}
/* (non-Javadoc) /* (non-Javadoc)
* @see fr.bigeon.gclc.swt.ConsoleDelayIO#setInput(java.lang.String) */ * @see fr.bigeon.gclc.swt.ConsoleDelayIO#setInput(java.lang.String) */
@Override @Override

View File

@ -38,6 +38,8 @@
*/ */
package fr.bigeon.gclc.swt; package fr.bigeon.gclc.swt;
import static org.junit.Assert.assertNull;
import java.io.IOException; import java.io.IOException;
import org.eclipse.swt.SWT; import org.eclipse.swt.SWT;
@ -65,6 +67,11 @@ public class SWTConsoleViewTest {
public void test() { public void test() {
final Shell shell = new Shell(DISPLAY); final Shell shell = new Shell(DISPLAY);
final SWTConsoleView swtConsole = new SWTConsoleView(shell, SWT.NONE); final SWTConsoleView swtConsole = new SWTConsoleView(shell, SWT.NONE);
try (PipedConsoleManager manager = new PipedConsoleManager()) {
swtConsole.setManager(manager);
} catch (IOException e2) {
assertNull(e2);
}
try (PipedConsoleManager manager = new PipedConsoleManager()) { try (PipedConsoleManager manager = new PipedConsoleManager()) {
swtConsole.setManager(manager); swtConsole.setManager(manager);
final ConsoleApplication appl = new ConsoleApplication(manager, final ConsoleApplication appl = new ConsoleApplication(manager,
@ -110,7 +117,7 @@ public class SWTConsoleViewTest {
@Override @Override
public void run() { public void run() {
swtConsole.setText("test"); //$NON-NLS-1$ swtConsole.setText("test"); //$NON-NLS-1$
swtConsole.validateCommand(); swtConsole.validateInput();
} }
}); });
try { try {