harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r598642 - /harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/DefaultPersistenceDelegateTest.java
Date Tue, 27 Nov 2007 13:41:16 GMT
Author: tellison
Date: Tue Nov 27 05:41:07 2007
New Revision: 598642

URL: http://svn.apache.org/viewvc?rev=598642&view=rev
Log:
Apply regression test for HARMONY-2490 ([classlib][beans] java.beans.DefaultPersistenceDelegate.initialize()
does not throw NullPointerException (RI compatibility issue))

Modified:
    harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/DefaultPersistenceDelegateTest.java

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/DefaultPersistenceDelegateTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/DefaultPersistenceDelegateTest.java?rev=598642&r1=598641&r2=598642&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/DefaultPersistenceDelegateTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/DefaultPersistenceDelegateTest.java
Tue Nov 27 05:41:07 2007
@@ -374,6 +374,28 @@
         assertNull(e.getArguments()[0]);
     }
 
+    public void testInstantiate_NPE() {
+
+        try {
+            testDefaultPersistenceDelegate obj = new testDefaultPersistenceDelegate();
+            obj.initialize(Object.class, null, new Object(), new Encoder());
+            fail("NullPointerException should be thrown");
+        } catch (NullPointerException e) {
+            // expected
+        }
+    }
+
+    class testDefaultPersistenceDelegate extends DefaultPersistenceDelegate {
+        testDefaultPersistenceDelegate() {
+            super();
+        }
+
+        public void initialize(Class<?> type, Object oldInstance,
+                Object newInstance, Encoder out) {
+            super.initialize(type, oldInstance, newInstance, out);
+        }
+    }
+        
     /*
      * Tests mutatesTo() under normal conditions without any properties.
      */



Mime
View raw message