mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 18:59:06 +01:00
Replaced Timer with ScheduledExecutorService. #258
This commit is contained in:
@@ -42,6 +42,7 @@ import org.briarproject.introduction.MessageSender;
|
||||
import org.briarproject.lifecycle.LifecycleModule;
|
||||
import org.briarproject.properties.PropertiesModule;
|
||||
import org.briarproject.sync.SyncModule;
|
||||
import org.briarproject.system.SystemModule;
|
||||
import org.briarproject.transport.TransportModule;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
@@ -944,6 +945,7 @@ public class IntroductionIntegrationTest extends BriarTestCase {
|
||||
this.accept = accept;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void eventOccurred(Event e) {
|
||||
if (e instanceof MessageValidatedEvent) {
|
||||
MessageValidatedEvent event = (MessageValidatedEvent) e;
|
||||
@@ -1010,6 +1012,7 @@ public class IntroductionIntegrationTest extends BriarTestCase {
|
||||
public volatile boolean response2Received = false;
|
||||
public volatile boolean aborted = false;
|
||||
|
||||
@Override
|
||||
public void eventOccurred(Event e) {
|
||||
if (e instanceof MessageValidatedEvent) {
|
||||
MessageValidatedEvent event = (MessageValidatedEvent) e;
|
||||
@@ -1050,7 +1053,7 @@ public class IntroductionIntegrationTest extends BriarTestCase {
|
||||
component.inject(new ContactModule.EagerSingletons());
|
||||
component.inject(new TransportModule.EagerSingletons());
|
||||
component.inject(new SyncModule.EagerSingletons());
|
||||
component.inject(new SystemModule.EagerSingletons());
|
||||
component.inject(new PropertiesModule.EagerSingletons());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ import org.briarproject.introduction.MessageSender;
|
||||
import org.briarproject.lifecycle.LifecycleModule;
|
||||
import org.briarproject.properties.PropertiesModule;
|
||||
import org.briarproject.sync.SyncModule;
|
||||
import org.briarproject.system.SystemModule;
|
||||
import org.briarproject.transport.TransportModule;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
@@ -29,9 +30,9 @@ import dagger.Component;
|
||||
|
||||
@Singleton
|
||||
@Component(modules = {
|
||||
TestSystemModule.class,
|
||||
TestDatabaseModule.class,
|
||||
TestPluginsModule.class,
|
||||
TestSeedProviderModule.class,
|
||||
LifecycleModule.class,
|
||||
IntroductionModule.class,
|
||||
DatabaseModule.class,
|
||||
@@ -42,6 +43,7 @@ import dagger.Component;
|
||||
TransportModule.class,
|
||||
ClientsModule.class,
|
||||
SyncModule.class,
|
||||
SystemModule.class,
|
||||
DataModule.class,
|
||||
PropertiesModule.class
|
||||
})
|
||||
@@ -61,6 +63,8 @@ public interface IntroductionIntegrationTestComponent {
|
||||
|
||||
void inject(SyncModule.EagerSingletons init);
|
||||
|
||||
void inject(SystemModule.EagerSingletons init);
|
||||
|
||||
void inject(TransportModule.EagerSingletons init);
|
||||
|
||||
LifecycleManager getLifecycleManager();
|
||||
@@ -84,5 +88,4 @@ public interface IntroductionIntegrationTestComponent {
|
||||
MessageSender getMessageSender();
|
||||
|
||||
IntroductionGroupFactory getIntroductionGroupFactory();
|
||||
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import org.briarproject.api.messaging.PrivateMessage;
|
||||
import org.briarproject.api.messaging.PrivateMessageFactory;
|
||||
import org.briarproject.api.sync.GroupId;
|
||||
import org.briarproject.api.sync.MessageId;
|
||||
import org.briarproject.system.SystemModule;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.inject.Inject;
|
||||
@@ -39,6 +40,7 @@ public class MessageSizeIntegrationTest extends BriarTestCase {
|
||||
MessageSizeIntegrationTestComponent component =
|
||||
DaggerMessageSizeIntegrationTestComponent.builder().build();
|
||||
component.inject(this);
|
||||
component.inject(new SystemModule.EagerSingletons());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -9,6 +9,7 @@ import org.briarproject.forum.ForumModule;
|
||||
import org.briarproject.identity.IdentityModule;
|
||||
import org.briarproject.messaging.MessagingModule;
|
||||
import org.briarproject.sync.SyncModule;
|
||||
import org.briarproject.system.SystemModule;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
|
||||
@@ -18,7 +19,7 @@ import dagger.Component;
|
||||
@Component(modules = {
|
||||
TestDatabaseModule.class,
|
||||
TestLifecycleModule.class,
|
||||
TestSystemModule.class,
|
||||
TestSeedProviderModule.class,
|
||||
ClientsModule.class,
|
||||
CryptoModule.class,
|
||||
DataModule.class,
|
||||
@@ -27,8 +28,12 @@ import dagger.Component;
|
||||
ForumModule.class,
|
||||
IdentityModule.class,
|
||||
MessagingModule.class,
|
||||
SyncModule.class
|
||||
SyncModule.class,
|
||||
SystemModule.class
|
||||
})
|
||||
public interface MessageSizeIntegrationTestComponent {
|
||||
|
||||
void inject(MessageSizeIntegrationTest testCase);
|
||||
|
||||
void inject(SystemModule.EagerSingletons init);
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ import org.briarproject.api.transport.KeyManager;
|
||||
import org.briarproject.api.transport.StreamContext;
|
||||
import org.briarproject.api.transport.StreamReaderFactory;
|
||||
import org.briarproject.api.transport.StreamWriterFactory;
|
||||
import org.briarproject.system.SystemModule;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
@@ -57,8 +58,10 @@ public class SimplexMessagingIntegrationTest extends BriarTestCase {
|
||||
assertTrue(testDir.mkdirs());
|
||||
alice = DaggerSimplexMessagingIntegrationTestComponent.builder()
|
||||
.testDatabaseModule(new TestDatabaseModule(aliceDir)).build();
|
||||
alice.inject(new SystemModule.EagerSingletons());
|
||||
bob = DaggerSimplexMessagingIntegrationTestComponent.builder()
|
||||
.testDatabaseModule(new TestDatabaseModule(bobDir)).build();
|
||||
bob.inject(new SystemModule.EagerSingletons());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -183,6 +186,7 @@ public class SimplexMessagingIntegrationTest extends BriarTestCase {
|
||||
|
||||
private volatile boolean messageAdded = false;
|
||||
|
||||
@Override
|
||||
public void eventOccurred(Event e) {
|
||||
if (e instanceof MessageAddedEvent) messageAdded = true;
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ import org.briarproject.lifecycle.LifecycleModule;
|
||||
import org.briarproject.messaging.MessagingModule;
|
||||
import org.briarproject.plugins.PluginsModule;
|
||||
import org.briarproject.sync.SyncModule;
|
||||
import org.briarproject.system.SystemModule;
|
||||
import org.briarproject.transport.TransportModule;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
@@ -31,7 +32,7 @@ import dagger.Component;
|
||||
@Component(modules = {
|
||||
TestDatabaseModule.class,
|
||||
TestPluginsModule.class,
|
||||
TestSystemModule.class,
|
||||
TestSeedProviderModule.class,
|
||||
ClientsModule.class,
|
||||
ContactModule.class,
|
||||
CryptoModule.class,
|
||||
@@ -43,11 +44,12 @@ import dagger.Component;
|
||||
MessagingModule.class,
|
||||
PluginsModule.class,
|
||||
SyncModule.class,
|
||||
SystemModule.class,
|
||||
TransportModule.class
|
||||
})
|
||||
public interface SimplexMessagingIntegrationTestComponent {
|
||||
|
||||
void inject(SimplexMessagingIntegrationTest testCase);
|
||||
void inject(SystemModule.EagerSingletons init);
|
||||
|
||||
LifecycleManager getLifecycleManager();
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import dagger.Component;
|
||||
|
||||
@Singleton
|
||||
@Component(modules = {
|
||||
TestSystemModule.class,
|
||||
TestSeedProviderModule.class,
|
||||
CryptoModule.class,
|
||||
SyncModule.class,
|
||||
TransportModule.class
|
||||
|
||||
Reference in New Issue
Block a user