tested some missing bad states
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@149477 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
1e9fbb7f10
commit
ba92e4d253
|
@ -24,7 +24,7 @@ import junit.textui.TestRunner;
|
|||
* TestCase for StopWatch.
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
* @version $Id: StopWatchTest.java,v 1.8 2004/09/05 19:55:29 bayard Exp $
|
||||
* @version $Id$
|
||||
*/
|
||||
public class StopWatchTest extends TestCase {
|
||||
|
||||
|
@ -128,6 +128,13 @@ public class StopWatchTest extends TestCase {
|
|||
// expected
|
||||
}
|
||||
|
||||
try {
|
||||
watch.split();
|
||||
fail("Calling split on a non-running StopWatch should throw an exception. ");
|
||||
} catch(IllegalStateException ise) {
|
||||
// expected
|
||||
}
|
||||
|
||||
try {
|
||||
watch.unsplit();
|
||||
fail("Calling unsplit on an unsplit StopWatch should throw an exception. ");
|
||||
|
@ -146,7 +153,7 @@ public class StopWatchTest extends TestCase {
|
|||
|
||||
try {
|
||||
watch.start();
|
||||
fail("Calling start on an started StopWatch should throw an exception. ");
|
||||
fail("Calling start on a started StopWatch should throw an exception. ");
|
||||
} catch(IllegalStateException ise) {
|
||||
// expected
|
||||
}
|
||||
|
@ -172,6 +179,15 @@ public class StopWatchTest extends TestCase {
|
|||
// expected
|
||||
}
|
||||
|
||||
watch.stop();
|
||||
|
||||
try {
|
||||
watch.start();
|
||||
fail("Calling start on a stopped StopWatch should throw an exception as it needs to be reset. ");
|
||||
} catch(IllegalStateException ise) {
|
||||
// expected
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue