Added test for StopWatch.toSplitString
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@436673 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
62bf5bfcb0
commit
5290bee389
|
@ -74,12 +74,15 @@ public class StopWatchTest extends TestCase {
|
|||
try {Thread.sleep(550);} catch (InterruptedException ex) {}
|
||||
watch.split();
|
||||
long splitTime = watch.getSplitTime();
|
||||
String splitStr = watch.toSplitString();
|
||||
try {Thread.sleep(550);} catch (InterruptedException ex) {}
|
||||
watch.unsplit();
|
||||
try {Thread.sleep(550);} catch (InterruptedException ex) {}
|
||||
watch.stop();
|
||||
long totalTime = watch.getTime();
|
||||
|
||||
assertEquals("Formatted split string not the correct length",
|
||||
splitStr.length(), 11);
|
||||
assertTrue(splitTime >= 500);
|
||||
assertTrue(splitTime < 700);
|
||||
assertTrue(totalTime >= 1500);
|
||||
|
|
Loading…
Reference in New Issue