You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by jd...@apache.org on 2003/09/01 23:09:57 UTC

cvs commit: incubator-geronimo/modules/common/src/test/org/apache/geronimo/common CounterTest.java

jdillon     2003/09/01 14:09:57

  Modified:    modules/common/src/test/org/apache/geronimo/common
                        CounterTest.java
  Removed:     modules/core/src/java/org/apache/geronimo/lock
                        LockCounter.java
               modules/core/src/test/org/apache/geronimo/lock
                        LockCounterTest.java
  Log:
   o Use Counter instead of LockCounter
  
  Revision  Changes    Path
  1.2       +17 -3     incubator-geronimo/modules/common/src/test/org/apache/geronimo/common/CounterTest.java
  
  Index: CounterTest.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/common/src/test/org/apache/geronimo/common/CounterTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CounterTest.java	26 Aug 2003 18:39:53 -0000	1.1
  +++ CounterTest.java	1 Sep 2003 21:09:57 -0000	1.2
  @@ -140,7 +140,7 @@
           try {
               increasing.decrement();
               fail();
  -        } catch(UnsupportedOperationException ex){
  +        } catch (UnsupportedOperationException ex) {
               // success
           }
       }
  @@ -158,8 +158,22 @@
           try {
               decreasing.increment();
               fail();
  -        } catch(UnsupportedOperationException ex){
  +        } catch (UnsupportedOperationException ex) {
               // success
           }
  +    }
  +    
  +    public void testUpAndDown() {
  +        Counter c = new Counter();
  +        
  +        assertEquals(0, c.getCount());
  +        assertEquals(1, c.increment());
  +        assertEquals(2, c.increment());
  +        assertEquals(2, c.getCount());
  +        assertEquals(1, c.decrement());
  +        assertEquals(2, c.increment());
  +        assertEquals(1, c.decrement());
  +        assertEquals(0, c.decrement());
  +        assertEquals(0, c.getCount());
       }
   }