1 5 package com.opensymphony.webwork.util; 6 7 import junit.framework.TestCase; 8 9 10 15 public class CounterTest extends TestCase { 16 18 Counter c = new Counter(); 19 20 22 public void testCurrentAfterNext() { 23 long next = c.getNext(); 24 long current = c.getCurrent(); 25 assertEquals(next + 1, current); 26 } 27 28 public void testCurrentBeforeNext() { 29 long current = c.getCurrent(); 30 long next = c.getNext(); 31 assertEquals(current, next); 32 } 33 34 public void testWrap() { 35 c.setWrap(true); 36 c.setLast(1); 37 38 long a = c.getNext(); 39 long b = c.getNext(); 40 assertEquals(1, a); 41 assertEquals(1, b); 42 } 43 } 44 | Popular Tags |