mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-14 11:49:04 +01:00
Create two new events to signal enabling and disabling of transports
This commit is contained in:
@@ -100,11 +100,13 @@ public abstract class DuplexClientTest extends DuplexTest {
|
||||
|
||||
public void showMessage(String... message) {}
|
||||
|
||||
public void pollNow() {}
|
||||
|
||||
public void incomingConnectionCreated(DuplexTransportConnection d) {}
|
||||
|
||||
public void outgoingConnectionCreated(ContactId contactId,
|
||||
DuplexTransportConnection d) {}
|
||||
|
||||
public void transportEnabled() {}
|
||||
|
||||
public void transportDisabled() {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,8 +99,6 @@ public abstract class DuplexServerTest extends DuplexTest {
|
||||
|
||||
public void showMessage(String... message) {}
|
||||
|
||||
public void pollNow() {}
|
||||
|
||||
public void incomingConnectionCreated(DuplexTransportConnection d) {
|
||||
System.out.println("Connection received");
|
||||
sendChallengeReceiveResponse(d);
|
||||
@@ -109,5 +107,9 @@ public abstract class DuplexServerTest extends DuplexTest {
|
||||
|
||||
public void outgoingConnectionCreated(ContactId c,
|
||||
DuplexTransportConnection d) {}
|
||||
|
||||
public void transportEnabled() {}
|
||||
|
||||
public void transportDisabled() {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@ package org.briarproject.plugins;
|
||||
import org.briarproject.BriarTestCase;
|
||||
import org.briarproject.api.TransportId;
|
||||
import org.briarproject.api.db.DatabaseComponent;
|
||||
import org.briarproject.api.event.EventBus;
|
||||
import org.briarproject.api.lifecycle.IoExecutor;
|
||||
import org.briarproject.api.plugins.ConnectionManager;
|
||||
import org.briarproject.api.plugins.duplex.DuplexPlugin;
|
||||
import org.briarproject.api.plugins.duplex.DuplexPluginCallback;
|
||||
@@ -32,6 +34,7 @@ public class PluginManagerImplTest extends BriarTestCase {
|
||||
Clock clock = new SystemClock();
|
||||
Mockery context = new Mockery();
|
||||
final Executor ioExecutor = Executors.newCachedThreadPool();
|
||||
final EventBus eventBus = context.mock(EventBus.class);
|
||||
final SimplexPluginConfig simplexPluginConfig =
|
||||
context.mock(SimplexPluginConfig.class);
|
||||
final DuplexPluginConfig duplexPluginConfig =
|
||||
@@ -121,9 +124,10 @@ public class PluginManagerImplTest extends BriarTestCase {
|
||||
oneOf(simplexPlugin).stop();
|
||||
oneOf(duplexPlugin).stop();
|
||||
}});
|
||||
PluginManagerImpl p = new PluginManagerImpl(ioExecutor,
|
||||
PluginManagerImpl p = new PluginManagerImpl(ioExecutor, eventBus,
|
||||
simplexPluginConfig, duplexPluginConfig, clock, db, poller,
|
||||
dispatcher, uiCallback);
|
||||
|
||||
// Two plugins should be started and stopped
|
||||
assertTrue(p.start());
|
||||
assertTrue(p.stop());
|
||||
|
||||
@@ -205,13 +205,15 @@ public class LanTcpPluginTest extends BriarTestCase {
|
||||
|
||||
public void showMessage(String... message) {}
|
||||
|
||||
public void pollNow() {}
|
||||
|
||||
public void incomingConnectionCreated(DuplexTransportConnection d) {
|
||||
connectionsLatch.countDown();
|
||||
}
|
||||
|
||||
public void outgoingConnectionCreated(ContactId c,
|
||||
DuplexTransportConnection d) {}
|
||||
|
||||
public void transportEnabled() {}
|
||||
|
||||
public void transportDisabled() {}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user