Author: bayard Date: Tue Feb 1 19:52:50 2005 New Revision: 149477 URL: http://svn.apache.org/viewcvs?view=rev&rev=149477 Log: tested some missing bad states
Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/StopWatchTest.java Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/StopWatchTest.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/StopWatchTest.java?view=diff&r1=149476&r2=149477 ============================================================================== --- jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/StopWatchTest.java (original) +++ jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/StopWatchTest.java Tue Feb 1 19:52:50 2005 @@ -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 { @@ -129,6 +129,13 @@ } 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. "); } catch(IllegalStateException ise) { @@ -146,7 +153,7 @@ 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 } @@ -168,6 +175,15 @@ try { watch.resume(); fail("Calling resume on an unsuspended StopWatch should throw an exception. "); + } catch(IllegalStateException ise) { + // 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 } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]