Wait for transport properties as well as client versions.

This commit is contained in:
akwizgran
2019-05-30 13:55:16 +01:00
parent ee874947d0
commit d0495b7c00

View File

@@ -94,11 +94,12 @@ public class SimplexMessagingIntegrationTest extends BriarTestCase {
bob.getEventBus().addListener(listener); bob.getEventBus().addListener(listener);
// Alice sends a private message to Bob // Alice sends a private message to Bob
sendMessage(alice, bobId); sendMessage(alice, bobId);
// Send three simplex streams to exchange client versions and the // Sync Alice's client versions and transport properties
// private message read(bob, aliceId, write(alice, bobId), 2);
read(bob, aliceId, write(alice, bobId), 1); // Alice's client versions // Sync Bob's client versions and transport properties
read(alice, bobId, write(bob, aliceId), 1); // Bob's client versions read(alice, bobId, write(bob, aliceId), 2);
read(bob, aliceId, write(alice, bobId), 1); // Alice's private message // Sync the private message
read(bob, aliceId, write(alice, bobId), 1);
// Bob should have received the private message // Bob should have received the private message
assertTrue(listener.messageAdded); assertTrue(listener.messageAdded);
} }
@@ -131,8 +132,7 @@ public class SimplexMessagingIntegrationTest extends BriarTestCase {
} }
private void read(SimplexMessagingIntegrationTestComponent device, private void read(SimplexMessagingIntegrationTestComponent device,
ContactId contactId, byte[] stream, ContactId contactId, byte[] stream, int deliveries)
@SuppressWarnings("SameParameterValue") int deliveries)
throws Exception { throws Exception {
// Listen for message deliveries // Listen for message deliveries
MessageDeliveryListener listener = MessageDeliveryListener listener =