Index: test/java/org/apache/harmony/beans/tests/java/beans/DefaultPersistenceDelegateTest.java =================================================================== --- test/java/org/apache/harmony/beans/tests/java/beans/DefaultPersistenceDelegateTest.java (revision 462754) +++ test/java/org/apache/harmony/beans/tests/java/beans/DefaultPersistenceDelegateTest.java (working copy) @@ -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]); - assertEquals(null, 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")); } /* Index: test/support/java/org/apache/harmony/beans/tests/support/mock/MockFoo2BeanInfo.java =================================================================== --- test/support/java/org/apache/harmony/beans/tests/support/mock/MockFoo2BeanInfo.java (revision 462754) +++ test/support/java/org/apache/harmony/beans/tests/support/mock/MockFoo2BeanInfo.java (working copy) @@ -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 }; } }