Moved the messaging protocol one step closer to BSP.

This breaks backward compatibility for the wire protocol and messages
stored in the database. The database schema version has been
incremented.
This commit is contained in:
akwizgran
2015-05-01 16:58:49 +01:00
parent ffcc8b6b38
commit 32c9ce50d9
33 changed files with 732 additions and 750 deletions

View File

@@ -9,7 +9,7 @@ import static org.briarproject.api.TransportPropertyConstants.MAX_TRANSPORT_ID_L
import static org.briarproject.api.messaging.MessagingConstants.MAX_BODY_LENGTH;
import static org.briarproject.api.messaging.MessagingConstants.MAX_CONTENT_TYPE_LENGTH;
import static org.briarproject.api.messaging.MessagingConstants.MAX_GROUP_NAME_LENGTH;
import static org.briarproject.api.messaging.MessagingConstants.MAX_PACKET_LENGTH;
import static org.briarproject.api.messaging.MessagingConstants.MAX_PAYLOAD_LENGTH;
import static org.briarproject.api.messaging.MessagingConstants.MAX_SUBSCRIPTIONS;
import java.io.ByteArrayOutputStream;
@@ -106,7 +106,7 @@ public class ConstantsTest extends BriarTestCase {
@Test
public void testMessageIdsFitIntoLargeAck() throws Exception {
testMessageIdsFitIntoAck(MAX_PACKET_LENGTH);
testMessageIdsFitIntoAck(MAX_PAYLOAD_LENGTH);
}
@Test
@@ -139,12 +139,12 @@ public class ConstantsTest extends BriarTestCase {
+ MAX_PUBLIC_KEY_LENGTH + MAX_AUTHOR_NAME_LENGTH
+ MAX_PUBLIC_KEY_LENGTH + MAX_CONTENT_TYPE_LENGTH
+ MAX_BODY_LENGTH);
assertTrue(length <= MAX_PACKET_LENGTH);
assertTrue(length <= MAX_PAYLOAD_LENGTH);
}
@Test
public void testMessageIdsFitIntoLargeOffer() throws Exception {
testMessageIdsFitIntoOffer(MAX_PACKET_LENGTH);
testMessageIdsFitIntoOffer(MAX_PAYLOAD_LENGTH);
}
@Test
@@ -154,7 +154,7 @@ public class ConstantsTest extends BriarTestCase {
@Test
public void testMessageIdsFitIntoLargeRequest() throws Exception {
testMessageIdsFitIntoRequest(MAX_PACKET_LENGTH);
testMessageIdsFitIntoRequest(MAX_PAYLOAD_LENGTH);
}
@Test
@@ -180,7 +180,7 @@ public class ConstantsTest extends BriarTestCase {
PacketWriter writer = packetWriterFactory.createPacketWriter(out);
writer.writeTransportUpdate(u);
// Check the size of the serialised transport update
assertTrue(out.size() <= MAX_PACKET_LENGTH);
assertTrue(out.size() <= MAX_PAYLOAD_LENGTH);
}
@Test
@@ -198,7 +198,7 @@ public class ConstantsTest extends BriarTestCase {
PacketWriter writer = packetWriterFactory.createPacketWriter(out);
writer.writeSubscriptionUpdate(u);
// Check the size of the serialised subscription update
assertTrue(out.size() <= MAX_PACKET_LENGTH);
assertTrue(out.size() <= MAX_PAYLOAD_LENGTH);
}
private void testMessageIdsFitIntoAck(int length) throws Exception {