mirror of
https://github.com/apache/commons-lang.git
synced 2025-02-26 12:16:18 +00:00
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 @@
|
||||
* 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 void testBadStates() {
|
||||
// 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 void testBadStates() {
|
||||
|
||||
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 void testBadStates() {
|
||||
// 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…
x
Reference in New Issue
Block a user