File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
mina-core/src/test/java/org/apache/mina/transport Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change 43
43
import org .apache .mina .transport .socket .SocketSessionConfig ;
44
44
import org .apache .mina .util .AvailablePortFinder ;
45
45
import org .junit .After ;
46
+ import org .junit .Assert ;
46
47
import org .junit .Ignore ;
47
48
import org .junit .Test ;
48
49
import org .slf4j .Logger ;
@@ -156,13 +157,18 @@ public void testDuplicateUnbind() throws IOException {
156
157
}
157
158
158
159
@ Test
159
- public void testManyTimes () throws IOException {
160
+ public void testManyTimes () throws IOException , InterruptedException {
160
161
bind (true );
161
162
162
- for (int i = 0 ; i < 1024 ; i ++) {
163
- acceptor .unbind ();
164
- acceptor .bind ();
165
- }
163
+ for (int i = 0 ; i < 1024 ; i ++) {
164
+ Assert .assertTrue ("Bound addresses is empty" , acceptor .getLocalAddresses ().size () > 0 );
165
+ acceptor .unbind ();
166
+ Thread .sleep (1 );
167
+ Assert .assertTrue ("Bound addresses is not empty" , acceptor .getLocalAddresses ().size () == 0 );
168
+ acceptor .bind ();
169
+ }
170
+
171
+ acceptor .unbind ();
166
172
}
167
173
168
174
@ Test
You can’t perform that action at this time.
0 commit comments