mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-14 03:39:05 +01:00
Merged IncomingConnectionExecutor and PluginExecutor into IoExecutor.
We don't need two separate executors for long-running IO threads.
This commit is contained in:
@@ -29,7 +29,7 @@ public class PluginManagerImplTest extends BriarTestCase {
|
||||
public void testStartAndStop() throws Exception {
|
||||
Clock clock = new SystemClock();
|
||||
Mockery context = new Mockery();
|
||||
final Executor pluginExecutor = Executors.newCachedThreadPool();
|
||||
final Executor ioExecutor = Executors.newCachedThreadPool();
|
||||
final SimplexPluginConfig simplexPluginConfig =
|
||||
context.mock(SimplexPluginConfig.class);
|
||||
final DuplexPluginConfig duplexPluginConfig =
|
||||
@@ -116,7 +116,7 @@ public class PluginManagerImplTest extends BriarTestCase {
|
||||
oneOf(simplexPlugin).stop();
|
||||
oneOf(duplexPlugin).stop();
|
||||
}});
|
||||
PluginManagerImpl p = new PluginManagerImpl(pluginExecutor,
|
||||
PluginManagerImpl p = new PluginManagerImpl(ioExecutor,
|
||||
simplexPluginConfig, duplexPluginConfig, clock, db, poller,
|
||||
dispatcher, uiCallback);
|
||||
// Two plugins should be started and stopped
|
||||
|
||||
@@ -15,7 +15,6 @@ import org.briarproject.api.ContactId;
|
||||
import org.briarproject.api.TransportProperties;
|
||||
import org.briarproject.api.plugins.duplex.DuplexPluginCallback;
|
||||
import org.briarproject.api.plugins.duplex.DuplexTransportConnection;
|
||||
|
||||
import org.hamcrest.Description;
|
||||
import org.jmock.Expectations;
|
||||
import org.jmock.Mockery;
|
||||
@@ -194,8 +193,7 @@ public class ModemPluginTest extends BriarTestCase {
|
||||
|
||||
@Test
|
||||
public void testPolling() throws Exception {
|
||||
final ExecutorService pluginExecutor =
|
||||
Executors.newSingleThreadExecutor();
|
||||
final ExecutorService ioExecutor = Executors.newSingleThreadExecutor();
|
||||
Mockery context = new Mockery();
|
||||
final ModemFactory modemFactory = context.mock(ModemFactory.class);
|
||||
final SerialPortList serialPortList =
|
||||
@@ -203,7 +201,7 @@ public class ModemPluginTest extends BriarTestCase {
|
||||
final DuplexPluginCallback callback =
|
||||
context.mock(DuplexPluginCallback.class);
|
||||
// Disable shuffling for this test, it confuses jMock
|
||||
final ModemPlugin plugin = new ModemPlugin(pluginExecutor, modemFactory,
|
||||
final ModemPlugin plugin = new ModemPlugin(ioExecutor, modemFactory,
|
||||
serialPortList, callback, 0, 0, 0, false);
|
||||
final Modem modem = context.mock(Modem.class);
|
||||
final TransportProperties local = new TransportProperties();
|
||||
@@ -265,7 +263,7 @@ public class ModemPluginTest extends BriarTestCase {
|
||||
assertTrue(plugin.start());
|
||||
plugin.poll(Collections.<ContactId>emptyList());
|
||||
assertTrue(disposeAction.invoked.await(5, SECONDS));
|
||||
pluginExecutor.shutdown();
|
||||
ioExecutor.shutdown();
|
||||
context.assertIsSatisfied();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user