Code example for TimeUnit

Methods: sleep

0
    } 
 
    @Test 
    public void testReceivingAndSending() throws Exception { 
        StressClient client = new StressClient("localhost", 8888, 100, new StubHttpRequest());
        TimeUnit.SECONDS.sleep(1);
 
        client.start();
        TimeUnit.SECONDS.sleep(3);
 
        client.stop();
        TimeUnit.SECONDS.sleep(1);
 
        Assert.assertTrue(client.getSentTotal() - server.total.get() < 5);
    } 
}