1212import java .util .concurrent .TimeUnit ;
1313import java .util .concurrent .atomic .AtomicInteger ;
1414import org .junit .Assert ;
15+ import org .junit .Rule ;
1516import org .junit .Test ;
17+ import org .junit .rules .TestName ;
1618import software .amazon .awssdk .crt .CRT ;
1719import software .amazon .awssdk .crt .CrtResource ;
1820import software .amazon .awssdk .crt .CrtRuntimeException ;
2628import software .amazon .awssdk .crt .Log ;
2729
2830public class HttpClientConnectionManagerTest extends HttpClientTestFixture {
31+ @ Rule
32+ public TestName testName = new TestName ();
33+
2934 private final static Charset UTF8 = StandardCharsets .UTF_8 ;
3035 private final static int NUM_THREADS = 10 ;
3136 private final static int NUM_CONNECTIONS = 20 ;
@@ -155,15 +160,18 @@ public void testParallelRequests(int numThreads, int numRequests) throws Excepti
155160
156161 @ Test
157162 public void testSerialRequests () throws Exception {
163+ System .out .println ("[TEST START] " + testName .getMethodName ());
158164 skipIfAndroid ();
159165 testParallelRequestsWithLeakCheck (1 , NUM_REQUESTS / NUM_THREADS );
166+ System .out .println ("[TEST END] " + testName .getMethodName ());
160167 }
161168
162169 /**
163170 * Test that the counters for the connection manager are correct (at least when used serially).
164171 */
165172 @ Test
166173 public void testConnectionCounters () throws Exception {
174+ System .out .println ("[TEST START] " + testName .getMethodName ());
167175 skipIfAndroid ();
168176 skipIfNetworkUnavailable ();
169177
@@ -243,16 +251,20 @@ public void testConnectionCounters() throws Exception {
243251
244252 CrtResource .logNativeResources ();
245253 CrtResource .waitForNoResources ();
254+ System .out .println ("[TEST END] " + testName .getMethodName ());
246255 }
247256
248257 @ Test
249258 public void testMaxParallelRequests () throws Exception {
259+ System .out .println ("[TEST START] " + testName .getMethodName ());
250260 skipIfAndroid ();
251261 testParallelRequestsWithLeakCheck (NUM_THREADS , NUM_REQUESTS );
262+ System .out .println ("[TEST END] " + testName .getMethodName ());
252263 }
253264
254265 @ Test
255266 public void testPendingAcquisitionsDuringShutdown () throws Exception {
267+ System .out .println ("[TEST START] " + testName .getMethodName ());
256268 skipIfAndroid ();
257269 skipIfNetworkUnavailable ();
258270 HttpClientConnection firstConnection = null ;
@@ -268,10 +280,12 @@ public void testPendingAcquisitionsDuringShutdown() throws Exception {
268280 }
269281
270282 firstConnection .close ();
283+ System .out .println ("[TEST END] " + testName .getMethodName ());
271284 }
272285
273286 @ Test
274287 public void testCancelAcquire () throws Exception {
288+ System .out .println ("[TEST START] " + testName .getMethodName ());
275289 skipIfAndroid ();
276290 // related: https://github.com/awslabs/aws-sdk-kotlin/issues/511
277291 skipIfNetworkUnavailable ();
@@ -293,5 +307,6 @@ public void testCancelAcquire() throws Exception {
293307 HttpClientConnection conn = thirdAcquisition .get (500 , TimeUnit .MILLISECONDS );
294308 conn .close ();
295309 }
310+ System .out .println ("[TEST END] " + testName .getMethodName ());
296311 }
297312}
0 commit comments