commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scolebou...@apache.org
Subject cvs commit: jakarta-commons/collections build.xml
Date Sun, 16 Nov 2003 21:39:42 GMT
scolebourne    2003/11/16 13:39:42

  Modified:    collections/src/test/org/apache/commons/collections/bidimap
                        AbstractTestSortedBidiMap.java
               collections/src/test/org/apache/commons/collections
                        AbstractTestMap.java AbstractTestCollection.java
               collections build.xml
  Log:
  Rework build script for new test classes
  
  Revision  Changes    Path
  1.2       +9 -10     jakarta-commons/collections/src/test/org/apache/commons/collections/bidimap/AbstractTestSortedBidiMap.java
  
  Index: AbstractTestSortedBidiMap.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/bidimap/AbstractTestSortedBidiMap.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AbstractTestSortedBidiMap.java	16 Nov 2003 20:35:46 -0000	1.1
  +++ AbstractTestSortedBidiMap.java	16 Nov 2003 21:39:42 -0000	1.2
  @@ -71,10 +71,9 @@
   
   import org.apache.commons.collections.AbstractTestSortedMap;
   import org.apache.commons.collections.BulkTest;
  -import org.apache.commons.collections.pairs.DefaultMapEntry;
   
   /**
  - * Abstract test class for {@link BidiMap} methods and contracts.
  + * Abstract test class for {@link SortedBidiMap} methods and contracts.
    * 
    * @version $Revision$ $Date$
    * 
  @@ -253,8 +252,8 @@
           assertEquals(2, set.size());
           
           Iterator it2 = set.iterator();
  -        Map.Entry firstEntry = new DefaultMapEntry((Map.Entry) it2.next());
  -        Map.Entry secondEntry = new DefaultMapEntry((Map.Entry) it2.next());
  +        Map.Entry firstEntry = cloneMapEntry((Map.Entry) it2.next());
  +        Map.Entry secondEntry = cloneMapEntry((Map.Entry) it2.next());
           assertEquals(true, sm.containsKey(first));
           assertEquals(true, sub.containsKey(first));
           assertEquals(true, set.contains(firstEntry));
  @@ -418,8 +417,8 @@
           Set set = sub.entrySet();
           Iterator it2 = set.iterator();
           Object fromEntry = it2.next();
  -        Map.Entry firstEntry = new DefaultMapEntry((Map.Entry) it2.next());
  -        Map.Entry secondEntry = new DefaultMapEntry((Map.Entry) it2.next());
  +        Map.Entry firstEntry = cloneMapEntry((Map.Entry) it2.next());
  +        Map.Entry secondEntry = cloneMapEntry((Map.Entry) it2.next());
           assertEquals(true, sm.containsKey(first));
           assertEquals(true, sub.containsKey(first));
           assertEquals(true, set.contains(firstEntry));
  @@ -601,8 +600,8 @@
           assertEquals(3, set.size());
           Iterator it2 = set.iterator();
           Object fromEntry = it2.next();
  -        Map.Entry firstEntry = new DefaultMapEntry((Map.Entry) it2.next());
  -        Map.Entry secondEntry = new DefaultMapEntry((Map.Entry) it2.next());
  +        Map.Entry firstEntry = cloneMapEntry((Map.Entry) it2.next());
  +        Map.Entry secondEntry = cloneMapEntry((Map.Entry) it2.next());
           assertEquals(true, sm.containsKey(first));
           assertEquals(true, sub.containsKey(first));
           assertEquals(true, set.contains(firstEntry));
  
  
  
  1.13      +11 -2     jakarta-commons/collections/src/test/org/apache/commons/collections/AbstractTestMap.java
  
  Index: AbstractTestMap.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/AbstractTestMap.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- AbstractTestMap.java	4 Nov 2003 23:35:35 -0000	1.12
  +++ AbstractTestMap.java	16 Nov 2003 21:39:42 -0000	1.13
  @@ -435,6 +435,15 @@
           return new HashMap();
       }
   
  +    /**
  +     * Creates a new Map Entry that is independent of the first and the map.
  +     */
  +    protected Map.Entry cloneMapEntry(Map.Entry entry) {
  +        HashMap map = new HashMap();
  +        map.put(entry.getKey(), entry.getValue());
  +        return (Map.Entry) map.entrySet().iterator().next();
  +    }
  +
       //-----------------------------------------------------------------------
       /**
        * Test to ensure the test setup is working properly.  This method checks
  
  
  
  1.9       +13 -5     jakarta-commons/collections/src/test/org/apache/commons/collections/AbstractTestCollection.java
  
  Index: AbstractTestCollection.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/AbstractTestCollection.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- AbstractTestCollection.java	4 Nov 2003 23:34:46 -0000	1.8
  +++ AbstractTestCollection.java	16 Nov 2003 21:39:42 -0000	1.9
  @@ -63,14 +63,13 @@
   import java.util.Collection;
   import java.util.Collections;
   import java.util.ConcurrentModificationException;
  +import java.util.HashMap;
   import java.util.HashSet;
   import java.util.Iterator;
   import java.util.List;
   import java.util.Map;
   import java.util.NoSuchElementException;
   
  -import org.apache.commons.collections.pairs.DefaultMapEntry;
  -
   /**
    * Abstract test class for {@link java.util.Collection} methods and contracts.
    * <p>
  @@ -405,6 +404,15 @@
           return makeCollection();
       }
   
  +    /**
  +     * Creates a new Map Entry that is independent of the first and the map.
  +     */
  +    protected Map.Entry cloneMapEntry(Map.Entry entry) {
  +        HashMap map = new HashMap();
  +        map.put(entry.getKey(), entry.getValue());
  +        return (Map.Entry) map.entrySet().iterator().next();
  +    }
  +
       //-----------------------------------------------------------------------
       /**
        *  Returns an array of objects that are contained in a collection
  @@ -850,7 +858,7 @@
               // TreeMap reuses the Map Entry, so the verify below fails
               // Clone it here if necessary
               if (o instanceof Map.Entry) {
  -                o = new DefaultMapEntry((Map.Entry) o);
  +                o = cloneMapEntry((Map.Entry) o);
               }
               iter.remove();
   
  
  
  
  1.51      +6 -1      jakarta-commons/collections/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/build.xml,v
  retrieving revision 1.50
  retrieving revision 1.51
  diff -u -r1.50 -r1.51
  --- build.xml	29 Oct 2003 00:06:25 -0000	1.50
  +++ build.xml	16 Nov 2003 21:39:42 -0000	1.51
  @@ -38,7 +38,12 @@
         <include name="**/Bag.java"/>
         <include name="**/BidiMap.java"/>
         <include name="**/MapIterator.java"/>
  +      <include name="**/OrderedBidiMap.java"/>
  +      <include name="**/OrderedIterator.java"/>
  +      <include name="**/map/OrderedMap.java"/>
  +      <include name="**/OrderedMapIterator.java"/>
         <include name="**/SortedBag.java"/>
  +      <include name="**/SortedBidiMap.java"/>
         <include name="**/AbstractTest*.java"/>
         <include name="**/BulkTest*.java"/>
      </patternset>
  
  
  

---------------------------------------------------------------------
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