mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 19:29:06 +01:00
Moved some API classes into packages.
This commit is contained in:
@@ -3,14 +3,14 @@ package org.briarproject;
|
||||
import com.google.inject.Guice;
|
||||
import com.google.inject.Injector;
|
||||
|
||||
import org.briarproject.api.Author;
|
||||
import org.briarproject.api.AuthorFactory;
|
||||
import org.briarproject.api.ContactId;
|
||||
import org.briarproject.api.TransportId;
|
||||
import org.briarproject.api.TransportProperties;
|
||||
import org.briarproject.api.contact.ContactId;
|
||||
import org.briarproject.api.crypto.CryptoComponent;
|
||||
import org.briarproject.api.crypto.KeyPair;
|
||||
import org.briarproject.api.crypto.SecretKey;
|
||||
import org.briarproject.api.identity.Author;
|
||||
import org.briarproject.api.identity.AuthorFactory;
|
||||
import org.briarproject.api.sync.Ack;
|
||||
import org.briarproject.api.sync.Group;
|
||||
import org.briarproject.api.sync.GroupFactory;
|
||||
|
||||
@@ -1,39 +1,34 @@
|
||||
package org.briarproject;
|
||||
|
||||
import org.briarproject.api.Author;
|
||||
import org.briarproject.api.identity.Author;
|
||||
import org.briarproject.api.sync.Group;
|
||||
import org.briarproject.api.sync.Message;
|
||||
import org.briarproject.api.sync.MessageId;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.InputStream;
|
||||
|
||||
public class TestMessage implements Message {
|
||||
|
||||
private final MessageId id, parent;
|
||||
private final Group group;
|
||||
private final Author author;
|
||||
private final String contentType, subject;
|
||||
private final String contentType;
|
||||
private final long timestamp;
|
||||
private final byte[] raw;
|
||||
private final int bodyStart, bodyLength;
|
||||
|
||||
public TestMessage(MessageId id, MessageId parent, Group group,
|
||||
Author author, String contentType, String subject, long timestamp,
|
||||
byte[] raw) {
|
||||
this(id, parent, group, author, contentType, subject, timestamp, raw, 0,
|
||||
Author author, String contentType, long timestamp, byte[] raw) {
|
||||
this(id, parent, group, author, contentType, timestamp, raw, 0,
|
||||
raw.length);
|
||||
}
|
||||
|
||||
public TestMessage(MessageId id, MessageId parent, Group group,
|
||||
Author author, String contentType, String subject, long timestamp,
|
||||
byte[] raw, int bodyStart, int bodyLength) {
|
||||
Author author, String contentType, long timestamp, byte[] raw,
|
||||
int bodyStart, int bodyLength) {
|
||||
this.id = id;
|
||||
this.parent = parent;
|
||||
this.group = group;
|
||||
this.author = author;
|
||||
this.contentType = contentType;
|
||||
this.subject = subject;
|
||||
this.timestamp = timestamp;
|
||||
this.raw = raw;
|
||||
this.bodyStart = bodyStart;
|
||||
@@ -60,10 +55,6 @@ public class TestMessage implements Message {
|
||||
return contentType;
|
||||
}
|
||||
|
||||
public String getSubject() {
|
||||
return subject;
|
||||
}
|
||||
|
||||
public long getTimestamp() {
|
||||
return timestamp;
|
||||
}
|
||||
@@ -80,10 +71,6 @@ public class TestMessage implements Message {
|
||||
return bodyLength;
|
||||
}
|
||||
|
||||
public InputStream getSerialisedStream() {
|
||||
return new ByteArrayInputStream(raw);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return id.hashCode();
|
||||
|
||||
@@ -3,14 +3,11 @@ package org.briarproject.db;
|
||||
import org.briarproject.BriarTestCase;
|
||||
import org.briarproject.TestMessage;
|
||||
import org.briarproject.TestUtils;
|
||||
import org.briarproject.api.Author;
|
||||
import org.briarproject.api.AuthorId;
|
||||
import org.briarproject.api.Contact;
|
||||
import org.briarproject.api.ContactId;
|
||||
import org.briarproject.api.LocalAuthor;
|
||||
import org.briarproject.api.TransportConfig;
|
||||
import org.briarproject.api.TransportId;
|
||||
import org.briarproject.api.TransportProperties;
|
||||
import org.briarproject.api.contact.Contact;
|
||||
import org.briarproject.api.contact.ContactId;
|
||||
import org.briarproject.api.crypto.SecretKey;
|
||||
import org.briarproject.api.db.DatabaseComponent;
|
||||
import org.briarproject.api.db.NoSuchContactException;
|
||||
@@ -32,6 +29,9 @@ import org.briarproject.api.event.MessagesAckedEvent;
|
||||
import org.briarproject.api.event.MessagesSentEvent;
|
||||
import org.briarproject.api.event.SubscriptionAddedEvent;
|
||||
import org.briarproject.api.event.SubscriptionRemovedEvent;
|
||||
import org.briarproject.api.identity.Author;
|
||||
import org.briarproject.api.identity.AuthorId;
|
||||
import org.briarproject.api.identity.LocalAuthor;
|
||||
import org.briarproject.api.lifecycle.ShutdownManager;
|
||||
import org.briarproject.api.sync.Ack;
|
||||
import org.briarproject.api.sync.Group;
|
||||
@@ -55,7 +55,7 @@ import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
||||
import static org.briarproject.api.AuthorConstants.MAX_PUBLIC_KEY_LENGTH;
|
||||
import static org.briarproject.api.identity.AuthorConstants.MAX_PUBLIC_KEY_LENGTH;
|
||||
import static org.briarproject.api.sync.MessagingConstants.GROUP_SALT_LENGTH;
|
||||
import static org.briarproject.db.DatabaseConstants.MAX_OFFERED_MESSAGES;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
@@ -74,7 +74,7 @@ public class DatabaseComponentImplTest extends BriarTestCase {
|
||||
protected final AuthorId localAuthorId;
|
||||
protected final LocalAuthor localAuthor;
|
||||
protected final MessageId messageId, messageId1;
|
||||
protected final String contentType, subject;
|
||||
protected final String contentType;
|
||||
protected final long timestamp;
|
||||
protected final int size;
|
||||
protected final byte[] raw;
|
||||
@@ -96,14 +96,13 @@ public class DatabaseComponentImplTest extends BriarTestCase {
|
||||
messageId = new MessageId(TestUtils.getRandomId());
|
||||
messageId1 = new MessageId(TestUtils.getRandomId());
|
||||
contentType = "text/plain";
|
||||
subject = "Foo";
|
||||
timestamp = System.currentTimeMillis();
|
||||
size = 1234;
|
||||
raw = new byte[size];
|
||||
message = new TestMessage(messageId, null, group, author, contentType,
|
||||
subject, timestamp, raw);
|
||||
timestamp, raw);
|
||||
message1 = new TestMessage(messageId1, messageId, group, null,
|
||||
contentType, subject, timestamp, raw);
|
||||
contentType, timestamp, raw);
|
||||
transportId = new TransportId("id");
|
||||
transportProperties = new TransportProperties(Collections.singletonMap(
|
||||
"bar", "baz"));
|
||||
|
||||
@@ -4,15 +4,15 @@ import org.briarproject.BriarTestCase;
|
||||
import org.briarproject.TestDatabaseConfig;
|
||||
import org.briarproject.TestMessage;
|
||||
import org.briarproject.TestUtils;
|
||||
import org.briarproject.api.Author;
|
||||
import org.briarproject.api.AuthorId;
|
||||
import org.briarproject.api.ContactId;
|
||||
import org.briarproject.api.LocalAuthor;
|
||||
import org.briarproject.api.TransportConfig;
|
||||
import org.briarproject.api.TransportId;
|
||||
import org.briarproject.api.TransportProperties;
|
||||
import org.briarproject.api.contact.ContactId;
|
||||
import org.briarproject.api.crypto.SecretKey;
|
||||
import org.briarproject.api.db.DbException;
|
||||
import org.briarproject.api.identity.Author;
|
||||
import org.briarproject.api.identity.AuthorId;
|
||||
import org.briarproject.api.identity.LocalAuthor;
|
||||
import org.briarproject.api.sync.Group;
|
||||
import org.briarproject.api.sync.GroupId;
|
||||
import org.briarproject.api.sync.Message;
|
||||
@@ -41,7 +41,7 @@ import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
import static java.util.concurrent.TimeUnit.SECONDS;
|
||||
import static org.briarproject.api.AuthorConstants.MAX_PUBLIC_KEY_LENGTH;
|
||||
import static org.briarproject.api.identity.AuthorConstants.MAX_PUBLIC_KEY_LENGTH;
|
||||
import static org.briarproject.api.sync.MessageHeader.State.STORED;
|
||||
import static org.briarproject.api.sync.MessagingConstants.GROUP_SALT_LENGTH;
|
||||
import static org.junit.Assert.assertArrayEquals;
|
||||
@@ -65,7 +65,7 @@ public class H2DatabaseTest extends BriarTestCase {
|
||||
private final AuthorId localAuthorId;
|
||||
private final LocalAuthor localAuthor;
|
||||
private final MessageId messageId;
|
||||
private final String contentType, subject;
|
||||
private final String contentType;
|
||||
private final long timestamp;
|
||||
private final int size;
|
||||
private final byte[] raw;
|
||||
@@ -83,13 +83,12 @@ public class H2DatabaseTest extends BriarTestCase {
|
||||
new byte[MAX_PUBLIC_KEY_LENGTH], new byte[100], 1234);
|
||||
messageId = new MessageId(TestUtils.getRandomId());
|
||||
contentType = "text/plain";
|
||||
subject = "Foo";
|
||||
timestamp = System.currentTimeMillis();
|
||||
size = 1234;
|
||||
raw = new byte[size];
|
||||
random.nextBytes(raw);
|
||||
message = new TestMessage(messageId, null, group, author, contentType,
|
||||
subject, timestamp, raw);
|
||||
timestamp, raw);
|
||||
transportId = new TransportId("id");
|
||||
contactId = new ContactId(1);
|
||||
}
|
||||
@@ -311,7 +310,7 @@ public class H2DatabaseTest extends BriarTestCase {
|
||||
// Add some messages to ack
|
||||
MessageId messageId1 = new MessageId(TestUtils.getRandomId());
|
||||
Message message1 = new TestMessage(messageId1, null, group, author,
|
||||
contentType, subject, timestamp, raw);
|
||||
contentType, timestamp, raw);
|
||||
db.addMessage(txn, message, true);
|
||||
db.addStatus(txn, contactId, messageId, false, true);
|
||||
db.raiseAckFlag(txn, contactId, messageId);
|
||||
@@ -408,7 +407,7 @@ public class H2DatabaseTest extends BriarTestCase {
|
||||
byte[] largeBody = new byte[ONE_MEGABYTE];
|
||||
for (int i = 0; i < largeBody.length; i++) largeBody[i] = (byte) i;
|
||||
Message message = new TestMessage(messageId, null, group, author,
|
||||
contentType, subject, timestamp, largeBody);
|
||||
contentType, timestamp, largeBody);
|
||||
Database<Connection> db = open(false);
|
||||
|
||||
// Sanity check: there should be enough space on disk for this test
|
||||
@@ -730,7 +729,7 @@ public class H2DatabaseTest extends BriarTestCase {
|
||||
// A message with no parent should return null
|
||||
MessageId childId = new MessageId(TestUtils.getRandomId());
|
||||
Message child = new TestMessage(childId, null, group, null, contentType,
|
||||
subject, timestamp, raw);
|
||||
timestamp, raw);
|
||||
db.addMessage(txn, child, true);
|
||||
assertTrue(db.containsMessage(txn, childId));
|
||||
assertNull(db.getParent(txn, childId));
|
||||
@@ -751,7 +750,7 @@ public class H2DatabaseTest extends BriarTestCase {
|
||||
MessageId childId = new MessageId(TestUtils.getRandomId());
|
||||
MessageId parentId = new MessageId(TestUtils.getRandomId());
|
||||
Message child = new TestMessage(childId, parentId, group, null,
|
||||
contentType, subject, timestamp, raw);
|
||||
contentType, timestamp, raw);
|
||||
db.addMessage(txn, child, true);
|
||||
assertTrue(db.containsMessage(txn, childId));
|
||||
assertFalse(db.containsMessage(txn, parentId));
|
||||
@@ -777,9 +776,9 @@ public class H2DatabaseTest extends BriarTestCase {
|
||||
MessageId childId = new MessageId(TestUtils.getRandomId());
|
||||
MessageId parentId = new MessageId(TestUtils.getRandomId());
|
||||
Message child = new TestMessage(childId, parentId, group, null,
|
||||
contentType, subject, timestamp, raw);
|
||||
contentType, timestamp, raw);
|
||||
Message parent = new TestMessage(parentId, null, group1, null,
|
||||
contentType, subject, timestamp, raw);
|
||||
contentType, timestamp, raw);
|
||||
db.addMessage(txn, child, true);
|
||||
db.addMessage(txn, parent, true);
|
||||
assertTrue(db.containsMessage(txn, childId));
|
||||
@@ -802,9 +801,9 @@ public class H2DatabaseTest extends BriarTestCase {
|
||||
MessageId childId = new MessageId(TestUtils.getRandomId());
|
||||
MessageId parentId = new MessageId(TestUtils.getRandomId());
|
||||
Message child = new TestMessage(childId, parentId, group, null,
|
||||
contentType, subject, timestamp, raw);
|
||||
contentType, timestamp, raw);
|
||||
Message parent = new TestMessage(parentId, null, group, null,
|
||||
contentType, subject, timestamp, raw);
|
||||
contentType, timestamp, raw);
|
||||
db.addMessage(txn, child, true);
|
||||
db.addMessage(txn, parent, true);
|
||||
assertTrue(db.containsMessage(txn, childId));
|
||||
@@ -828,10 +827,10 @@ public class H2DatabaseTest extends BriarTestCase {
|
||||
// Store a couple of messages
|
||||
int bodyLength = raw.length - 20;
|
||||
Message message = new TestMessage(messageId, null, group, null,
|
||||
contentType, subject, timestamp, raw, 5, bodyLength);
|
||||
contentType, timestamp, raw, 5, bodyLength);
|
||||
MessageId messageId1 = new MessageId(TestUtils.getRandomId());
|
||||
Message message1 = new TestMessage(messageId1, null, group, null,
|
||||
contentType, subject, timestamp, raw, 10, bodyLength);
|
||||
contentType, timestamp, raw, 10, bodyLength);
|
||||
db.addMessage(txn, message, true);
|
||||
db.addMessage(txn, message1, true);
|
||||
|
||||
@@ -871,7 +870,7 @@ public class H2DatabaseTest extends BriarTestCase {
|
||||
MessageId parentId = new MessageId(TestUtils.getRandomId());
|
||||
long timestamp1 = System.currentTimeMillis();
|
||||
Message message1 = new TestMessage(messageId1, parentId, group, author,
|
||||
contentType, subject, timestamp1, raw);
|
||||
contentType, timestamp1, raw);
|
||||
db.addMessage(txn, message1, true);
|
||||
// Mark one of the messages read
|
||||
db.setReadFlag(txn, messageId, true);
|
||||
@@ -930,12 +929,12 @@ public class H2DatabaseTest extends BriarTestCase {
|
||||
new byte[MAX_PUBLIC_KEY_LENGTH]);
|
||||
MessageId messageId1 = new MessageId(TestUtils.getRandomId());
|
||||
Message message1 = new TestMessage(messageId1, null, group, author1,
|
||||
contentType, subject, timestamp, raw);
|
||||
contentType, timestamp, raw);
|
||||
db.addMessage(txn, message1, true);
|
||||
// Store an anonymous message - status ANONYMOUS
|
||||
MessageId messageId2 = new MessageId(TestUtils.getRandomId());
|
||||
Message message2 = new TestMessage(messageId2, null, group, null,
|
||||
contentType, subject, timestamp, raw);
|
||||
contentType, timestamp, raw);
|
||||
db.addMessage(txn, message2, true);
|
||||
|
||||
// Retrieve the message headers (order is undefined)
|
||||
@@ -1008,13 +1007,13 @@ public class H2DatabaseTest extends BriarTestCase {
|
||||
db.addMessage(txn, message, true);
|
||||
MessageId messageId1 = new MessageId(TestUtils.getRandomId());
|
||||
Message message1 = new TestMessage(messageId1, null, group, author,
|
||||
contentType, subject, timestamp, raw);
|
||||
contentType, timestamp, raw);
|
||||
db.addMessage(txn, message1, true);
|
||||
|
||||
// Store one message in the second group
|
||||
MessageId messageId2 = new MessageId(TestUtils.getRandomId());
|
||||
Message message2 = new TestMessage(messageId2, null, group1, author,
|
||||
contentType, subject, timestamp, raw);
|
||||
contentType, timestamp, raw);
|
||||
db.addMessage(txn, message2, true);
|
||||
|
||||
// Mark one of the messages in the first group read
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package org.briarproject.plugins;
|
||||
|
||||
import org.briarproject.BriarTestCase;
|
||||
import org.briarproject.api.ContactId;
|
||||
import org.briarproject.api.TransportId;
|
||||
import org.briarproject.api.contact.ContactId;
|
||||
import org.briarproject.api.event.ContactConnectedEvent;
|
||||
import org.briarproject.api.event.ContactDisconnectedEvent;
|
||||
import org.briarproject.api.event.EventBus;
|
||||
@@ -11,7 +11,6 @@ import org.jmock.Expectations;
|
||||
import org.jmock.Mockery;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
||||
@@ -52,19 +51,19 @@ public class ConnectionRegistryImplTest extends BriarTestCase {
|
||||
// Check that a registered connection shows up - this should
|
||||
// broadcast a ContactConnectedEvent
|
||||
c.registerConnection(contactId, transportId);
|
||||
assertEquals(Arrays.asList(contactId),
|
||||
assertEquals(Collections.singletonList(contactId),
|
||||
c.getConnectedContacts(transportId));
|
||||
assertEquals(Collections.emptyList(),
|
||||
c.getConnectedContacts(transportId1));
|
||||
// Register an identical connection - lookup should be unaffected
|
||||
c.registerConnection(contactId, transportId);
|
||||
assertEquals(Arrays.asList(contactId),
|
||||
assertEquals(Collections.singletonList(contactId),
|
||||
c.getConnectedContacts(transportId));
|
||||
assertEquals(Collections.emptyList(),
|
||||
c.getConnectedContacts(transportId1));
|
||||
// Unregister one of the connections - lookup should be unaffected
|
||||
c.unregisterConnection(contactId, transportId);
|
||||
assertEquals(Arrays.asList(contactId),
|
||||
assertEquals(Collections.singletonList(contactId),
|
||||
c.getConnectedContacts(transportId));
|
||||
assertEquals(Collections.emptyList(),
|
||||
c.getConnectedContacts(transportId1));
|
||||
@@ -79,7 +78,9 @@ public class ConnectionRegistryImplTest extends BriarTestCase {
|
||||
try {
|
||||
c.unregisterConnection(contactId, transportId);
|
||||
fail();
|
||||
} catch (IllegalArgumentException expected) {}
|
||||
} catch (IllegalArgumentException expected) {
|
||||
// Expected
|
||||
}
|
||||
// Register both contacts with one transport, one contact with both -
|
||||
// this should broadcast two ContactConnectedEvents
|
||||
c.registerConnection(contactId, transportId);
|
||||
@@ -89,7 +90,7 @@ public class ConnectionRegistryImplTest extends BriarTestCase {
|
||||
assertEquals(2, connected.size());
|
||||
assertTrue(connected.contains(contactId));
|
||||
assertTrue(connected.contains(contactId1));
|
||||
assertEquals(Arrays.asList(contactId1),
|
||||
assertEquals(Collections.singletonList(contactId1),
|
||||
c.getConnectedContacts(transportId1));
|
||||
context.assertIsSatisfied();
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package org.briarproject.plugins;
|
||||
|
||||
import org.briarproject.api.ContactId;
|
||||
import org.briarproject.api.TransportConfig;
|
||||
import org.briarproject.api.TransportProperties;
|
||||
import org.briarproject.api.contact.ContactId;
|
||||
import org.briarproject.api.crypto.PseudoRandom;
|
||||
import org.briarproject.api.plugins.duplex.DuplexPluginCallback;
|
||||
import org.briarproject.api.plugins.duplex.DuplexTransportConnection;
|
||||
@@ -45,7 +45,6 @@ public abstract class DuplexClientTest extends DuplexTest {
|
||||
d = plugin.createInvitationConnection(r, CONNECTION_TIMEOUT);
|
||||
if (d == null) {
|
||||
System.out.println("Connection failed");
|
||||
return;
|
||||
} else {
|
||||
System.out.println("Connection created");
|
||||
sendChallengeReceiveResponse(d);
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package org.briarproject.plugins;
|
||||
|
||||
import org.briarproject.api.ContactId;
|
||||
import org.briarproject.api.TransportConfig;
|
||||
import org.briarproject.api.TransportProperties;
|
||||
import org.briarproject.api.contact.ContactId;
|
||||
import org.briarproject.api.plugins.duplex.DuplexPluginCallback;
|
||||
import org.briarproject.api.plugins.duplex.DuplexTransportConnection;
|
||||
|
||||
@@ -42,7 +42,6 @@ public abstract class DuplexServerTest extends DuplexTest {
|
||||
getPseudoRandom(123), CONNECTION_TIMEOUT);
|
||||
if (d == null) {
|
||||
System.out.println("Connection failed");
|
||||
return;
|
||||
} else {
|
||||
System.out.println("Connection created");
|
||||
receiveChallengeSendResponse(d);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package org.briarproject.plugins;
|
||||
|
||||
import org.briarproject.api.ContactId;
|
||||
import org.briarproject.api.contact.ContactId;
|
||||
import org.briarproject.api.crypto.PseudoRandom;
|
||||
import org.briarproject.api.plugins.TransportConnectionReader;
|
||||
import org.briarproject.api.plugins.TransportConnectionWriter;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package org.briarproject.plugins.bluetooth;
|
||||
|
||||
import org.briarproject.api.ContactId;
|
||||
import org.briarproject.api.TransportConfig;
|
||||
import org.briarproject.api.TransportProperties;
|
||||
import org.briarproject.api.contact.ContactId;
|
||||
import org.briarproject.plugins.DuplexClientTest;
|
||||
import org.briarproject.system.SystemClock;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ package org.briarproject.plugins.file;
|
||||
|
||||
import org.briarproject.BriarTestCase;
|
||||
import org.briarproject.TestUtils;
|
||||
import org.briarproject.api.ContactId;
|
||||
import org.briarproject.api.contact.ContactId;
|
||||
import org.briarproject.api.plugins.TransportConnectionWriter;
|
||||
import org.briarproject.api.plugins.simplex.SimplexPluginCallback;
|
||||
import org.briarproject.plugins.ImmediateExecutor;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package org.briarproject.plugins.modem;
|
||||
|
||||
import org.briarproject.BriarTestCase;
|
||||
import org.briarproject.api.ContactId;
|
||||
import org.briarproject.api.TransportProperties;
|
||||
import org.briarproject.api.contact.ContactId;
|
||||
import org.briarproject.api.plugins.duplex.DuplexPluginCallback;
|
||||
import org.jmock.Expectations;
|
||||
import org.jmock.Mockery;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package org.briarproject.plugins.tcp;
|
||||
|
||||
import org.briarproject.api.ContactId;
|
||||
import org.briarproject.api.TransportConfig;
|
||||
import org.briarproject.api.TransportProperties;
|
||||
import org.briarproject.api.contact.ContactId;
|
||||
import org.briarproject.plugins.DuplexClientTest;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package org.briarproject.plugins.tcp;
|
||||
|
||||
import org.briarproject.BriarTestCase;
|
||||
import org.briarproject.api.ContactId;
|
||||
import org.briarproject.api.TransportConfig;
|
||||
import org.briarproject.api.TransportProperties;
|
||||
import org.briarproject.api.contact.ContactId;
|
||||
import org.briarproject.api.plugins.duplex.DuplexPlugin;
|
||||
import org.briarproject.api.plugins.duplex.DuplexPluginCallback;
|
||||
import org.briarproject.api.plugins.duplex.DuplexTransportConnection;
|
||||
|
||||
@@ -8,8 +8,6 @@ import org.briarproject.TestDatabaseModule;
|
||||
import org.briarproject.TestLifecycleModule;
|
||||
import org.briarproject.TestSystemModule;
|
||||
import org.briarproject.TestUtils;
|
||||
import org.briarproject.api.Author;
|
||||
import org.briarproject.api.AuthorFactory;
|
||||
import org.briarproject.api.TransportId;
|
||||
import org.briarproject.api.TransportProperties;
|
||||
import org.briarproject.api.UniqueId;
|
||||
@@ -17,6 +15,8 @@ import org.briarproject.api.crypto.CryptoComponent;
|
||||
import org.briarproject.api.crypto.KeyPair;
|
||||
import org.briarproject.api.crypto.PrivateKey;
|
||||
import org.briarproject.api.crypto.Signature;
|
||||
import org.briarproject.api.identity.Author;
|
||||
import org.briarproject.api.identity.AuthorFactory;
|
||||
import org.briarproject.api.sync.Ack;
|
||||
import org.briarproject.api.sync.Group;
|
||||
import org.briarproject.api.sync.GroupFactory;
|
||||
@@ -40,12 +40,12 @@ import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Random;
|
||||
|
||||
import static org.briarproject.api.AuthorConstants.MAX_AUTHOR_NAME_LENGTH;
|
||||
import static org.briarproject.api.AuthorConstants.MAX_PUBLIC_KEY_LENGTH;
|
||||
import static org.briarproject.api.AuthorConstants.MAX_SIGNATURE_LENGTH;
|
||||
import static org.briarproject.api.TransportPropertyConstants.MAX_PROPERTIES_PER_TRANSPORT;
|
||||
import static org.briarproject.api.TransportPropertyConstants.MAX_PROPERTY_LENGTH;
|
||||
import static org.briarproject.api.TransportPropertyConstants.MAX_TRANSPORT_ID_LENGTH;
|
||||
import static org.briarproject.api.identity.AuthorConstants.MAX_AUTHOR_NAME_LENGTH;
|
||||
import static org.briarproject.api.identity.AuthorConstants.MAX_PUBLIC_KEY_LENGTH;
|
||||
import static org.briarproject.api.identity.AuthorConstants.MAX_SIGNATURE_LENGTH;
|
||||
import static org.briarproject.api.sync.MessagingConstants.MAX_BODY_LENGTH;
|
||||
import static org.briarproject.api.sync.MessagingConstants.MAX_CONTENT_TYPE_LENGTH;
|
||||
import static org.briarproject.api.sync.MessagingConstants.MAX_GROUP_NAME_LENGTH;
|
||||
|
||||
@@ -8,11 +8,8 @@ import org.briarproject.TestDatabaseModule;
|
||||
import org.briarproject.TestLifecycleModule;
|
||||
import org.briarproject.TestSystemModule;
|
||||
import org.briarproject.TestUtils;
|
||||
import org.briarproject.api.Author;
|
||||
import org.briarproject.api.AuthorId;
|
||||
import org.briarproject.api.ContactId;
|
||||
import org.briarproject.api.LocalAuthor;
|
||||
import org.briarproject.api.TransportId;
|
||||
import org.briarproject.api.contact.ContactId;
|
||||
import org.briarproject.api.crypto.CryptoComponent;
|
||||
import org.briarproject.api.crypto.SecretKey;
|
||||
import org.briarproject.api.db.DatabaseComponent;
|
||||
@@ -20,6 +17,9 @@ import org.briarproject.api.event.Event;
|
||||
import org.briarproject.api.event.EventBus;
|
||||
import org.briarproject.api.event.EventListener;
|
||||
import org.briarproject.api.event.MessageAddedEvent;
|
||||
import org.briarproject.api.identity.Author;
|
||||
import org.briarproject.api.identity.AuthorId;
|
||||
import org.briarproject.api.identity.LocalAuthor;
|
||||
import org.briarproject.api.sync.Group;
|
||||
import org.briarproject.api.sync.GroupFactory;
|
||||
import org.briarproject.api.sync.Message;
|
||||
@@ -52,7 +52,7 @@ import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.Collections;
|
||||
|
||||
import static org.briarproject.api.AuthorConstants.MAX_PUBLIC_KEY_LENGTH;
|
||||
import static org.briarproject.api.identity.AuthorConstants.MAX_PUBLIC_KEY_LENGTH;
|
||||
import static org.briarproject.api.sync.MessagingConstants.GROUP_SALT_LENGTH;
|
||||
import static org.briarproject.api.transport.TransportConstants.MAX_CLOCK_DIFFERENCE;
|
||||
import static org.briarproject.api.transport.TransportConstants.TAG_LENGTH;
|
||||
|
||||
@@ -2,8 +2,8 @@ package org.briarproject.sync;
|
||||
|
||||
import org.briarproject.BriarTestCase;
|
||||
import org.briarproject.TestUtils;
|
||||
import org.briarproject.api.ContactId;
|
||||
import org.briarproject.api.TransportId;
|
||||
import org.briarproject.api.contact.ContactId;
|
||||
import org.briarproject.api.db.DatabaseComponent;
|
||||
import org.briarproject.api.event.EventBus;
|
||||
import org.briarproject.api.sync.Ack;
|
||||
|
||||
Reference in New Issue
Block a user