Skip to content

Commit

Permalink
workout for failing unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
jon-valliere committed Oct 4, 2021
1 parent 3bca0bc commit dfd80f1
Showing 1 changed file with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import org.apache.mina.transport.socket.SocketSessionConfig;
import org.apache.mina.util.AvailablePortFinder;
import org.junit.After;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.slf4j.Logger;
Expand Down Expand Up @@ -156,13 +157,18 @@ public void testDuplicateUnbind() throws IOException {
}

@Test
public void testManyTimes() throws IOException {
public void testManyTimes() throws IOException, InterruptedException {
bind(true);

for (int i = 0; i < 1024; i++) {
acceptor.unbind();
acceptor.bind();
}
for (int i = 0; i < 1024; i++) {
Assert.assertTrue("Bound addresses is empty", acceptor.getLocalAddresses().size() > 0);
acceptor.unbind();
Thread.sleep(1);
Assert.assertTrue("Bound addresses is not empty", acceptor.getLocalAddresses().size() == 0);
acceptor.bind();
}

acceptor.unbind();
}

@Test
Expand Down

0 comments on commit dfd80f1

Please sign in to comment.