return the Thread object for join()-ing

This commit is contained in:
zab2
2013-06-29 20:34:57 +00:00
parent 6b15caab4b
commit a0bf223031

View File

@ -29,11 +29,12 @@ abstract class StreamingTestBase extends TestCase {
protected abstract Runnable getClient(I2PAppContext ctx, I2PSession session); protected abstract Runnable getClient(I2PAppContext ctx, I2PSession session);
protected final void runClient(I2PAppContext ctx, I2PSession session) { protected final Thread runClient(I2PAppContext ctx, I2PSession session) {
Thread t = new Thread(getClient(ctx,session)); Thread t = new Thread(getClient(ctx,session));
t.setName("client"); t.setName("client");
t.setDaemon(true); t.setDaemon(true);
t.start(); t.start();
return t;
} }
protected abstract class RunnerBase implements Runnable { protected abstract class RunnerBase implements Runnable {
@ -51,10 +52,11 @@ abstract class StreamingTestBase extends TestCase {
protected abstract Runnable getServer(I2PAppContext ctx, I2PSession session); protected abstract Runnable getServer(I2PAppContext ctx, I2PSession session);
protected final void runServer(I2PAppContext ctx, I2PSession session) { protected final Thread runServer(I2PAppContext ctx, I2PSession session) {
Thread t = new Thread(getServer(ctx,session)); Thread t = new Thread(getServer(ctx,session));
t.setName("servert"); t.setName("servert");
t.setDaemon(false); t.setDaemon(false);
t.start(); t.start();
return t;
} }
} }