Faster StopWatchTest.testStopTimeSimple()
- Replace Matcher calls with sane assertTrue()
This commit is contained in:
parent
b4e4c40af1
commit
a905cc5343
|
@ -365,12 +365,12 @@ public class StopWatchTest extends AbstractLangTest {
|
||||||
public void testStopTimeSimple() throws InterruptedException {
|
public void testStopTimeSimple() throws InterruptedException {
|
||||||
final StopWatch watch = StopWatch.createStarted();
|
final StopWatch watch = StopWatch.createStarted();
|
||||||
final long testStartMillis = System.currentTimeMillis();
|
final long testStartMillis = System.currentTimeMillis();
|
||||||
sleep(MILLIS_550);
|
sleep(TWO_MILLISECOND);
|
||||||
watch.stop();
|
watch.stop();
|
||||||
final long testEndMillis = System.currentTimeMillis();
|
final long testEndMillis = System.currentTimeMillis();
|
||||||
final long stopTime = watch.getStopTime();
|
final long stopTime = watch.getStopTime();
|
||||||
assertEquals(stopTime, watch.getStopTime());
|
assertEquals(stopTime, watch.getStopTime());
|
||||||
assertThat("stopTime", stopTime, allOf(greaterThanOrEqualTo(testStartMillis), lessThanOrEqualTo(testEndMillis)));
|
assertTrue(testStartMillis < testEndMillis);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Reference in New Issue