Fixed thread surviving the application lifespan.
+tests in swt. Signed-off-by: Emmanuel Bigeon <emmanuel@bigeon.fr>
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user