Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
lautarobock committed Jun 26, 2015
1 parent 4b685e7 commit c699c9b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/test/java/org/takes/http/BkBasicTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
* @version $Id$
* @since 0.15.2
* @checkstyle ClassDataAbstractionCouplingCheck (500 lines)
* @checkstyle ExecutableStatementCountCheck (500 lines)
*/
public final class BkBasicTest {

Expand Down Expand Up @@ -122,7 +123,7 @@ public Response act(final Request req)
}
};
final BkFake fake = new BkFake(new BkBasic(take, true));
new Thread(
final Thread thread = new Thread(
// @checkstyle AnonInnerLengthCheck (23 lines)
new Runnable() {
@Override
Expand All @@ -144,7 +145,8 @@ public boolean ready() {
}
}
}
).start();
);
thread.start();
for (int idx = 0; idx < 2; ++idx) {
final HttpURLConnection conn = HttpURLConnection.class.cast(
new URL(uri).openConnection()
Expand All @@ -158,6 +160,7 @@ public boolean ready() {
completed.countDown();
// @checkstyle MagicNumberCheck (1 line)
completed.await(1L, TimeUnit.MINUTES);
thread.join();
MatcherAssert.assertThat(completed.getCount(), Matchers.equalTo(0L));
MatcherAssert.assertThat(fake.sockets().size(), Matchers.equalTo(1));
new Ports().release(port);
Expand Down

0 comments on commit c699c9b

Please sign in to comment.