Author: tn
Date: Thu Nov 12 19:35:51 2015
New Revision: 1714107

URL: http://svn.apache.org/viewvc?rev=1714107&view=rev
Log:
Fix test compilation and execution errors.

Modified:
    
commons/proper/collections/branches/COLLECTIONS_3_2_X/src/test/org/apache/commons/collections/TestExtendedProperties.java
    
commons/proper/collections/branches/COLLECTIONS_3_2_X/src/test/org/apache/commons/collections/functors/AbstractTestSerialization.java
    
commons/proper/collections/branches/COLLECTIONS_3_2_X/src/test/org/apache/commons/collections/functors/TestPrototypeFactory.java
    
commons/proper/collections/branches/COLLECTIONS_3_2_X/src/test/org/apache/commons/collections/map/TestFlat3Map.java

Modified: 
commons/proper/collections/branches/COLLECTIONS_3_2_X/src/test/org/apache/commons/collections/TestExtendedProperties.java
URL: 
http://svn.apache.org/viewvc/commons/proper/collections/branches/COLLECTIONS_3_2_X/src/test/org/apache/commons/collections/TestExtendedProperties.java?rev=1714107&r1=1714106&r2=1714107&view=diff
==============================================================================
--- 
commons/proper/collections/branches/COLLECTIONS_3_2_X/src/test/org/apache/commons/collections/TestExtendedProperties.java
 (original)
+++ 
commons/proper/collections/branches/COLLECTIONS_3_2_X/src/test/org/apache/commons/collections/TestExtendedProperties.java
 Thu Nov 12 19:35:51 2015
@@ -319,7 +319,9 @@ public class TestExtendedProperties exte
         SecurityManager manager = new SecurityManager() {
 
             public void checkPropertyAccess(String key) {
-                throw new SecurityException();
+                if ("file.separator".equals(key)) {
+                    throw new SecurityException();
+                }
             }
 
             public void checkPermission(Permission perm) {
@@ -333,7 +335,6 @@ public class TestExtendedProperties exte
             ExtendedProperties properties = new ExtendedProperties();
             assertNotNull(properties);
         } catch (Exception ex) {
-            ex.printStackTrace();
             fail("failed to instantiate ExtendedProperties");
         } finally {
             System.setSecurityManager(null);

Modified: 
commons/proper/collections/branches/COLLECTIONS_3_2_X/src/test/org/apache/commons/collections/functors/AbstractTestSerialization.java
URL: 
http://svn.apache.org/viewvc/commons/proper/collections/branches/COLLECTIONS_3_2_X/src/test/org/apache/commons/collections/functors/AbstractTestSerialization.java?rev=1714107&r1=1714106&r2=1714107&view=diff
==============================================================================
--- 
commons/proper/collections/branches/COLLECTIONS_3_2_X/src/test/org/apache/commons/collections/functors/AbstractTestSerialization.java
 (original)
+++ 
commons/proper/collections/branches/COLLECTIONS_3_2_X/src/test/org/apache/commons/collections/functors/AbstractTestSerialization.java
 Thu Nov 12 19:35:51 2015
@@ -60,7 +60,7 @@ public abstract class AbstractTestSerial
     //-----------------------------------------------------------------------
     
     public void testSerializationDisabled() throws Exception {
-        
Assert.assertNull(System.getProperty(FunctorUtils.UNSAFE_SERIALIZABLE_PROPERTY));
+        
Assert.assertFalse("true".equalsIgnoreCase(System.getProperty(FunctorUtils.UNSAFE_SERIALIZABLE_PROPERTY)));
         Object object = makeObject();
         try {
             serialize(object);
@@ -82,7 +82,7 @@ public abstract class AbstractTestSerial
     }
 
     public void testSerializationEnabled() throws Exception {
-        
Assert.assertNull(System.getProperty(FunctorUtils.UNSAFE_SERIALIZABLE_PROPERTY));
+        
Assert.assertFalse("true".equalsIgnoreCase(System.getProperty(FunctorUtils.UNSAFE_SERIALIZABLE_PROPERTY)));
         System.setProperty(FunctorUtils.UNSAFE_SERIALIZABLE_PROPERTY, "true");
 
         try {
@@ -96,7 +96,7 @@ public abstract class AbstractTestSerial
                 fail("de-serialization of " + getTestClass().getName() + " 
should be enabled");
             }
         } finally {
-            System.clearProperty(FunctorUtils.UNSAFE_SERIALIZABLE_PROPERTY);
+            System.setProperty(FunctorUtils.UNSAFE_SERIALIZABLE_PROPERTY, 
"false");
         }
     }
     

Modified: 
commons/proper/collections/branches/COLLECTIONS_3_2_X/src/test/org/apache/commons/collections/functors/TestPrototypeFactory.java
URL: 
http://svn.apache.org/viewvc/commons/proper/collections/branches/COLLECTIONS_3_2_X/src/test/org/apache/commons/collections/functors/TestPrototypeFactory.java?rev=1714107&r1=1714106&r2=1714107&view=diff
==============================================================================
--- 
commons/proper/collections/branches/COLLECTIONS_3_2_X/src/test/org/apache/commons/collections/functors/TestPrototypeFactory.java
 (original)
+++ 
commons/proper/collections/branches/COLLECTIONS_3_2_X/src/test/org/apache/commons/collections/functors/TestPrototypeFactory.java
 Thu Nov 12 19:35:51 2015
@@ -75,7 +75,7 @@ public class TestPrototypeFactory extend
             Object dest = in.readObject();
             in.close();
         } finally {
-            System.clearProperty(FunctorUtils.UNSAFE_SERIALIZABLE_PROPERTY);
+            System.setProperty(FunctorUtils.UNSAFE_SERIALIZABLE_PROPERTY, 
"false");
         }
     }
 
@@ -106,7 +106,7 @@ public class TestPrototypeFactory extend
             Object dest = in.readObject();
             in.close();
         } finally {
-            System.clearProperty(FunctorUtils.UNSAFE_SERIALIZABLE_PROPERTY);
+            System.setProperty(FunctorUtils.UNSAFE_SERIALIZABLE_PROPERTY, 
"false");
         }
     }
 
@@ -129,7 +129,7 @@ public class TestPrototypeFactory extend
             Object dest = in.readObject();
             in.close();
         } finally {
-            System.clearProperty(FunctorUtils.UNSAFE_SERIALIZABLE_PROPERTY);
+            System.setProperty(FunctorUtils.UNSAFE_SERIALIZABLE_PROPERTY, 
"false");
         }
     }
 

Modified: 
commons/proper/collections/branches/COLLECTIONS_3_2_X/src/test/org/apache/commons/collections/map/TestFlat3Map.java
URL: 
http://svn.apache.org/viewvc/commons/proper/collections/branches/COLLECTIONS_3_2_X/src/test/org/apache/commons/collections/map/TestFlat3Map.java?rev=1714107&r1=1714106&r2=1714107&view=diff
==============================================================================
--- 
commons/proper/collections/branches/COLLECTIONS_3_2_X/src/test/org/apache/commons/collections/map/TestFlat3Map.java
 (original)
+++ 
commons/proper/collections/branches/COLLECTIONS_3_2_X/src/test/org/apache/commons/collections/map/TestFlat3Map.java
 Thu Nov 12 19:35:51 2015
@@ -207,17 +207,17 @@ public class TestFlat3Map extends Abstra
     
     public void testCollections261() {
         final Flat3Map m = new Flat3Map();
-        m.put( Integer.valueOf(1), Integer.valueOf(1) );
-        m.put( Integer.valueOf(0), Integer.valueOf(0) );
-        assertEquals( Integer.valueOf(1), m.remove( Integer.valueOf(1) ) ); 
-        assertEquals( Integer.valueOf(0), m.remove( Integer.valueOf(0) ) ); 
+        m.put( new Integer(1), new Integer(1) );
+        m.put( new Integer(0), new Integer(0) );
+        assertEquals( new Integer(1), m.remove( new Integer(1) ) ); 
+        assertEquals( new Integer(0), m.remove( new Integer(0) ) ); 
 
-        m.put( Integer.valueOf(2), Integer.valueOf(2) );
-        m.put( Integer.valueOf(1), Integer.valueOf(1) );
-        m.put( Integer.valueOf(0), Integer.valueOf(0) );
-        assertEquals( Integer.valueOf(2), m.remove( Integer.valueOf(2) ) ); 
-        assertEquals( Integer.valueOf(1), m.remove( Integer.valueOf(1) ) ); 
-        assertEquals( Integer.valueOf(0), m.remove( Integer.valueOf(0) ) ); 
+        m.put( new Integer(2), new Integer(2) );
+        m.put( new Integer(1), new Integer(1) );
+        m.put( new Integer(0), new Integer(0) );
+        assertEquals( new Integer(2), m.remove( new Integer(2) ) ); 
+        assertEquals( new Integer(1), m.remove( new Integer(1) ) ); 
+        assertEquals( new Integer(0), m.remove( new Integer(0) ) ); 
     }
 
     public void testSerialisation0() throws Exception {


Reply via email to