Made shell invisible in tests. added shell style access

Signed-off-by: Emmanuel Bigeon <emmanuel@bigeon.fr>
This commit is contained in:
2018-10-15 12:19:23 -04:00
parent d49a2474e0
commit 8d51733590
4 changed files with 17 additions and 13 deletions

View File

@@ -75,6 +75,7 @@ import static org.junit.Assert.fail;
import java.io.IOException;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.junit.Test;
@@ -99,7 +100,7 @@ public class SWTConsoleShellTest {
@Test
public void test() {
final SWTConsoleShell shell = new SWTConsoleShell(DISPLAY);
final SWTConsoleShell shell = new SWTConsoleShell(DISPLAY, SWT.SHELL_TRIM);
final SWTConsole swtConsole = shell.getManager();
try {
final ConsoleApplication appl = new ConsoleApplication(swtConsole, swtConsole,
@@ -138,6 +139,7 @@ public class SWTConsoleShellTest {
});
// shell.pack();
shell.open();
shell.setVisible(false);
final Thread applThread = new Thread(new Runnable() {
@Override
@@ -159,7 +161,7 @@ public class SWTConsoleShellTest {
@Override
public void run() {
swtConsole.setText("test"); //$NON-NLS-1$
swtConsole.validateCommand();
swtConsole.validateInput();
}
});
try {
@@ -198,7 +200,7 @@ public class SWTConsoleShellTest {
@Test
public void testConsoleClose() {
final SWTConsoleShell shell = new SWTConsoleShell(DISPLAY);
final SWTConsoleShell shell = new SWTConsoleShell(DISPLAY, SWT.SHELL_TRIM);
final SWTConsole swtConsole = shell.getManager();
swtConsole.close();
swtConsole.setPrompt(":");
@@ -267,6 +269,7 @@ public class SWTConsoleShellTest {
});
// shell.pack();
shell.open();
shell.setVisible(false);
final Thread applThread = new Thread(new Runnable() {
@Override
@@ -288,7 +291,7 @@ public class SWTConsoleShellTest {
@Override
public void run() {
swtConsole.setText("test"); //$NON-NLS-1$
swtConsole.validateCommand();
swtConsole.validateInput();
}
});
Display.getDefault().syncExec(new Runnable() {
@@ -297,28 +300,28 @@ public class SWTConsoleShellTest {
swtConsole.setText("ok"); //$NON-NLS-1$
}
});
swtConsole.validateCommand();
swtConsole.validateInput();
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {
swtConsole.setText("long"); //$NON-NLS-1$
}
});
swtConsole.validateCommand();
swtConsole.validateInput();
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {
swtConsole.setText("test"); //$NON-NLS-1$
}
});
swtConsole.validateCommand();
swtConsole.validateInput();
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {
swtConsole.setText("test"); //$NON-NLS-1$
}
});
swtConsole.validateCommand();
swtConsole.validateInput();
try {
Thread.sleep(TWO_SECONDS);
} catch (final InterruptedException e) {

View File

@@ -147,6 +147,7 @@ public class SWTConsoleViewTest {
});
// shell.pack();
shell.open();
shell.setVisible(false);
final Thread applThread = new Thread(new Runnable() {
@Override