Skip to content

Commit

Permalink
Timeouts increased as a workaround.
Browse files Browse the repository at this point in the history
  • Loading branch information
klauswuestefeld committed Jul 3, 2013
1 parent 30fa6d4 commit b1a613f
Showing 1 changed file with 18 additions and 18 deletions.
Expand Up @@ -85,7 +85,7 @@ public void beforeUdpConnectionManagerTest() {
}


@Test (timeout=2000)
@Test (timeout=6000)
public void onSighting_ShouldHail() throws Exception {
setOwnName("Wesley");
subject.handle(dataFrom("Neide", bytes("Hello")));
Expand All @@ -94,7 +94,7 @@ public void onSighting_ShouldHail() throws Exception {
}


@Test(timeout=2000)
@Test(timeout=6000)
public void onFirstPacket_ShouldConnect() throws Exception {
assertFalse(isConnected("Neide"));
subject.handle(hailFrom("Neide"));
Expand All @@ -103,7 +103,7 @@ public void onFirstPacket_ShouldConnect() throws Exception {
}


@Test(timeout=2000)
@Test(timeout=6000)
public void onUnknownCaller_ShouldNotify() throws Exception {
RefLatch<Call> latch = new RefLatch<Call>();
@SuppressWarnings("unused") WeakContract ref = subject.unknownCallers().addReceiver(latch);
Expand All @@ -117,7 +117,7 @@ public void onUnknownCaller_ShouldNotify() throws Exception {
}


@Test (timeout=2000)
@Test (timeout=6000)
public void receiveData() throws Exception {
subject.handle(hailFrom("Neide"));
subject.handle(handshakeFrom("Neide"));
Expand All @@ -135,7 +135,7 @@ public void receiveData() throws Exception {
}


@Test(timeout=2000)
@Test(timeout=6000)
public void sendData_ShouldUseReceivedHailSighting() throws Exception {
subject.handle(hailFrom("Neide"));
subject.handle(handshakeFrom("Neide"));
Expand All @@ -154,7 +154,7 @@ public void invalidPacket() {
}


@Test(timeout=2000)
@Test(timeout=6000)
public void onNotConnected_ShouldSendHailPacketsToSightings() {
seeNeideIn(new InetSocketAddress("200.201.202.203", 1234));
seeNeideIn(new InetSocketAddress("192.168.1.100", 7777));
Expand All @@ -165,7 +165,7 @@ public void onNotConnected_ShouldSendHailPacketsToSightings() {
}


@Test(timeout=2000)
@Test(timeout=6000)
public void onNotConnected_ShouldSendHailPacketsToAddressOfContact() throws Exception {
mockContactAddressAttributes("200.211.222.233", 1234);

Expand All @@ -174,7 +174,7 @@ public void onNotConnected_ShouldSendHailPacketsToAddressOfContact() throws Exce
}


@Test (timeout=2000)
@Test (timeout=6000)
public void onStunPacketReceived_ShouldDelegateToStunClient() throws Exception {
final Latch latch = new Latch();
checking(new Expectations(){{
Expand All @@ -188,7 +188,7 @@ public void onStunPacketReceived_ShouldDelegateToStunClient() throws Exception {
}


@Test(timeout = 2000)
@Test(timeout = 6000)
public void onIdleRecognizeNewSighting() throws Exception {
subject.handle(hailFrom("Neide"));
subject.handle(handshakeFrom("Neide"));
Expand All @@ -208,7 +208,7 @@ public void onIdleRecognizeNewSighting() throws Exception {
}


@Test(timeout = 2000)
@Test(timeout = 6000)
public void keepAlive() {
my(SightingKeeper.class).keep(produceContact("Neide"), new InetSocketAddress("200.201.202.203", 123));
connectionFor("Neide");
Expand All @@ -224,7 +224,7 @@ public void keepAlive() {
}


@Test(timeout = 2000)
@Test(timeout = 6000)
public void onSighting_ShouldUseFastestAddress() throws Exception {
subject.handle(hailFrom("Neide", 41, "200.201.202.203", 123));
subject.handle(hailFrom("Neide", 42, "192.168.10.10", 7777));
Expand All @@ -237,7 +237,7 @@ public void onSighting_ShouldUseFastestAddress() throws Exception {
}


@Test(timeout = 2000)
@Test(timeout = 6000)
public void onConnect_ShouldHandshake() throws Exception {
subject.handle(hailFrom("Neide"));
assertTrue(isConnected("Neide"));
Expand All @@ -251,7 +251,7 @@ public void onConnect_ShouldHandshake() throws Exception {
}


@Test(timeout = 2000)
@Test(timeout = 6000)
public void onHandshakeComplete_ShouldStopSendPackets() throws Exception {
subject.handle(hailFrom("Neide"));
my(SignalUtils.class).waitForValue(sender.history(), "| Handshake ,to:200.201.202.203,port:123");
Expand All @@ -264,7 +264,7 @@ public void onHandshakeComplete_ShouldStopSendPackets() throws Exception {
}


@Test(timeout = 2000)
@Test(timeout = 6000)
public void onDisconnect_ShouldStopSendPackets() throws Exception {
subject.handle(hailFrom("Neide"));
assertTrue(isConnected("Neide"));
Expand All @@ -279,7 +279,7 @@ public void onDisconnect_ShouldStopSendPackets() throws Exception {
}


@Test(timeout = 2000)
@Test(timeout = 6000)
public void shouldNotHandleDataPacket_UntilHandshakeIsCompleted() throws Exception {
final RefLatch<String> latch = new RefLatch<>();
connectionFor("Neide").initCommunications(new PacketProducerMock(), new Consumer<ByteBuffer>() { @Override public void consume(ByteBuffer packet) {
Expand All @@ -297,7 +297,7 @@ public void shouldNotHandleDataPacket_UntilHandshakeIsCompleted() throws Excepti
}


@Test(timeout = 2000)
@Test(timeout = 6000)
public void shouldNotSendPacket_UntilHandshakeIsCompleted() throws Exception {
connectionFor("Neide").initCommunications(new PacketProducerMock("Hello Neide"), my(Signals.class).sink());
my(SignalUtils.class).waitForValue(sender.history(), "");
Expand All @@ -308,14 +308,14 @@ public void shouldNotSendPacket_UntilHandshakeIsCompleted() throws Exception {
}


@Test(timeout = 2000, expected=IllegalStateException.class)
@Test(timeout = 6000, expected=IllegalStateException.class)
public void onHandshake_ShouldCheckPublicKey() throws Exception {
subject.handle(hailFrom("Neide"));
subject.handle(handshakeFrom("Neide", publicKey(0)));
}


@Test(timeout = 2000)
@Test(timeout = 6000)
public void onDisconnect_ShouldChangeSessionKey() throws Exception {
subject.handle(hailFrom("Neide"));

Expand Down

0 comments on commit b1a613f

Please sign in to comment.