Compare commits
14 Commits
gclc-1.3.4
...
gclc-swt-1
| Author | SHA1 | Date | |
|---|---|---|---|
| c9eb221d31 | |||
| 340a0317af | |||
| 35959a8d8a | |||
| 07645d7c0c | |||
| 99c0c9008b | |||
| 26265ad7e6 | |||
| 092883f4c3 | |||
| 25904c907d | |||
| ae55ebea29 | |||
| e989aff2f4 | |||
| 2f0c03a73b | |||
| ff9ace1033 | |||
| ffa54af3be | |||
| 269704f5a2 |
@@ -70,7 +70,7 @@ of Emmanuel Bigeon. -->
|
|||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<artifactId>gclc-socket</artifactId>
|
<artifactId>gclc-socket</artifactId>
|
||||||
<version>1.1.7-SNAPSHOT</version>
|
<version>1.1.8-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<url>http://www.bigeon.fr/emmanuel</url>
|
<url>http://www.bigeon.fr/emmanuel</url>
|
||||||
<properties>
|
<properties>
|
||||||
@@ -81,7 +81,7 @@ of Emmanuel Bigeon. -->
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>fr.bigeon</groupId>
|
<groupId>fr.bigeon</groupId>
|
||||||
<artifactId>gclc</artifactId>
|
<artifactId>gclc</artifactId>
|
||||||
<version>1.3.4-SNAPSHOT</version>
|
<version>1.3.6</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>fr.bigeon</groupId>
|
<groupId>fr.bigeon</groupId>
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<artifactId>gclc-swt</artifactId>
|
<artifactId>gclc-swt</artifactId>
|
||||||
<version>1.1.3-SNAPSHOT</version>
|
<version>1.1.3</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<url>http://www.bigeon.fr/emmanuel</url>
|
<url>http://www.bigeon.fr/emmanuel</url>
|
||||||
<properties>
|
<properties>
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>fr.bigeon</groupId>
|
<groupId>fr.bigeon</groupId>
|
||||||
<artifactId>gclc</artifactId>
|
<artifactId>gclc</artifactId>
|
||||||
<version>1.3.4-SNAPSHOT</version>
|
<version>1.3.6</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>fr.bigeon</groupId>
|
<groupId>fr.bigeon</groupId>
|
||||||
@@ -64,7 +64,7 @@
|
|||||||
<description>provide a swt window for console applications</description>
|
<description>provide a swt window for console applications</description>
|
||||||
<scm>
|
<scm>
|
||||||
<developerConnection>scm:git:gogs@git.code.bigeon.net:emmanuel/gclc.git</developerConnection>
|
<developerConnection>scm:git:gogs@git.code.bigeon.net:emmanuel/gclc.git</developerConnection>
|
||||||
<tag>HEAD</tag>
|
<tag>gclc-swt-1.1.3</tag>
|
||||||
</scm>
|
</scm>
|
||||||
<profiles>
|
<profiles>
|
||||||
<profile>
|
<profile>
|
||||||
|
|||||||
@@ -43,8 +43,6 @@ import java.util.logging.Level;
|
|||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
import org.eclipse.swt.SWT;
|
import org.eclipse.swt.SWT;
|
||||||
import org.eclipse.swt.events.FocusAdapter;
|
|
||||||
import org.eclipse.swt.events.FocusEvent;
|
|
||||||
import org.eclipse.swt.layout.GridData;
|
import org.eclipse.swt.layout.GridData;
|
||||||
import org.eclipse.swt.layout.GridLayout;
|
import org.eclipse.swt.layout.GridLayout;
|
||||||
import org.eclipse.swt.widgets.Composite;
|
import org.eclipse.swt.widgets.Composite;
|
||||||
@@ -101,13 +99,6 @@ public class SWTConsole extends Composite
|
|||||||
consoleOutput.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true,
|
consoleOutput.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true,
|
||||||
LAYOUT_NB_COLUMNS, 1));
|
LAYOUT_NB_COLUMNS, 1));
|
||||||
consoleOutput.setRedraw(true);
|
consoleOutput.setRedraw(true);
|
||||||
consoleOutput.addFocusListener(new FocusAdapter() {
|
|
||||||
@SuppressWarnings("synthetic-access")
|
|
||||||
@Override
|
|
||||||
public void focusGained(FocusEvent e) {
|
|
||||||
consoleInput.setFocus();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
lblPromptlabel = new Label(this, SWT.NONE);
|
lblPromptlabel = new Label(this, SWT.NONE);
|
||||||
lblPromptlabel.setText(prompt);
|
lblPromptlabel.setText(prompt);
|
||||||
|
|||||||
@@ -43,8 +43,6 @@ import java.util.logging.Level;
|
|||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
import org.eclipse.swt.SWT;
|
import org.eclipse.swt.SWT;
|
||||||
import org.eclipse.swt.events.FocusAdapter;
|
|
||||||
import org.eclipse.swt.events.FocusEvent;
|
|
||||||
import org.eclipse.swt.layout.GridData;
|
import org.eclipse.swt.layout.GridData;
|
||||||
import org.eclipse.swt.layout.GridLayout;
|
import org.eclipse.swt.layout.GridLayout;
|
||||||
import org.eclipse.swt.widgets.Composite;
|
import org.eclipse.swt.widgets.Composite;
|
||||||
@@ -115,13 +113,6 @@ public class SWTConsoleView extends Composite implements ConsoleDelayIO {
|
|||||||
consoleOutput.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true,
|
consoleOutput.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true,
|
||||||
1, 1));
|
1, 1));
|
||||||
consoleOutput.setRedraw(true);
|
consoleOutput.setRedraw(true);
|
||||||
consoleOutput.addFocusListener(new FocusAdapter() {
|
|
||||||
@SuppressWarnings("synthetic-access")
|
|
||||||
@Override
|
|
||||||
public void focusGained(FocusEvent e) {
|
|
||||||
consoleInput.setFocus();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
consoleInput = new Text(this, SWT.BORDER);
|
consoleInput = new Text(this, SWT.BORDER);
|
||||||
consoleInput.setLayoutData(
|
consoleInput.setLayoutData(
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<artifactId>gclc</artifactId>
|
<artifactId>gclc</artifactId>
|
||||||
<version>1.3.4</version>
|
<version>1.3.7-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<url>http://www.bigeon.fr/emmanuel</url>
|
<url>http://www.bigeon.fr/emmanuel</url>
|
||||||
<properties>
|
<properties>
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>fr.bigeon</groupId>
|
<groupId>fr.bigeon</groupId>
|
||||||
<artifactId>ebigeon-config</artifactId>
|
<artifactId>ebigeon-config</artifactId>
|
||||||
<version>1.7.0</version>
|
<version>1.7.1</version>
|
||||||
</parent>
|
</parent>
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
@@ -83,6 +83,6 @@
|
|||||||
<scm>
|
<scm>
|
||||||
|
|
||||||
<developerConnection>scm:git:gogs@git.code.bigeon.net:emmanuel/gclc.git</developerConnection>
|
<developerConnection>scm:git:gogs@git.code.bigeon.net:emmanuel/gclc.git</developerConnection>
|
||||||
<tag>gclc-1.3.4</tag>
|
<tag>gclc-1.3.5</tag>
|
||||||
</scm>
|
</scm>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ import static org.junit.Assert.assertFalse;
|
|||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
import static org.junit.Assert.assertNull;
|
import static org.junit.Assert.assertNull;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
|
import static org.junit.Assert.fail;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
@@ -55,7 +56,6 @@ import fr.bigeon.gclc.exception.CommandRunExceptionType;
|
|||||||
import fr.bigeon.gclc.exception.InvalidCommandName;
|
import fr.bigeon.gclc.exception.InvalidCommandName;
|
||||||
import fr.bigeon.gclc.i18n.Messages;
|
import fr.bigeon.gclc.i18n.Messages;
|
||||||
import fr.bigeon.gclc.manager.ConsoleManager;
|
import fr.bigeon.gclc.manager.ConsoleManager;
|
||||||
import fr.bigeon.gclc.manager.SystemConsoleManager;
|
|
||||||
import fr.bigeon.gclc.manager.PipedConsoleManager;
|
import fr.bigeon.gclc.manager.PipedConsoleManager;
|
||||||
|
|
||||||
/** Test class for ConsoleApplication
|
/** Test class for ConsoleApplication
|
||||||
@@ -70,9 +70,14 @@ public class ConsoleApplicationTest {
|
|||||||
/** Test the base of a console application */
|
/** Test the base of a console application */
|
||||||
@Test
|
@Test
|
||||||
public void test() {
|
public void test() {
|
||||||
ConsoleTestApplication app = new ConsoleTestApplication(
|
|
||||||
new SystemConsoleManager());
|
try (PipedConsoleManager manager = new PipedConsoleManager()) {
|
||||||
|
ConsoleTestApplication app = new ConsoleTestApplication(manager);
|
||||||
app.exit();
|
app.exit();
|
||||||
|
} catch (IOException e) {
|
||||||
|
fail("System Console Manager failed");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -156,7 +161,10 @@ public class ConsoleApplicationTest {
|
|||||||
manager.type("exit");
|
manager.type("exit");
|
||||||
th.join();
|
th.join();
|
||||||
|
|
||||||
} catch (IOException | InvalidCommandName | InterruptedException e) {
|
} catch (IOException | InvalidCommandName |
|
||||||
|
|
||||||
|
InterruptedException e) {
|
||||||
|
|
||||||
assertNull(e);
|
assertNull(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ import java.io.InputStream;
|
|||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.io.PipedInputStream;
|
import java.io.PipedInputStream;
|
||||||
import java.io.PipedOutputStream;
|
import java.io.PipedOutputStream;
|
||||||
|
import java.nio.charset.Charset;
|
||||||
|
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
@@ -110,17 +111,15 @@ public class ReadingRunnableTest {
|
|||||||
final ReadingRunnable runnable = new ReadingRunnable(reader);
|
final ReadingRunnable runnable = new ReadingRunnable(reader);
|
||||||
Thread th0 = new Thread(runnable, "read");
|
Thread th0 = new Thread(runnable, "read");
|
||||||
th0.start();
|
th0.start();
|
||||||
Thread th = runnable.getWaitForDelivery("");
|
Thread th = runnable.getWaitForDelivery("msg");
|
||||||
|
|
||||||
final Object start = new Object();
|
out.write(Charset.forName("UTF-8")
|
||||||
|
.encode("msg" + System.lineSeparator()).array());
|
||||||
|
|
||||||
Thread th2 = new Thread(new Runnable() {
|
Thread th2 = new Thread(new Runnable() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
synchronized (start) {
|
|
||||||
start.notify();
|
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
runnable.getMessage();
|
runnable.getMessage();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
@@ -129,11 +128,7 @@ public class ReadingRunnableTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, "get");
|
}, "get");
|
||||||
synchronized (start) {
|
|
||||||
th2.start();
|
th2.start();
|
||||||
start.wait();
|
|
||||||
}
|
|
||||||
runnable.interrupt();
|
|
||||||
try {
|
try {
|
||||||
th.join();
|
th.join();
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
|
|||||||
@@ -65,13 +65,12 @@ public class SystemConsoleManagerTest {
|
|||||||
@Test
|
@Test
|
||||||
public final void testPrompt() {
|
public final void testPrompt() {
|
||||||
|
|
||||||
try {
|
final String test = "test";
|
||||||
PipedOutputStream outStream = new PipedOutputStream();
|
try (PipedOutputStream outStream = new PipedOutputStream();
|
||||||
InputStream in = new PipedInputStream(outStream);
|
InputStream in = new PipedInputStream(outStream);
|
||||||
final PrintStream out = new PrintStream(outStream);
|
final PrintStream out = new PrintStream(outStream);
|
||||||
final String test = "test";
|
|
||||||
SystemConsoleManager manager = new SystemConsoleManager(System.out,
|
SystemConsoleManager manager = new SystemConsoleManager(System.out,
|
||||||
in, Charset.forName("UTF-8"));
|
in, Charset.forName("UTF-8"))) {
|
||||||
|
|
||||||
Thread th = new Thread(new Runnable() {
|
Thread th = new Thread(new Runnable() {
|
||||||
|
|
||||||
@@ -95,10 +94,18 @@ public class SystemConsoleManagerTest {
|
|||||||
* {@link fr.bigeon.gclc.manager.SystemConsoleManager#setPrompt(java.lang.String)}. */
|
* {@link fr.bigeon.gclc.manager.SystemConsoleManager#setPrompt(java.lang.String)}. */
|
||||||
@Test
|
@Test
|
||||||
public final void testSetPrompt() {
|
public final void testSetPrompt() {
|
||||||
SystemConsoleManager manager = new SystemConsoleManager();
|
try (PipedOutputStream outStream = new PipedOutputStream();
|
||||||
|
InputStream in = new PipedInputStream(outStream);
|
||||||
|
final PrintStream out = new PrintStream(outStream);
|
||||||
|
SystemConsoleManager manager = new SystemConsoleManager(System.out,
|
||||||
|
in, Charset.forName("UTF-8"))) {
|
||||||
|
|
||||||
String prt = "++";
|
String prt = "++";
|
||||||
manager.setPrompt(prt);
|
manager.setPrompt(prt);
|
||||||
assertEquals(prt, manager.getPrompt());
|
assertEquals(prt, manager.getPrompt());
|
||||||
|
} catch (IOException e) {
|
||||||
|
assertNull(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Test method for
|
/** Test method for
|
||||||
|
|||||||
Reference in New Issue
Block a user