commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r149477 - jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/StopWatchTest.java
Date Wed, 02 Feb 2005 03:52:51 GMT
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: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message