Skip to content

Commit

Permalink
Added test for multiple connect-disconnect sequences
Browse files Browse the repository at this point in the history
  • Loading branch information
belaban committed Jan 27, 2021
1 parent 0d6d442 commit 0a576fe
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion tests/junit/org/jgroups/tests/ConnectTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,24 @@ public void testDisconnectConnectTwo() throws Exception {
}


public void testDisconnectConnectndMessageSending() throws Exception {
public void testMultipleConnectsAndDisconnects() throws Exception {
coordinator=createChannel(true, 2, "coord");
coordinator.connect("testMultipleConnectsAndDisconnects");
channel=createChannel(coordinator, "channel");
channel.connect("testMultipleConnectsAndDisconnects");
Util.waitUntilAllChannelsHaveSameView(10000, 500, coordinator, channel);
for(int i=1; i <= 50; i++) {
channel.disconnect();
Util.waitUntil(10000, 100, () -> coordinator.getView().size() == 1);
assert coordinator.getView().size() == 1 : String.format("coord's view is %s\n", coordinator.getView());
assert channel.isConnected() == false;
channel.connect("testMultipleConnectsAndDisconnects");
Util.waitUntilAllChannelsHaveSameView(10000, 500, coordinator, channel);
System.out.printf("#%d: %s\n", i, coordinator.getView());
}
}

public void testDisconnectConnectedMessageSending() throws Exception {
coordinator=createChannel(true, 2).name("A");
channel=createChannel(coordinator, "B");
coordinator.connect("ConnectTest");
Expand Down

0 comments on commit 0a576fe

Please sign in to comment.