harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r464477 - in /incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test: java/org/apache/harmony/beans/tests/java/beans/DefaultPersistenceDelegateTest.java support/java/org/apache/harmony/beans/tests/support/mock/MockFoo2BeanInfo.java
Date Mon, 16 Oct 2006 13:18:18 GMT
Author: tellison
Date: Mon Oct 16 06:18:17 2006
New Revision: 464477

URL: http://svn.apache.org/viewvc?view=rev&rev=464477
Log:
Apply patch HARMONY-1506 ([classlib][beans] new fixes for DefaultPersistenceDelegateTest failures)

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

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/DefaultPersistenceDelegateTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/DefaultPersistenceDelegateTest.java?view=diff&rev=464477&r1=464476&r2=464477
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/DefaultPersistenceDelegateTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/DefaultPersistenceDelegateTest.java
Mon Oct 16 06:18:17 2006
@@ -345,15 +345,15 @@
      */
     public void testInstantiate_NotRegularGetter() throws Exception {
         MockPersistenceDelegate pd = new MockPersistenceDelegate(new String[] {
-                "prop1", "i" });
+                "prop"});
         MockFoo2 b = new MockFoo2(2);
         Expression e = pd.instantiate(b, new Encoder());
+
         assertSame(b, e.getValue());
         assertSame(MockFoo2.class, e.getTarget());
         assertEquals("new", e.getMethodName());
-        assertEquals(2, e.getArguments().length);
+        assertEquals(1, e.getArguments().length);
         assertEquals(new Integer(2), e.getArguments()[0]);
-        assertNull(e.getArguments()[1]);
     }
 
     /*
@@ -361,7 +361,8 @@
      */
     public void testMutatesTo_NormalNoProperty() {
         MockPersistenceDelegate pd = new MockPersistenceDelegate();
-        assertTrue(pd.mutatesTo("test1", "test2"));
+        
+        assertTrue(pd.mutatesTo("test1", "test1"));
         assertFalse(pd.mutatesTo(new Object(), new Object() {
             public int hashCode() {
                 return super.hashCode();
@@ -377,6 +378,7 @@
     public void testMutatesTo_NormalWithPropertyNoEqualMethod() {
         MockPersistenceDelegate pd = new MockPersistenceDelegate(
                 new String[] { "name" });
+
         assertFalse(pd.mutatesTo(new Object(), new Object() {
             public int hashCode() {
                 return super.hashCode();
@@ -391,6 +393,7 @@
     public void testMutatesTo_NormalWithNullPropertyPublicEqualMethod() {
         MockPersistenceDelegate pd = new MockPersistenceDelegate(
                 new String[] { null });
+
         assertFalse(pd.mutatesTo("test1", "test2"));
     }
 
@@ -400,7 +403,8 @@
      */
     public void testMutatesTo_NormalWithEmptyPropertyPublicEqualMethod() {
         MockPersistenceDelegate pd = new MockPersistenceDelegate(new String[0]);
-        assertTrue(pd.mutatesTo("test1", "test2"));
+        
+        assertTrue(pd.mutatesTo("test1", "test1"));
     }
 
     /*
@@ -410,6 +414,7 @@
     public void testMutatesTo_NormalWithPropertyPublicEqualMethod() {
         MockPersistenceDelegate pd = new MockPersistenceDelegate(
                 new String[] { "name" });
+
         assertFalse(pd.mutatesTo("test1", "test2"));
         assertTrue(pd.mutatesTo("test1", "test1"));
     }
@@ -421,6 +426,7 @@
     public void testMutatesTo_NormalWithPropertyProtectedEqualMethod() {
         MockPersistenceDelegate pd = new MockPersistenceDelegate(
                 new String[] { "name" });
+
         assertFalse(pd.mutatesTo(new MockPersistenceDelegate(), "test"));
     }
 
@@ -429,14 +435,8 @@
      */
     public void testMutatesTo_Null() {
         MockPersistenceDelegate pd = new MockPersistenceDelegate();
-        assertFalse(pd.mutatesTo("test", null));
-        assertFalse(pd.mutatesTo(null, null));
-        try {
-            pd.mutatesTo(null, "test");
-            fail("Should throw NullPointerException!");
-        } catch (NullPointerException ex) {
-            // expected
-        }
+
+        assertFalse(pd.mutatesTo(null, "test"));
     }
 
     /*

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/MockFoo2BeanInfo.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/MockFoo2BeanInfo.java?view=diff&rev=464477&r1=464476&r2=464477
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/MockFoo2BeanInfo.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/MockFoo2BeanInfo.java
Mon Oct 16 06:18:17 2006
@@ -28,16 +28,15 @@
 
     @Override
     public PropertyDescriptor[] getPropertyDescriptors() {
-        PropertyDescriptor[] pds = new PropertyDescriptor[1];
+        PropertyDescriptor pd = null;
+
         try {
-            PropertyDescriptor pd = new PropertyDescriptor("prop",
+            pd = new PropertyDescriptor("prop",
                     MockFoo2.class, "myget", "myset");
-            pd.setName(pd.getName() + ".BeanInfo");
-            pds[0] = pd;
         } catch (IntrospectionException e) {
             throw new Error(e);
         }
-        return pds;
+        return new PropertyDescriptor[] { pd };
     }
 
 }



Mime
View raw message