Fixed thread surviving the application lifespan.

+tests in swt.

Signed-off-by: Emmanuel Bigeon <emmanuel@bigeon.fr>
This commit is contained in:
2016-12-03 20:18:20 -05:00
parent 24f1fba97e
commit 543b1ef605
9 changed files with 179 additions and 144 deletions

View File

@@ -58,7 +58,7 @@ public class AOutputForwardRunnableTest {
* @author Emmanuel Bigeon */
private final class AOutputForwardTestRunnable
extends AOutputForwardRunnable {
private int count = 1;
private int count = 2;
private String message;
/** @param manager */
@@ -117,11 +117,20 @@ public class AOutputForwardRunnableTest {
manager);
Thread th = new Thread(runnable, "forward");
th.start();
manager.println("before");
th.start();
assertEquals("before", runnable.getMessage());
synchronized (this) {
wait(3000);
}
manager.println("after");
assertEquals("after", runnable.getMessage());
synchronized (this) {
wait(3000);
}
th.join();
} catch (IOException | InterruptedException e) {