Refactored PluginManager and Poller to remove non-open calls. Bug #15.

This commit is contained in:
akwizgran
2014-11-08 15:40:51 +00:00
parent c2d6e9afde
commit 4009561996
5 changed files with 33 additions and 33 deletions

View File

@@ -76,6 +76,9 @@ public class PluginManagerImplTest extends BriarTestCase {
will(returnValue(true));
oneOf(simplexPlugin).start();
will(returnValue(true)); // Started
oneOf(simplexPlugin).shouldPoll();
will(returnValue(true));
oneOf(poller).addPlugin(simplexPlugin);
// Second simplex plugin
oneOf(simplexFailFactory).getId();
will(returnValue(simplexFailId));
@@ -102,14 +105,14 @@ public class PluginManagerImplTest extends BriarTestCase {
will(returnValue(true));
oneOf(duplexPlugin).start();
will(returnValue(true)); // Started
oneOf(duplexPlugin).shouldPoll();
will(returnValue(false));
// Second duplex plugin
oneOf(duplexFailFactory).getId();
will(returnValue(duplexFailId));
oneOf(duplexFailFactory).createPlugin(with(any(
DuplexPluginCallback.class)));
will(returnValue(null)); // Failed to create a plugin
// Start the poller
oneOf(poller).start(Arrays.asList(simplexPlugin, duplexPlugin));
// Stop the poller
oneOf(poller).stop();
// Stop the plugins