commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From morg...@apache.org
Subject cvs commit: jakarta-commons/collections/src/test/org/apache/commons/collections/comparators TestReverseComparator.java
Date Fri, 01 Mar 2002 19:06:45 GMT
morgand     02/03/01 11:06:45

  Modified:    collections/src/test/org/apache/commons/collections
                        TestAll.java
  Added:       collections/src/test/org/apache/commons/collections/comparators
                        TestReverseComparator.java
  Log:
  added ReverseComparator test
  
  Revision  Changes    Path
  1.22      +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.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- TestAll.java	1 Mar 2002 18:36:21 -0000	1.21
  +++ TestAll.java	1 Mar 2002 19:06:44 -0000	1.22
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/TestAll.java,v
1.21 2002/03/01 18:36:21 morgand Exp $
  - * $Revision: 1.21 $
  - * $Date: 2002/03/01 18:36:21 $
  + * $Header: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/TestAll.java,v
1.22 2002/03/01 19:06:44 morgand Exp $
  + * $Revision: 1.22 $
  + * $Date: 2002/03/01 19:06:44 $
    *
    * ====================================================================
    *
  @@ -67,7 +67,7 @@
   /**
    * Entry point for all Collections tests.
    * @author Rodney Waldhoff
  - * @version $Id: TestAll.java,v 1.21 2002/03/01 18:36:21 morgand Exp $
  + * @version $Id: TestAll.java,v 1.22 2002/03/01 19:06:44 morgand Exp $
    */
   public class TestAll extends TestCase {
       public TestAll(String testName) {
  @@ -96,6 +96,7 @@
           suite.addTest(TestHashBag.suite());
           suite.addTest(TestLRUMap.suite());
           suite.addTest(TestMultiHashMap.suite());
  +        suite.addTest(TestReverseComparator.suite());
           suite.addTest(TestSequencedHashMap.suite());
           suite.addTest(TestSingletonIterator.suite());
           suite.addTest(TestTreeBag.suite());
  
  
  
  1.1                  jakarta-commons/collections/src/test/org/apache/commons/collections/comparators/TestReverseComparator.java
  
  Index: TestReverseComparator.java
  ===================================================================
  package org.apache.commons.collections.comparators;
  
  import java.util.Comparator;
  import java.util.LinkedList;
  import java.util.List;
  
  import junit.framework.Test;
  import junit.framework.TestCase;
  import junit.framework.TestSuite;
  
  public class TestReverseComparator extends TestComparator {
  
      public TestReverseComparator(String testName) {
          super(testName);
      }
  
      public static Test suite() {
          return new TestSuite(TestReverseComparator.class);
      }
  
      /**
       * For the purposes of this test, return a 
       * ReverseComparator that wraps a ComparableComparator, 
       * which should produce a backward-ordered list
       * identical to the java.util.Collection.reverseOrder()
       * Comparator.
       * 
       * @return Comparator that reverses a "natural" order
       */
      public Comparator makeComparator() {
          return new ReverseComparator(new ComparableComparator());
      }
  
      public List getComparableObjectsOrdered() {
          List list = new LinkedList();
          list.add(new Integer(5));
          list.add(new Integer(4));
          list.add(new Integer(3));
          list.add(new Integer(2));
          list.add(new Integer(1));
          return list;
      }
  
  }
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message