You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by mo...@apache.org on 2002/02/13 21:59:12 UTC

cvs commit: jakarta-commons/collections/src/test/org/apache/commons/collections TestAll.java TestLRUMap.java

morgand     02/02/13 12:59:12

  Modified:    collections/src/test/org/apache/commons/collections
                        TestAll.java TestLRUMap.java
  Log:
  added unit test for LRUMap.removeLRU(), which needs fixing
  
  Revision  Changes    Path
  1.15      +5 -4      jakarta-commons/collections/src/test/org/apache/commons/collections/TestAll.java
  
  Index: TestAll.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/TestAll.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- TestAll.java	20 Jan 2002 04:36:08 -0000	1.14
  +++ TestAll.java	13 Feb 2002 20:59:12 -0000	1.15
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/TestAll.java,v 1.14 2002/01/20 04:36:08 craigmcc Exp $
  - * $Revision: 1.14 $
  - * $Date: 2002/01/20 04:36:08 $
  + * $Header: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/TestAll.java,v 1.15 2002/02/13 20:59:12 morgand Exp $
  + * $Revision: 1.15 $
  + * $Date: 2002/02/13 20:59:12 $
    *
    * ====================================================================
    *
  @@ -66,7 +66,7 @@
   /**
    * Entry point for all Collections tests.
    * @author Rodney Waldhoff
  - * @version $Id: TestAll.java,v 1.14 2002/01/20 04:36:08 craigmcc Exp $
  + * @version $Id: TestAll.java,v 1.15 2002/02/13 20:59:12 morgand Exp $
    */
   public class TestAll extends TestCase {
       public TestAll(String testName) {
  @@ -96,6 +96,7 @@
           suite.addTest(TestTreeBag.suite());
           suite.addTest(TestTreeMap.suite());
           suite.addTest(TestDoubleOrderedMap.suite());
  +        suite.addTest(TestLRUMap.suite());
           return suite;
       }
           
  
  
  
  1.2       +16 -4     jakarta-commons/collections/src/test/org/apache/commons/collections/TestLRUMap.java
  
  Index: TestLRUMap.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/TestLRUMap.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestLRUMap.java	6 May 2001 11:10:36 -0000	1.1
  +++ TestLRUMap.java	13 Feb 2002 20:59:12 -0000	1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/TestLRUMap.java,v 1.1 2001/05/06 11:10:36 jstrachan Exp $
  - * $Revision: 1.1 $
  - * $Date: 2001/05/06 11:10:36 $
  + * $Header: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/TestLRUMap.java,v 1.2 2002/02/13 20:59:12 morgand Exp $
  + * $Revision: 1.2 $
  + * $Date: 2002/02/13 20:59:12 $
    *
    * ====================================================================
    *
  @@ -69,7 +69,7 @@
   
   /**
    * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
  - * @version $Id: TestLRUMap.java,v 1.1 2001/05/06 11:10:36 jstrachan Exp $
  + * @version $Id: TestLRUMap.java,v 1.2 2002/02/13 20:59:12 morgand Exp $
    */
   public class TestLRUMap extends TestHashMap
   {
  @@ -93,6 +93,18 @@
   
       public void setUp() {
           map = (HashMap) makeMap();
  +    }
  +
  +    public void testRemoveLRU() {
  +        LRUMap map2 = new LRUMap(4);
  +        map2.put(new Integer(1),"foo");
  +        map2.put(new Integer(2),"foo");
  +        map2.put(new Integer(3),"foo");
  +        map2.put(new Integer(4),"foo");
  +        map2.removeLRU();  // should be Integer(4)
  +
  +        assertTrue("Second to last value should exist",map2.get(new Integer(3)).equals("foo"));
  +        assertTrue("Last value inserted should not exist", map2.get(new Integer(4)) == null);
       }
   
   }
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>