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/src/test/org/apache/commons/collections/collection TestTransformedCollection.java
Date Sat, 10 Apr 2004 22:22:57 GMT
scolebourne    2004/04/10 15:22:57

  Modified:    collections/data/test
                        TransformedSortedMap.fullCollection.version3.1.obj
                        TransformedSortedMap.emptyCollection.version3.1.obj
                        TransformedMap.emptyCollection.version3.1.obj
                        TransformedMap.fullCollection.version3.1.obj
               collections/src/test/org/apache/commons/collections/map
                        TestTransformedMap.java
                        TestTransformedSortedMap.java
               collections/src/test/org/apache/commons/collections/collection
                        TestTransformedCollection.java
  Log:
  Change TransformedMap test cases to use good Transformer for serialization
  
  Revision  Changes    Path
  1.3       +1 -1      jakarta-commons/collections/data/test/TransformedSortedMap.fullCollection.version3.1.obj
  
  	<<Binary file>>
  
  
  1.3       +1 -1      jakarta-commons/collections/data/test/TransformedSortedMap.emptyCollection.version3.1.obj
  
  	<<Binary file>>
  
  
  1.2       +1 -1      jakarta-commons/collections/data/test/TransformedMap.emptyCollection.version3.1.obj
  
  	<<Binary file>>
  
  
  1.3       +1 -1      jakarta-commons/collections/data/test/TransformedMap.fullCollection.version3.1.obj
  
  	<<Binary file>>
  
  
  1.7       +3 -2      jakarta-commons/collections/src/test/org/apache/commons/collections/map/TestTransformedMap.java
  
  Index: TestTransformedMap.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/map/TestTransformedMap.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- TestTransformedMap.java	9 Apr 2004 09:43:09 -0000	1.6
  +++ TestTransformedMap.java	10 Apr 2004 22:22:56 -0000	1.7
  @@ -22,6 +22,7 @@
   import junit.framework.Test;
   import junit.framework.TestSuite;
   
  +import org.apache.commons.collections.TransformerUtils;
   import org.apache.commons.collections.collection.TestTransformedCollection;
   
   /**
  @@ -50,7 +51,7 @@
   
       //-----------------------------------------------------------------------
       public Map makeEmptyMap() {
  -        return TransformedMap.decorate(new HashMap(), TestTransformedCollection.NOOP_TRANSFORMER,
TestTransformedCollection.NOOP_TRANSFORMER);
  +        return TransformedMap.decorate(new HashMap(), TransformerUtils.nopTransformer(),
TransformerUtils.nopTransformer());
       }
   
       //-----------------------------------------------------------------------
  
  
  
  1.6       +3 -2      jakarta-commons/collections/src/test/org/apache/commons/collections/map/TestTransformedSortedMap.java
  
  Index: TestTransformedSortedMap.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/map/TestTransformedSortedMap.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TestTransformedSortedMap.java	9 Apr 2004 09:43:09 -0000	1.5
  +++ TestTransformedSortedMap.java	10 Apr 2004 22:22:57 -0000	1.6
  @@ -22,6 +22,7 @@
   import junit.framework.Test;
   
   import org.apache.commons.collections.BulkTest;
  +import org.apache.commons.collections.TransformerUtils;
   import org.apache.commons.collections.collection.TestTransformedCollection;
   
   /**
  @@ -50,7 +51,7 @@
   
       //-----------------------------------------------------------------------
       public Map makeEmptyMap() {
  -        return TransformedSortedMap.decorate(new TreeMap(), TestTransformedCollection.NOOP_TRANSFORMER,
TestTransformedCollection.NOOP_TRANSFORMER);
  +        return TransformedSortedMap.decorate(new TreeMap(), TransformerUtils.nopTransformer(),
TransformerUtils.nopTransformer());
       }
   
       public boolean isSubMapViewsSerializable() {
  
  
  
  1.6       +4 -10     jakarta-commons/collections/src/test/org/apache/commons/collections/collection/TestTransformedCollection.java
  
  Index: TestTransformedCollection.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/collection/TestTransformedCollection.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TestTransformedCollection.java	18 Feb 2004 01:20:40 -0000	1.5
  +++ TestTransformedCollection.java	10 Apr 2004 22:22:57 -0000	1.6
  @@ -15,7 +15,6 @@
    */
   package org.apache.commons.collections.collection;
   
  -import java.io.Serializable;
   import java.util.ArrayList;
   import java.util.Arrays;
   import java.util.Collection;
  @@ -25,6 +24,7 @@
   import junit.framework.TestSuite;
   
   import org.apache.commons.collections.Transformer;
  +import org.apache.commons.collections.TransformerUtils;
   
   /**
    * Extension of {@link TestCollection} for exercising the {@link TransformedCollection}
  @@ -37,19 +37,13 @@
    */
   public class TestTransformedCollection extends AbstractTestCollection {
       
  -    private static class Noop implements Transformer, Serializable {
  -        public Object transform(Object input) {
  -            return input;
  -        }
  -    }
  -    
  -    private static class StringToInteger implements Transformer, Serializable {
  +    private static class StringToInteger implements Transformer {
           public Object transform(Object input) {
               return new Integer((String) input);
           }
       }
       
  -    public static final Transformer NOOP_TRANSFORMER = new Noop();
  +    public static final Transformer NOOP_TRANSFORMER = TransformerUtils.nopTransformer();
       public static final Transformer STRING_TO_INTEGER_TRANSFORMER = new StringToInteger();
   
       public TestTransformedCollection(String testName) {
  
  
  

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