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:
Henri Yandell 2006-08-25 06:27:02 +00:00
parent 62bf5bfcb0
commit 5290bee389
1 changed files with 4 additions and 1 deletions

View File

@ -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);