mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-15 12:19:54 +01:00
Fix test expectations.
This commit is contained in:
@@ -9,6 +9,8 @@ import org.junit.Test;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import static org.briarproject.bramble.api.plugin.Plugin.State.ACTIVE;
|
||||||
|
import static org.briarproject.bramble.api.plugin.Plugin.State.ENABLING;
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
import static org.junit.Assert.assertNull;
|
import static org.junit.Assert.assertNull;
|
||||||
|
|
||||||
@@ -33,6 +35,7 @@ public class ModemPluginTest extends BrambleMockTestCase {
|
|||||||
@Test
|
@Test
|
||||||
public void testModemCreation() throws Exception {
|
public void testModemCreation() throws Exception {
|
||||||
context.checking(new Expectations() {{
|
context.checking(new Expectations() {{
|
||||||
|
oneOf(callback).pluginStateChanged(ENABLING);
|
||||||
oneOf(serialPortList).getPortNames();
|
oneOf(serialPortList).getPortNames();
|
||||||
will(returnValue(new String[] {"foo", "bar", "baz"}));
|
will(returnValue(new String[] {"foo", "bar", "baz"}));
|
||||||
// First call to createModem() returns false
|
// First call to createModem() returns false
|
||||||
@@ -50,6 +53,7 @@ public class ModemPluginTest extends BrambleMockTestCase {
|
|||||||
will(returnValue(modem));
|
will(returnValue(modem));
|
||||||
oneOf(modem).start();
|
oneOf(modem).start();
|
||||||
will(returnValue(true));
|
will(returnValue(true));
|
||||||
|
oneOf(callback).pluginStateChanged(ACTIVE);
|
||||||
}});
|
}});
|
||||||
|
|
||||||
plugin.start();
|
plugin.start();
|
||||||
@@ -65,12 +69,14 @@ public class ModemPluginTest extends BrambleMockTestCase {
|
|||||||
|
|
||||||
context.checking(new Expectations() {{
|
context.checking(new Expectations() {{
|
||||||
// start()
|
// start()
|
||||||
|
oneOf(callback).pluginStateChanged(ENABLING);
|
||||||
oneOf(serialPortList).getPortNames();
|
oneOf(serialPortList).getPortNames();
|
||||||
will(returnValue(new String[] {"foo"}));
|
will(returnValue(new String[] {"foo"}));
|
||||||
oneOf(modemFactory).createModem(plugin, "foo");
|
oneOf(modemFactory).createModem(plugin, "foo");
|
||||||
will(returnValue(modem));
|
will(returnValue(modem));
|
||||||
oneOf(modem).start();
|
oneOf(modem).start();
|
||||||
will(returnValue(true));
|
will(returnValue(true));
|
||||||
|
oneOf(callback).pluginStateChanged(ACTIVE);
|
||||||
// createConnection()
|
// createConnection()
|
||||||
oneOf(callback).getLocalProperties();
|
oneOf(callback).getLocalProperties();
|
||||||
will(returnValue(local));
|
will(returnValue(local));
|
||||||
@@ -93,12 +99,14 @@ public class ModemPluginTest extends BrambleMockTestCase {
|
|||||||
|
|
||||||
context.checking(new Expectations() {{
|
context.checking(new Expectations() {{
|
||||||
// start()
|
// start()
|
||||||
|
oneOf(callback).pluginStateChanged(ENABLING);
|
||||||
oneOf(serialPortList).getPortNames();
|
oneOf(serialPortList).getPortNames();
|
||||||
will(returnValue(new String[] {"foo"}));
|
will(returnValue(new String[] {"foo"}));
|
||||||
oneOf(modemFactory).createModem(plugin, "foo");
|
oneOf(modemFactory).createModem(plugin, "foo");
|
||||||
will(returnValue(modem));
|
will(returnValue(modem));
|
||||||
oneOf(modem).start();
|
oneOf(modem).start();
|
||||||
will(returnValue(true));
|
will(returnValue(true));
|
||||||
|
oneOf(callback).pluginStateChanged(ACTIVE);
|
||||||
// createConnection()
|
// createConnection()
|
||||||
oneOf(callback).getLocalProperties();
|
oneOf(callback).getLocalProperties();
|
||||||
will(returnValue(local));
|
will(returnValue(local));
|
||||||
@@ -121,12 +129,14 @@ public class ModemPluginTest extends BrambleMockTestCase {
|
|||||||
|
|
||||||
context.checking(new Expectations() {{
|
context.checking(new Expectations() {{
|
||||||
// start()
|
// start()
|
||||||
|
oneOf(callback).pluginStateChanged(ENABLING);
|
||||||
oneOf(serialPortList).getPortNames();
|
oneOf(serialPortList).getPortNames();
|
||||||
will(returnValue(new String[] {"foo"}));
|
will(returnValue(new String[] {"foo"}));
|
||||||
oneOf(modemFactory).createModem(plugin, "foo");
|
oneOf(modemFactory).createModem(plugin, "foo");
|
||||||
will(returnValue(modem));
|
will(returnValue(modem));
|
||||||
oneOf(modem).start();
|
oneOf(modem).start();
|
||||||
will(returnValue(true));
|
will(returnValue(true));
|
||||||
|
oneOf(callback).pluginStateChanged(ACTIVE);
|
||||||
// createConnection()
|
// createConnection()
|
||||||
oneOf(callback).getLocalProperties();
|
oneOf(callback).getLocalProperties();
|
||||||
will(returnValue(local));
|
will(returnValue(local));
|
||||||
|
|||||||
Reference in New Issue
Block a user