harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r452415 [6/12] - in /incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test: java-internal/java/beans/beancontext/ java-internal/org/apache/harmony/beans/ java/org/apache/harmony/beans/tests/ java/org/apache/harmony/beans/tests/ja...
Date Tue, 03 Oct 2006 11:06:03 GMT
Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PersistenceDelegateTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PersistenceDelegateTest.java?view=diff&rev=452415&r1=452414&r2=452415
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PersistenceDelegateTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PersistenceDelegateTest.java Tue Oct  3 04:05:57 2006
@@ -35,422 +35,441 @@
  */
 public class PersistenceDelegateTest extends TestCase {
 
-	protected void setUp() throws Exception {
-		super.setUp();
-		CallVerificationStack.getInstance().clear();
-	}
-
-	/*
-	 * Test the constructor.
-	 */
-	public void testConstructor() {
-		new DummyPersistenceDelegate();
-	}
-
-	/*
-	 * Tests writeObject() under normal condition when mutatesTo() returns True.
-	 */
-	public void testWriteObject_NormalMutatesToTrue() {
-		MockPersistenceDelegate pd = new MockPersistenceDelegate(true, true);
-		MockEncoder enc = new MockEncoder();
-		MockFoo oldInstance = new MockFoo();
-		enc.setPersistenceDelegate(MockFooStop.class, pd);
-
-		pd.writeObject(oldInstance, enc);
-
-		// should have called initialize()
-		assertSame(enc, CallVerificationStack.getInstance().pop());
-		assertSame(null, CallVerificationStack.getInstance().pop());
-		assertSame(oldInstance, CallVerificationStack.getInstance().pop());
-		assertEquals(
-				"org.apache.harmony.beans.tests.java.beans.PersistenceDelegateTest$MockPersistenceDelegate",
-				CallVerificationStack.getInstance().getCurrentSourceClass());
-		assertEquals("initialize", CallVerificationStack.getInstance()
-				.getCurrentSourceMethod());
-		assertSame(MockFoo.class, CallVerificationStack.getInstance().pop());
-
-		// should have called mutatesTo()
-		assertSame(null, CallVerificationStack.getInstance().pop());
-		assertEquals(
-				"org.apache.harmony.beans.tests.java.beans.PersistenceDelegateTest$MockPersistenceDelegate",
-				CallVerificationStack.getInstance().getCurrentSourceClass());
-		assertEquals("mutatesTo", CallVerificationStack.getInstance()
-				.getCurrentSourceMethod());
-		assertSame(oldInstance, CallVerificationStack.getInstance().pop());
-
-		// should have called Encoder.get()
-		assertEquals(
-				"org.apache.harmony.beans.tests.java.beans.PersistenceDelegateTest$MockEncoder",
-				CallVerificationStack.getInstance().getCurrentSourceClass());
-		assertEquals("get", CallVerificationStack.getInstance()
-				.getCurrentSourceMethod());
-		assertSame(oldInstance, CallVerificationStack.getInstance().pop());
-
-		assertTrue(CallVerificationStack.getInstance().empty());
-	}
-
-	/*
-	 * Tests writeObject() under normal condition when mutatesTo() returns
-	 * false.
-	 */
-	public void testWriteObject_NormalMutatesToFalse() {
-		MockPersistenceDelegate pd = new MockPersistenceDelegate(false, true);
-		MockEncoder enc = new MockEncoder();
-		MockFoo oldInstance = new MockFoo();
-		enc.setPersistenceDelegate(MockFooStop.class, pd);
-
-		pd.writeObject(oldInstance, enc);
-
-		// should have called writeExpression()
-		assertEquals(
-				"org.apache.harmony.beans.tests.java.beans.PersistenceDelegateTest$MockEncoder",
-				CallVerificationStack.getInstance().getCurrentSourceClass());
-		assertEquals("writeExpression", CallVerificationStack.getInstance()
-				.getCurrentSourceMethod());
-		assertTrue(CallVerificationStack.getInstance().pop() instanceof Expression);
-
-		// should have called instantiate()
-		assertSame(enc, CallVerificationStack.getInstance().pop());
-		assertEquals(
-				"org.apache.harmony.beans.tests.java.beans.PersistenceDelegateTest$MockPersistenceDelegate",
-				CallVerificationStack.getInstance().getCurrentSourceClass());
-		assertEquals("instantiate", CallVerificationStack.getInstance()
-				.getCurrentSourceMethod());
-		assertSame(oldInstance, CallVerificationStack.getInstance().pop());
-
-		// should have called Encoder.remove()
-		assertEquals(
-				"org.apache.harmony.beans.tests.java.beans.PersistenceDelegateTest$MockEncoder",
-				CallVerificationStack.getInstance().getCurrentSourceClass());
-		assertEquals("remove", CallVerificationStack.getInstance()
-				.getCurrentSourceMethod());
-		assertSame(oldInstance, CallVerificationStack.getInstance().pop());
-
-		// should have called mutatesTo()
-		assertSame(null, CallVerificationStack.getInstance().pop());
-		assertEquals(
-				"org.apache.harmony.beans.tests.java.beans.PersistenceDelegateTest$MockPersistenceDelegate",
-				CallVerificationStack.getInstance().getCurrentSourceClass());
-		assertEquals("mutatesTo", CallVerificationStack.getInstance()
-				.getCurrentSourceMethod());
-		assertSame(oldInstance, CallVerificationStack.getInstance().pop());
-
-		// should have called Encoder.get()
-		assertEquals(
-				"org.apache.harmony.beans.tests.java.beans.PersistenceDelegateTest$MockEncoder",
-				CallVerificationStack.getInstance().getCurrentSourceClass());
-		assertEquals("get", CallVerificationStack.getInstance()
-				.getCurrentSourceMethod());
-		assertSame(oldInstance, CallVerificationStack.getInstance().pop());
-
-		assertTrue(CallVerificationStack.getInstance().empty());
-	}
-
-	/*
-	 * Tests writeObject() when object is null.
-	 */
-	public void testWriteObject_NullObject() {
-		MockPersistenceDelegate pd = new MockPersistenceDelegate();
-		MockEncoder enc = new MockEncoder();
-		enc.setPersistenceDelegate(MockFooStop.class, pd);
-
-		try {
-			pd.writeObject(null, enc);
-			fail("Should throw NullPointerException!");
-		} catch (NullPointerException ex) {
-			// expected
-		}
-	}
-
-	/*
-	 * Tests writeObject() when encoder is null.
-	 */
-	public void testWriteObject_NullEncoder() {
-		MockPersistenceDelegate pd = new MockPersistenceDelegate();
-		MockEncoder enc = new MockEncoder();
-		enc.setPersistenceDelegate(MockFooStop.class, pd);
-
-		try {
-			pd.writeObject(new MockFoo(), null);
-			fail("Should throw NullPointerException!");
-		} catch (NullPointerException ex) {
-			// expected
-		}
-	}
-
-	/*
-	 * Tests initialize() under normal conditions.
-	 */
-	public void testInitialize_Normal() {
-		DummyPersistenceDelegate pd = new DummyPersistenceDelegate();
-		Encoder enc = new Encoder();
-		Object o1 = new Object();
-		Object o2 = new Object();
-		enc.setPersistenceDelegate(MockFooStop.class,
-				new MockPersistenceDelegate());
-		pd.initialize(MockFoo.class, o1, o2, enc);
-		assertSame(enc, CallVerificationStack.getInstance().pop());
-		assertSame(o2, CallVerificationStack.getInstance().pop());
-		assertSame(o1, CallVerificationStack.getInstance().pop());
-		assertEquals(
-				"org.apache.harmony.beans.tests.java.beans.PersistenceDelegateTest$MockPersistenceDelegate",
-				CallVerificationStack.getInstance().getCurrentSourceClass());
-		assertEquals("initialize", CallVerificationStack.getInstance()
-				.getCurrentSourceMethod());
-		assertSame(MockFooStop.class, CallVerificationStack.getInstance().pop());
-		assertTrue(CallVerificationStack.getInstance().empty());
-		// test interface
-		o1 = new MockObject();
-		enc.setPersistenceDelegate(MockInterface.class,
-				new MockPersistenceDelegate());
-		pd.initialize(MockObject.class, o1, o1, enc);
-		assertTrue(CallVerificationStack.getInstance().empty());
-	}
-
-	/*
-	 * Tests initialize() with null class.
-	 */
-	public void testInitialize_NullClass() {
-		DummyPersistenceDelegate pd = new DummyPersistenceDelegate();
-		Encoder enc = new Encoder();
-		Object o1 = new Object();
-		Object o2 = new Object();
-		enc.setPersistenceDelegate(MockFooStop.class,
-				new MockPersistenceDelegate());
-		try {
-			pd.initialize(null, o1, o2, enc);
-			fail("Should throw NullPointerException!");
-		} catch (NullPointerException ex) {
-			// expected
-		}
-	}
-
-	/*
-	 * Tests initialize() with null old and new instances.
-	 */
-	public void testInitialize_NullInstances() {
-		DummyPersistenceDelegate pd = new DummyPersistenceDelegate();
-		Encoder enc = new Encoder();
-		enc.setPersistenceDelegate(MockFooStop.class,
-				new MockPersistenceDelegate());
-		pd.initialize(MockFoo.class, null, null, enc);
-		assertSame(enc, CallVerificationStack.getInstance().pop());
-		assertSame(null, CallVerificationStack.getInstance().pop());
-		assertSame(null, CallVerificationStack.getInstance().pop());
-		assertEquals(
-				"org.apache.harmony.beans.tests.java.beans.PersistenceDelegateTest$MockPersistenceDelegate",
-				CallVerificationStack.getInstance().getCurrentSourceClass());
-		assertEquals("initialize", CallVerificationStack.getInstance()
-				.getCurrentSourceMethod());
-		assertSame(MockFooStop.class, CallVerificationStack.getInstance().pop());
-		assertTrue(CallVerificationStack.getInstance().empty());
-	}
-
-	/*
-	 * Tests initialize() with null encoder.
-	 */
-	public void testInitialize_NullEncoder() {
-		DummyPersistenceDelegate pd = new DummyPersistenceDelegate();
-		Object o1 = new Object();
-		Object o2 = new Object();
-		try {
-			pd.initialize(MockFoo.class, o1, o2, null);
-			fail("Should throw NullPointerException!");
-		} catch (NullPointerException ex) {
-			// expected
-		}
-	}
-
-	/*
-	 * Tests mutatesTo() under normal conditions.
-	 */
-	public void testMutatesTo_Normal() {
-		DummyPersistenceDelegate pd = new DummyPersistenceDelegate();
-		assertTrue(pd.mutatesTo("test1", "test2"));
-		assertFalse(pd.mutatesTo(new Object(), new Object() {
-			public int hashCode() {
-				return super.hashCode();
-			}
-		}));
-		assertFalse(pd.mutatesTo(new MockFoo(), new MockFooStop()));
-		// DummyEncoder enc = new DummyEncoder();
-		// pd.writeObject(new MockFoo(), enc);
-	}
-
-	/*
-	 * Tests mutatesTo() with null parameters.
-	 */
-	public void testMutatesTo_Null() {
-		DummyPersistenceDelegate pd = new DummyPersistenceDelegate();
-		assertFalse(pd.mutatesTo("test", null));
-		assertFalse(pd.mutatesTo(null, null));
-		try {
-			pd.mutatesTo(null, "test");
-			fail("Should throw NullPointerException!");
-		} catch (NullPointerException ex) {
-			// expected
-		}
-	}
-
-	/*
-	 * Mock interface.
-	 */
-	static interface MockInterface {
-
-	}
-
-	/*
-	 * Mock interface.
-	 */
-	static class MockObject implements MockInterface {
-
-	}
-
-	/*
-	 * Mock Encoder.
-	 */
-	static class MockEncoder extends Encoder {
-
-		public Object get(Object oldInstance) {
-			StackTraceElement[] eles = (new Throwable()).getStackTrace();
-			if (eles[2].getClassName().equals(
-					MockPersistenceDelegate.class.getName())) {
-				CallVerificationStack.getInstance().push(oldInstance);
-			}
-			return super.get(oldInstance);
-		}
-
-		public ExceptionListener getExceptionListener() {
-			return super.getExceptionListener();
-		}
-
-		public PersistenceDelegate getPersistenceDelegate(Class type) {
-			return super.getPersistenceDelegate(type);
-		}
-
-		public Object remove(Object oldInstance) {
-			StackTraceElement[] eles = (new Throwable()).getStackTrace();
-			if (eles[2].getClassName().equals(
-					MockPersistenceDelegate.class.getName())) {
-				CallVerificationStack.getInstance().push(oldInstance);
-			}
-			return super.remove(oldInstance);
-		}
-
-		public void setExceptionListener(ExceptionListener exceptionListener) {
-			super.setExceptionListener(exceptionListener);
-		}
-
-		public void setPersistenceDelegate(Class type,
-				PersistenceDelegate persistenceDelegate) {
-			super.setPersistenceDelegate(type, persistenceDelegate);
-		}
-
-		public void writeExpression(Expression oldExp) {
-			StackTraceElement[] eles = (new Throwable()).getStackTrace();
-			if (eles[2].getClassName().equals(
-					MockPersistenceDelegate.class.getName())) {
-				CallVerificationStack.getInstance().push(oldExp);
-			}
-			super.writeExpression(oldExp);
-		}
-
-		public void writeStatement(Statement oldStm) {
-			StackTraceElement[] eles = (new Throwable()).getStackTrace();
-			if (eles[2].getClassName().equals(
-					MockPersistenceDelegate.class.getName())) {
-				CallVerificationStack.getInstance().push(oldStm);
-			}
-			super.writeStatement(oldStm);
-		}
-
-		public void writeObject(Object o) {
-			super.writeObject(o);
-		}
-	}
-
-	/*
-	 * Mock PersistenceDelegate subclass.
-	 */
-	static class MockPersistenceDelegate extends PersistenceDelegate {
-		private boolean filter = false;
-
-		private boolean mutatesToResult = true;
-
-		public MockPersistenceDelegate() {
-			// empty
-		}
-
-		public MockPersistenceDelegate(boolean mutatesToResult, boolean filter) {
-			this.mutatesToResult = mutatesToResult;
-			this.filter = filter;
-		}
-
-		public void setMutatesToResult(boolean ret) {
-			this.mutatesToResult = ret;
-		}
-
-		public Expression instantiate(Object oldInstance, Encoder out) {
-			StackTraceElement[] eles = (new Throwable()).getStackTrace();
-			if (!this.filter
-					|| eles[2].getClassName().equals(this.getClass().getName())) {
-				CallVerificationStack.getInstance().push(oldInstance);
-				CallVerificationStack.getInstance().push(out);
-			}
-			return new Expression(oldInstance, MockFoo.class, "new", null);
-		}
-
-		public void initialize(Class type, Object oldInstance,
-				Object newInstance, Encoder enc) {
-			StackTraceElement[] eles = (new Throwable()).getStackTrace();
-			if (!this.filter
-					|| eles[2].getClassName().equals(this.getClass().getName())) {
-				CallVerificationStack.getInstance().push(type);
-				CallVerificationStack.getInstance().push(oldInstance);
-				CallVerificationStack.getInstance().push(newInstance);
-				CallVerificationStack.getInstance().push(enc);
-			}
-		}
-
-		public boolean mutatesTo(Object oldInstance, Object newInstance) {
-			StackTraceElement[] eles = (new Throwable()).getStackTrace();
-			if (!this.filter
-					|| eles[2].getClassName().equals(this.getClass().getName())) {
-				CallVerificationStack.getInstance().push(oldInstance);
-				CallVerificationStack.getInstance().push(newInstance);
-			}
-			return this.mutatesToResult;
-		}
-
-		public void writeObject(Object oldInstance, Encoder enc) {
-			// CallVerificationStack.getInstance().push(oldInstance);
-			// CallVerificationStack.getInstance().push(enc);
-			super.writeObject(oldInstance, enc);
-		}
-
-	}
-
-	/*
-	 * Dummy PersistenceDelegate subclass.
-	 */
-	static class DummyPersistenceDelegate extends PersistenceDelegate {
-		public Expression instantiate(Object oldInstance, Encoder out) {
-			return new Expression(oldInstance.getClass(), "new", null);
-		}
-
-		public void initialize(Class type, Object oldInstance,
-				Object newInstance, Encoder enc) {
-			super.initialize(type, oldInstance, newInstance, enc);
-		}
-
-		public boolean mutatesTo(Object oldInstance, Object newInstance) {
-			return super.mutatesTo(oldInstance, newInstance);
-		}
-
-		public void writeObject(Object oldInstance, Encoder enc) {
-			super.writeObject(oldInstance, enc);
-		}
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+        CallVerificationStack.getInstance().clear();
+    }
+
+    /*
+     * Test the constructor.
+     */
+    public void testConstructor() {
+        new DummyPersistenceDelegate();
+    }
+
+    /*
+     * Tests writeObject() under normal condition when mutatesTo() returns True.
+     */
+    public void testWriteObject_NormalMutatesToTrue() {
+        MockPersistenceDelegate pd = new MockPersistenceDelegate(true, true);
+        MockEncoder enc = new MockEncoder();
+        MockFoo oldInstance = new MockFoo();
+        enc.setPersistenceDelegate(MockFooStop.class, pd);
+
+        pd.writeObject(oldInstance, enc);
+
+        // should have called initialize()
+        assertSame(enc, CallVerificationStack.getInstance().pop());
+        assertSame(null, CallVerificationStack.getInstance().pop());
+        assertSame(oldInstance, CallVerificationStack.getInstance().pop());
+        assertEquals(
+                "org.apache.harmony.beans.tests.java.beans.PersistenceDelegateTest$MockPersistenceDelegate",
+                CallVerificationStack.getInstance().getCurrentSourceClass());
+        assertEquals("initialize", CallVerificationStack.getInstance()
+                .getCurrentSourceMethod());
+        assertSame(MockFoo.class, CallVerificationStack.getInstance().pop());
+
+        // should have called mutatesTo()
+        assertSame(null, CallVerificationStack.getInstance().pop());
+        assertEquals(
+                "org.apache.harmony.beans.tests.java.beans.PersistenceDelegateTest$MockPersistenceDelegate",
+                CallVerificationStack.getInstance().getCurrentSourceClass());
+        assertEquals("mutatesTo", CallVerificationStack.getInstance()
+                .getCurrentSourceMethod());
+        assertSame(oldInstance, CallVerificationStack.getInstance().pop());
+
+        // should have called Encoder.get()
+        assertEquals(
+                "org.apache.harmony.beans.tests.java.beans.PersistenceDelegateTest$MockEncoder",
+                CallVerificationStack.getInstance().getCurrentSourceClass());
+        assertEquals("get", CallVerificationStack.getInstance()
+                .getCurrentSourceMethod());
+        assertSame(oldInstance, CallVerificationStack.getInstance().pop());
+
+        assertTrue(CallVerificationStack.getInstance().empty());
+    }
+
+    /*
+     * Tests writeObject() under normal condition when mutatesTo() returns
+     * false.
+     */
+    public void testWriteObject_NormalMutatesToFalse() {
+        MockPersistenceDelegate pd = new MockPersistenceDelegate(false, true);
+        MockEncoder enc = new MockEncoder();
+        MockFoo oldInstance = new MockFoo();
+        enc.setPersistenceDelegate(MockFooStop.class, pd);
+
+        pd.writeObject(oldInstance, enc);
+
+        // should have called writeExpression()
+        assertEquals(
+                "org.apache.harmony.beans.tests.java.beans.PersistenceDelegateTest$MockEncoder",
+                CallVerificationStack.getInstance().getCurrentSourceClass());
+        assertEquals("writeExpression", CallVerificationStack.getInstance()
+                .getCurrentSourceMethod());
+        assertTrue(CallVerificationStack.getInstance().pop() instanceof Expression);
+
+        // should have called instantiate()
+        assertSame(enc, CallVerificationStack.getInstance().pop());
+        assertEquals(
+                "org.apache.harmony.beans.tests.java.beans.PersistenceDelegateTest$MockPersistenceDelegate",
+                CallVerificationStack.getInstance().getCurrentSourceClass());
+        assertEquals("instantiate", CallVerificationStack.getInstance()
+                .getCurrentSourceMethod());
+        assertSame(oldInstance, CallVerificationStack.getInstance().pop());
+
+        // should have called Encoder.remove()
+        assertEquals(
+                "org.apache.harmony.beans.tests.java.beans.PersistenceDelegateTest$MockEncoder",
+                CallVerificationStack.getInstance().getCurrentSourceClass());
+        assertEquals("remove", CallVerificationStack.getInstance()
+                .getCurrentSourceMethod());
+        assertSame(oldInstance, CallVerificationStack.getInstance().pop());
+
+        // should have called mutatesTo()
+        assertSame(null, CallVerificationStack.getInstance().pop());
+        assertEquals(
+                "org.apache.harmony.beans.tests.java.beans.PersistenceDelegateTest$MockPersistenceDelegate",
+                CallVerificationStack.getInstance().getCurrentSourceClass());
+        assertEquals("mutatesTo", CallVerificationStack.getInstance()
+                .getCurrentSourceMethod());
+        assertSame(oldInstance, CallVerificationStack.getInstance().pop());
+
+        // should have called Encoder.get()
+        assertEquals(
+                "org.apache.harmony.beans.tests.java.beans.PersistenceDelegateTest$MockEncoder",
+                CallVerificationStack.getInstance().getCurrentSourceClass());
+        assertEquals("get", CallVerificationStack.getInstance()
+                .getCurrentSourceMethod());
+        assertSame(oldInstance, CallVerificationStack.getInstance().pop());
+
+        assertTrue(CallVerificationStack.getInstance().empty());
+    }
+
+    /*
+     * Tests writeObject() when object is null.
+     */
+    public void testWriteObject_NullObject() {
+        MockPersistenceDelegate pd = new MockPersistenceDelegate();
+        MockEncoder enc = new MockEncoder();
+        enc.setPersistenceDelegate(MockFooStop.class, pd);
+
+        try {
+            pd.writeObject(null, enc);
+            fail("Should throw NullPointerException!");
+        } catch (NullPointerException ex) {
+            // expected
+        }
+    }
+
+    /*
+     * Tests writeObject() when encoder is null.
+     */
+    public void testWriteObject_NullEncoder() {
+        MockPersistenceDelegate pd = new MockPersistenceDelegate();
+        MockEncoder enc = new MockEncoder();
+        enc.setPersistenceDelegate(MockFooStop.class, pd);
+
+        try {
+            pd.writeObject(new MockFoo(), null);
+            fail("Should throw NullPointerException!");
+        } catch (NullPointerException ex) {
+            // expected
+        }
+    }
+
+    /*
+     * Tests initialize() under normal conditions.
+     */
+    public void testInitialize_Normal() {
+        DummyPersistenceDelegate pd = new DummyPersistenceDelegate();
+        Encoder enc = new Encoder();
+        Object o1 = new Object();
+        Object o2 = new Object();
+        enc.setPersistenceDelegate(MockFooStop.class,
+                new MockPersistenceDelegate());
+        pd.initialize(MockFoo.class, o1, o2, enc);
+        assertSame(enc, CallVerificationStack.getInstance().pop());
+        assertSame(o2, CallVerificationStack.getInstance().pop());
+        assertSame(o1, CallVerificationStack.getInstance().pop());
+        assertEquals(
+                "org.apache.harmony.beans.tests.java.beans.PersistenceDelegateTest$MockPersistenceDelegate",
+                CallVerificationStack.getInstance().getCurrentSourceClass());
+        assertEquals("initialize", CallVerificationStack.getInstance()
+                .getCurrentSourceMethod());
+        assertSame(MockFooStop.class, CallVerificationStack.getInstance().pop());
+        assertTrue(CallVerificationStack.getInstance().empty());
+        // test interface
+        o1 = new MockObject();
+        enc.setPersistenceDelegate(MockInterface.class,
+                new MockPersistenceDelegate());
+        pd.initialize(MockObject.class, o1, o1, enc);
+        assertTrue(CallVerificationStack.getInstance().empty());
+    }
+
+    /*
+     * Tests initialize() with null class.
+     */
+    public void testInitialize_NullClass() {
+        DummyPersistenceDelegate pd = new DummyPersistenceDelegate();
+        Encoder enc = new Encoder();
+        Object o1 = new Object();
+        Object o2 = new Object();
+        enc.setPersistenceDelegate(MockFooStop.class,
+                new MockPersistenceDelegate());
+        try {
+            pd.initialize(null, o1, o2, enc);
+            fail("Should throw NullPointerException!");
+        } catch (NullPointerException ex) {
+            // expected
+        }
+    }
+
+    /*
+     * Tests initialize() with null old and new instances.
+     */
+    public void testInitialize_NullInstances() {
+        DummyPersistenceDelegate pd = new DummyPersistenceDelegate();
+        Encoder enc = new Encoder();
+        enc.setPersistenceDelegate(MockFooStop.class,
+                new MockPersistenceDelegate());
+        pd.initialize(MockFoo.class, null, null, enc);
+        assertSame(enc, CallVerificationStack.getInstance().pop());
+        assertSame(null, CallVerificationStack.getInstance().pop());
+        assertSame(null, CallVerificationStack.getInstance().pop());
+        assertEquals(
+                "org.apache.harmony.beans.tests.java.beans.PersistenceDelegateTest$MockPersistenceDelegate",
+                CallVerificationStack.getInstance().getCurrentSourceClass());
+        assertEquals("initialize", CallVerificationStack.getInstance()
+                .getCurrentSourceMethod());
+        assertSame(MockFooStop.class, CallVerificationStack.getInstance().pop());
+        assertTrue(CallVerificationStack.getInstance().empty());
+    }
+
+    /*
+     * Tests initialize() with null encoder.
+     */
+    public void testInitialize_NullEncoder() {
+        DummyPersistenceDelegate pd = new DummyPersistenceDelegate();
+        Object o1 = new Object();
+        Object o2 = new Object();
+        try {
+            pd.initialize(MockFoo.class, o1, o2, null);
+            fail("Should throw NullPointerException!");
+        } catch (NullPointerException ex) {
+            // expected
+        }
+    }
+
+    /*
+     * Tests mutatesTo() under normal conditions.
+     */
+    public void testMutatesTo_Normal() {
+        DummyPersistenceDelegate pd = new DummyPersistenceDelegate();
+        assertTrue(pd.mutatesTo("test1", "test2"));
+        assertFalse(pd.mutatesTo(new Object(), new Object() {
+            @Override
+            public int hashCode() {
+                return super.hashCode();
+            }
+        }));
+        assertFalse(pd.mutatesTo(new MockFoo(), new MockFooStop()));
+        // DummyEncoder enc = new DummyEncoder();
+        // pd.writeObject(new MockFoo(), enc);
+    }
+
+    /*
+     * Tests mutatesTo() with null parameters.
+     */
+    public void testMutatesTo_Null() {
+        DummyPersistenceDelegate pd = new DummyPersistenceDelegate();
+        assertFalse(pd.mutatesTo("test", null));
+        assertFalse(pd.mutatesTo(null, null));
+        try {
+            pd.mutatesTo(null, "test");
+            fail("Should throw NullPointerException!");
+        } catch (NullPointerException ex) {
+            // expected
+        }
+    }
+
+    /*
+     * Mock interface.
+     */
+    static interface MockInterface {
+
+    }
+
+    /*
+     * Mock interface.
+     */
+    static class MockObject implements MockInterface {
+
+    }
+
+    /*
+     * Mock Encoder.
+     */
+    static class MockEncoder extends Encoder {
+
+        @Override
+        public Object get(Object oldInstance) {
+            StackTraceElement[] eles = (new Throwable()).getStackTrace();
+            if (eles[2].getClassName().equals(
+                    MockPersistenceDelegate.class.getName())) {
+                CallVerificationStack.getInstance().push(oldInstance);
+            }
+            return super.get(oldInstance);
+        }
+
+        @Override
+        public ExceptionListener getExceptionListener() {
+            return super.getExceptionListener();
+        }
+
+        @Override
+        public PersistenceDelegate getPersistenceDelegate(Class type) {
+            return super.getPersistenceDelegate(type);
+        }
+
+        @Override
+        public Object remove(Object oldInstance) {
+            StackTraceElement[] eles = (new Throwable()).getStackTrace();
+            if (eles[2].getClassName().equals(
+                    MockPersistenceDelegate.class.getName())) {
+                CallVerificationStack.getInstance().push(oldInstance);
+            }
+            return super.remove(oldInstance);
+        }
+
+        @Override
+        public void setExceptionListener(ExceptionListener exceptionListener) {
+            super.setExceptionListener(exceptionListener);
+        }
+
+        @Override
+        public void setPersistenceDelegate(Class type,
+                PersistenceDelegate persistenceDelegate) {
+            super.setPersistenceDelegate(type, persistenceDelegate);
+        }
+
+        @Override
+        public void writeExpression(Expression oldExp) {
+            StackTraceElement[] eles = (new Throwable()).getStackTrace();
+            if (eles[2].getClassName().equals(
+                    MockPersistenceDelegate.class.getName())) {
+                CallVerificationStack.getInstance().push(oldExp);
+            }
+            super.writeExpression(oldExp);
+        }
+
+        @Override
+        public void writeStatement(Statement oldStm) {
+            StackTraceElement[] eles = (new Throwable()).getStackTrace();
+            if (eles[2].getClassName().equals(
+                    MockPersistenceDelegate.class.getName())) {
+                CallVerificationStack.getInstance().push(oldStm);
+            }
+            super.writeStatement(oldStm);
+        }
+
+        @Override
+        public void writeObject(Object o) {
+            super.writeObject(o);
+        }
+    }
+
+    /*
+     * Mock PersistenceDelegate subclass.
+     */
+    static class MockPersistenceDelegate extends PersistenceDelegate {
+        private boolean filter = false;
+
+        private boolean mutatesToResult = true;
+
+        public MockPersistenceDelegate() {
+            // empty
+        }
+
+        public MockPersistenceDelegate(boolean mutatesToResult, boolean filter) {
+            this.mutatesToResult = mutatesToResult;
+            this.filter = filter;
+        }
+
+        public void setMutatesToResult(boolean ret) {
+            this.mutatesToResult = ret;
+        }
+
+        @Override
+        public Expression instantiate(Object oldInstance, Encoder out) {
+            StackTraceElement[] eles = (new Throwable()).getStackTrace();
+            if (!this.filter
+                    || eles[2].getClassName().equals(this.getClass().getName())) {
+                CallVerificationStack.getInstance().push(oldInstance);
+                CallVerificationStack.getInstance().push(out);
+            }
+            return new Expression(oldInstance, MockFoo.class, "new", null);
+        }
+
+        @Override
+        public void initialize(Class type, Object oldInstance,
+                Object newInstance, Encoder enc) {
+            StackTraceElement[] eles = (new Throwable()).getStackTrace();
+            if (!this.filter
+                    || eles[2].getClassName().equals(this.getClass().getName())) {
+                CallVerificationStack.getInstance().push(type);
+                CallVerificationStack.getInstance().push(oldInstance);
+                CallVerificationStack.getInstance().push(newInstance);
+                CallVerificationStack.getInstance().push(enc);
+            }
+        }
+
+        @Override
+        public boolean mutatesTo(Object oldInstance, Object newInstance) {
+            StackTraceElement[] eles = (new Throwable()).getStackTrace();
+            if (!this.filter
+                    || eles[2].getClassName().equals(this.getClass().getName())) {
+                CallVerificationStack.getInstance().push(oldInstance);
+                CallVerificationStack.getInstance().push(newInstance);
+            }
+            return this.mutatesToResult;
+        }
+
+        @Override
+        public void writeObject(Object oldInstance, Encoder enc) {
+            // CallVerificationStack.getInstance().push(oldInstance);
+            // CallVerificationStack.getInstance().push(enc);
+            super.writeObject(oldInstance, enc);
+        }
+
+    }
+
+    /*
+     * Dummy PersistenceDelegate subclass.
+     */
+    static class DummyPersistenceDelegate extends PersistenceDelegate {
+        @Override
+        public Expression instantiate(Object oldInstance, Encoder out) {
+            return new Expression(oldInstance.getClass(), "new", null);
+        }
+
+        @Override
+        public void initialize(Class type, Object oldInstance,
+                Object newInstance, Encoder enc) {
+            super.initialize(type, oldInstance, newInstance, enc);
+        }
+
+        @Override
+        public boolean mutatesTo(Object oldInstance, Object newInstance) {
+            return super.mutatesTo(oldInstance, newInstance);
+        }
+
+        @Override
+        public void writeObject(Object oldInstance, Encoder enc) {
+            super.writeObject(oldInstance, enc);
+        }
 
-	}
+    }
 
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PropertyChangeEventTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PropertyChangeEventTest.java?view=diff&rev=452415&r1=452414&r2=452415
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PropertyChangeEventTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PropertyChangeEventTest.java Tue Oct  3 04:05:57 2006
@@ -29,117 +29,117 @@
  * Test class java.beans.PropertyChangeEvent.
  */
 public class PropertyChangeEventTest extends TestCase {
-	/*
-	 * Test the constructor with normal parameters.
-	 */
-	public void testConstructor_Normal() {
-		Object src = new Object();
-		Object oldValue = new Object();
-		Object newValue = new Object();
-
-		PropertyChangeEvent event = new PropertyChangeEvent(src, "myPropName",
-				oldValue, newValue);
-		assertSame(src, event.getSource());
-		assertEquals("myPropName", event.getPropertyName());
-		assertSame(oldValue, event.getOldValue());
-		assertSame(newValue, event.getNewValue());
-		assertNull(event.getPropagationId());
-	}
-
-	/*
-	 * Test the constructor with null parameters except the source parameter.
-	 */
-	public void testConstructor_Null() {
-		Object src = new Object();
-		PropertyChangeEvent event = new PropertyChangeEvent(src, null, null,
-				null);
-		assertSame(src, event.getSource());
-		assertEquals(null, event.getPropertyName());
-		assertSame(null, event.getOldValue());
-		assertSame(null, event.getNewValue());
-		assertNull(event.getPropagationId());
-	}
-
-	/*
-	 * Test the constructor with null properties but non-null old and new
-	 * values.
-	 */
-	public void testConstructor_NullProperty() {
-		Object src = new Object();
-		Object oldValue = new Object();
-		Object newValue = new Object();
-		PropertyChangeEvent event = new PropertyChangeEvent(src, null,
-				oldValue, newValue);
-		assertSame(src, event.getSource());
-		assertEquals(null, event.getPropertyName());
-		assertSame(oldValue, event.getOldValue());
-		assertSame(newValue, event.getNewValue());
-		assertNull(event.getPropagationId());
-	}
-
-	/*
-	 * Test the constructor with null source parameter.
-	 */
-	public void testConstructor_NullSrc() {
-		try {
-			new PropertyChangeEvent(null, "prop", new Object(), new Object());
-			fail("Should throw IllegalArgumentException!");
-		} catch (IllegalArgumentException ex) {
-			// expected
-		}
-	}
-
-	/*
-	 * Test the method setPropagationId() with a normal value.
-	 */
-	public void testSetPropagationId_Normal() {
-		Object src = new Object();
-		Object oldValue = new Object();
-		Object newValue = new Object();
-
-		PropertyChangeEvent event = new PropertyChangeEvent(src, "myPropName",
-				oldValue, newValue);
-		assertNull(event.getPropagationId());
-
-		Object pid = new Object();
-		event.setPropagationId(pid);
-
-		assertSame(src, event.getSource());
-		assertEquals("myPropName", event.getPropertyName());
-		assertSame(oldValue, event.getOldValue());
-		assertSame(newValue, event.getNewValue());
-		assertSame(pid, event.getPropagationId());
-	}
-
-	/*
-	 * Test the method setPropagationId() with a null value.
-	 */
-	public void testSetPropagationId_Null() {
-		Object src = new Object();
-		Object oldValue = new Object();
-		Object newValue = new Object();
-
-		PropertyChangeEvent event = new PropertyChangeEvent(src, "myPropName",
-				oldValue, newValue);
-		assertNull(event.getPropagationId());
-
-		// set null when already null
-		event.setPropagationId(null);
-		assertNull(event.getPropagationId());
-
-		// set a non-null value
-		Object pid = new Object();
-		event.setPropagationId(pid);
-		assertSame(src, event.getSource());
-		assertEquals("myPropName", event.getPropertyName());
-		assertSame(oldValue, event.getOldValue());
-		assertSame(newValue, event.getNewValue());
-		assertSame(pid, event.getPropagationId());
-
-		// reset to null
-		event.setPropagationId(null);
-		assertNull(event.getPropagationId());
-	}
+    /*
+     * Test the constructor with normal parameters.
+     */
+    public void testConstructor_Normal() {
+        Object src = new Object();
+        Object oldValue = new Object();
+        Object newValue = new Object();
+
+        PropertyChangeEvent event = new PropertyChangeEvent(src, "myPropName",
+                oldValue, newValue);
+        assertSame(src, event.getSource());
+        assertEquals("myPropName", event.getPropertyName());
+        assertSame(oldValue, event.getOldValue());
+        assertSame(newValue, event.getNewValue());
+        assertNull(event.getPropagationId());
+    }
+
+    /*
+     * Test the constructor with null parameters except the source parameter.
+     */
+    public void testConstructor_Null() {
+        Object src = new Object();
+        PropertyChangeEvent event = new PropertyChangeEvent(src, null, null,
+                null);
+        assertSame(src, event.getSource());
+        assertEquals(null, event.getPropertyName());
+        assertSame(null, event.getOldValue());
+        assertSame(null, event.getNewValue());
+        assertNull(event.getPropagationId());
+    }
+
+    /*
+     * Test the constructor with null properties but non-null old and new
+     * values.
+     */
+    public void testConstructor_NullProperty() {
+        Object src = new Object();
+        Object oldValue = new Object();
+        Object newValue = new Object();
+        PropertyChangeEvent event = new PropertyChangeEvent(src, null,
+                oldValue, newValue);
+        assertSame(src, event.getSource());
+        assertEquals(null, event.getPropertyName());
+        assertSame(oldValue, event.getOldValue());
+        assertSame(newValue, event.getNewValue());
+        assertNull(event.getPropagationId());
+    }
+
+    /*
+     * Test the constructor with null source parameter.
+     */
+    public void testConstructor_NullSrc() {
+        try {
+            new PropertyChangeEvent(null, "prop", new Object(), new Object());
+            fail("Should throw IllegalArgumentException!");
+        } catch (IllegalArgumentException ex) {
+            // expected
+        }
+    }
+
+    /*
+     * Test the method setPropagationId() with a normal value.
+     */
+    public void testSetPropagationId_Normal() {
+        Object src = new Object();
+        Object oldValue = new Object();
+        Object newValue = new Object();
+
+        PropertyChangeEvent event = new PropertyChangeEvent(src, "myPropName",
+                oldValue, newValue);
+        assertNull(event.getPropagationId());
+
+        Object pid = new Object();
+        event.setPropagationId(pid);
+
+        assertSame(src, event.getSource());
+        assertEquals("myPropName", event.getPropertyName());
+        assertSame(oldValue, event.getOldValue());
+        assertSame(newValue, event.getNewValue());
+        assertSame(pid, event.getPropagationId());
+    }
+
+    /*
+     * Test the method setPropagationId() with a null value.
+     */
+    public void testSetPropagationId_Null() {
+        Object src = new Object();
+        Object oldValue = new Object();
+        Object newValue = new Object();
+
+        PropertyChangeEvent event = new PropertyChangeEvent(src, "myPropName",
+                oldValue, newValue);
+        assertNull(event.getPropagationId());
+
+        // set null when already null
+        event.setPropagationId(null);
+        assertNull(event.getPropagationId());
+
+        // set a non-null value
+        Object pid = new Object();
+        event.setPropagationId(pid);
+        assertSame(src, event.getSource());
+        assertEquals("myPropName", event.getPropertyName());
+        assertSame(oldValue, event.getOldValue());
+        assertSame(newValue, event.getNewValue());
+        assertSame(pid, event.getPropagationId());
+
+        // reset to null
+        event.setPropagationId(null);
+        assertNull(event.getPropagationId());
+    }
 
     // comparator for PropertyChangeEvent objects
     public static final SerializableAssert comparator = new SerializableAssert() {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PropertyChangeListenerProxyTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PropertyChangeListenerProxyTest.java?view=diff&rev=452415&r1=452414&r2=452415
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PropertyChangeListenerProxyTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PropertyChangeListenerProxyTest.java Tue Oct  3 04:05:57 2006
@@ -28,51 +28,52 @@
  */
 public class PropertyChangeListenerProxyTest extends TestCase {
 
-	PropertyChangeListenerProxy proxy;
+    PropertyChangeListenerProxy proxy;
 
-	PropertyChangeListener listener = new MockPropertyChangeListener();
+    PropertyChangeListener listener = new MockPropertyChangeListener();
 
-	String name = "mock";
+    String name = "mock";
 
-	static PropertyChangeEvent event = null;
+    static PropertyChangeEvent event = null;
 
-	protected void setUp() throws Exception {
-		super.setUp();
-		proxy = new PropertyChangeListenerProxy(name, listener);
-	}
-
-	public void testPropertyChangeListenerProxy() {
-		proxy = new PropertyChangeListenerProxy(null, listener);
-		assertSame(listener, proxy.getListener());
-		assertNull(proxy.getPropertyName());
-		PropertyChangeEvent newevent = new PropertyChangeEvent(new Object(),
-				"name", new Object(), new Object());
-		proxy.propertyChange(newevent);
-		assertSame(newevent, event);
-		proxy = new PropertyChangeListenerProxy(name, null);
-		assertSame(name, proxy.getPropertyName());
-		assertNull(proxy.getListener());
-		try {
-			proxy.propertyChange(new PropertyChangeEvent(new Object(), "name",
-					new Object(), new Object()));
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+        proxy = new PropertyChangeListenerProxy(name, listener);
+    }
+
+    public void testPropertyChangeListenerProxy() {
+        proxy = new PropertyChangeListenerProxy(null, listener);
+        assertSame(listener, proxy.getListener());
+        assertNull(proxy.getPropertyName());
+        PropertyChangeEvent newevent = new PropertyChangeEvent(new Object(),
+                "name", new Object(), new Object());
+        proxy.propertyChange(newevent);
+        assertSame(newevent, event);
+        proxy = new PropertyChangeListenerProxy(name, null);
+        assertSame(name, proxy.getPropertyName());
+        assertNull(proxy.getListener());
+        try {
+            proxy.propertyChange(new PropertyChangeEvent(new Object(), "name",
+                    new Object(), new Object()));
             fail("NullPointerException expected");
-		} catch (NullPointerException e) {
-		}
+        } catch (NullPointerException e) {
+        }
 
-		proxy = new PropertyChangeListenerProxy(name, listener);
-		assertSame(listener, proxy.getListener());
-		assertSame(name, proxy.getPropertyName());
-		newevent = new PropertyChangeEvent(new Object(), "name", new Object(),
-				new Object());
-		assertSame(name, proxy.getPropertyName());
-		proxy.propertyChange(newevent);
-		assertSame(newevent, event);
-	}
-
-	public void testPropertyChange() {
-		proxy.propertyChange(null);
-		assertNull(event);
-	}
+        proxy = new PropertyChangeListenerProxy(name, listener);
+        assertSame(listener, proxy.getListener());
+        assertSame(name, proxy.getPropertyName());
+        newevent = new PropertyChangeEvent(new Object(), "name", new Object(),
+                new Object());
+        assertSame(name, proxy.getPropertyName());
+        proxy.propertyChange(newevent);
+        assertSame(newevent, event);
+    }
+
+    public void testPropertyChange() {
+        proxy.propertyChange(null);
+        assertNull(event);
+    }
 
     /**
      * Regression for HARMONY-407
@@ -83,14 +84,15 @@
         try {
             proxy.propertyChange(null);
             fail("NullPointerException expected");
-        } catch (NullPointerException e) {}
-    }         
+        } catch (NullPointerException e) {
+        }
+    }
 
     public static class MockPropertyChangeListener implements
-			PropertyChangeListener {
-		public void propertyChange(PropertyChangeEvent newevent) {
-			event = newevent;
-		}
-	}
+            PropertyChangeListener {
+        public void propertyChange(PropertyChangeEvent newevent) {
+            event = newevent;
+        }
+    }
 
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PropertyChangeSupportTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PropertyChangeSupportTest.java?view=diff&rev=452415&r1=452414&r2=452415
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PropertyChangeSupportTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PropertyChangeSupportTest.java Tue Oct  3 04:05:57 2006
@@ -21,22 +21,23 @@
 import java.beans.PropertyChangeListener;
 import java.beans.PropertyChangeListenerProxy;
 import java.beans.PropertyChangeSupport;
-import java.io.Serializable;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
+import java.io.Serializable;
 
 import junit.framework.Test;
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
 import junit.textui.TestRunner;
-import tests.util.SerializationTester;
 
 import org.apache.harmony.beans.tests.support.NonSerializablePropertyChangeListener;
 import org.apache.harmony.beans.tests.support.SerializablePropertyChangeListener;
 
+import tests.util.SerializationTester;
+
 /**
  * Test class PropertyeChangeSupport.
  */
@@ -1302,7 +1303,8 @@
 
         private transient boolean called = false;
 
-        public MockPropertyChangeListener() {}
+        public MockPropertyChangeListener() {
+        }
 
         public MockPropertyChangeListener(Object src, String propName,
                 Object oldValue, Object newValue) {
@@ -1352,42 +1354,44 @@
      */
     static class MockPropertyChangeListener2 implements PropertyChangeListener {
 
-        public void propertyChange(PropertyChangeEvent event) {}
+        public void propertyChange(PropertyChangeEvent event) {
+        }
     }
 
     /*
-     * Mock PropertyChangeListener that modifies the listener set on notification. 
+     * Mock PropertyChangeListener that modifies the listener set on
+     * notification.
      */
     static class MockPropertyChangeListener3 implements PropertyChangeListener {
 
-    	PropertyChangeSupport changeSupport;
-    	
-    	public MockPropertyChangeListener3(PropertyChangeSupport changeSupport) {
-    		super();
-    		this.changeSupport = changeSupport;
-    	}
-    	
-    	/* On property changed event modify the listener set */
-		public void propertyChange(PropertyChangeEvent event) {
-			changeSupport.addPropertyChangeListener(
-				new PropertyChangeListener(){
-					public void propertyChange(PropertyChangeEvent event) {
-						// Empty							
-					}
-				}
-			);
-		}
+        PropertyChangeSupport changeSupport;
+
+        public MockPropertyChangeListener3(PropertyChangeSupport changeSupport) {
+            super();
+            this.changeSupport = changeSupport;
+        }
+
+        /* On property changed event modify the listener set */
+        public void propertyChange(PropertyChangeEvent event) {
+            changeSupport
+                    .addPropertyChangeListener(new PropertyChangeListener() {
+                        public void propertyChange(PropertyChangeEvent event) {
+                            // Empty
+                        }
+                    });
+        }
     }
 
     /**
-     * Regression test for concurrent modification of listener set 
+     * Regression test for concurrent modification of listener set
      */
     public void testConcurrentModification() {
-    	PropertyChangeSupport changeSupport = new PropertyChangeSupport("bogus");
-    	MockPropertyChangeListener3 changeListener = new MockPropertyChangeListener3(changeSupport);
-    	changeSupport.firePropertyChange("bogus property", "previous", "newer");
+        PropertyChangeSupport changeSupport = new PropertyChangeSupport("bogus");
+        MockPropertyChangeListener3 changeListener = new MockPropertyChangeListener3(
+                changeSupport);
+        changeSupport.firePropertyChange("bogus property", "previous", "newer");
     }
-    
+
     /**
      * @tests java.beans.PropertyChangeSupport#PropertyChangeSupport(
      *        java.lang.Object)
@@ -1422,7 +1426,8 @@
 
         PropertyChangeListener lis1 = new PropertyChangeListener() {
 
-            public void propertyChange(PropertyChangeEvent event) {}
+            public void propertyChange(PropertyChangeEvent event) {
+            }
         };
 
         PropertyChangeListener lis2 = new PropertyChangeListenerProxy("name",
@@ -1445,7 +1450,8 @@
         // Regerssion for HARMONY-320
         PropertyChangeListener listener = new PropertyChangeListener() {
 
-            public void propertyChange(PropertyChangeEvent arg0) {}
+            public void propertyChange(PropertyChangeEvent arg0) {
+            }
         };
 
         PropertyChangeSupport pcs = new PropertyChangeSupport(this);
@@ -1496,8 +1502,8 @@
             oos = new ObjectOutputStream(new FileOutputStream("x.ser"));
             PropertyChangeSupport pcs = new PropertyChangeSupport("bean");
             if (array != null && array.length > 0) {
-                for (int i = 0; i < array.length; ++i) {
-                    pcs.addPropertyChangeListener(array[i]);
+                for (PropertyChangeListener element : array) {
+                    pcs.addPropertyChangeListener(element);
                 }
             }
             oos.writeObject(pcs);
@@ -1516,7 +1522,8 @@
         }
     }
 
-    private PropertyChangeListener[] readPropertyChangeListeners() throws Exception {
+    private PropertyChangeListener[] readPropertyChangeListeners()
+            throws Exception {
         ObjectInputStream ois = null;
         PropertyChangeSupport pcs = null;
         try {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PropertyDescriptorTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PropertyDescriptorTest.java?view=diff&rev=452415&r1=452414&r2=452415
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PropertyDescriptorTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PropertyDescriptorTest.java Tue Oct  3 04:05:57 2006
@@ -19,15 +19,15 @@
 
 import java.beans.IntrospectionException;
 import java.beans.PropertyDescriptor;
-import java.beans.PropertyEditorSupport;
 import java.beans.PropertyEditor;
+import java.beans.PropertyEditorSupport;
 import java.io.Serializable;
 import java.lang.reflect.Method;
 
-import org.apache.harmony.beans.tests.support.mock.MockJavaBean;
-
 import junit.framework.TestCase;
 
+import org.apache.harmony.beans.tests.support.mock.MockJavaBean;
+
 /**
  * Unit test for PropertyDescriptor.
  */
@@ -236,7 +236,8 @@
         try {
             new PropertyDescriptor(propertyName, beanClass);
             fail("Should throw IntrospectionException.");
-        } catch (IntrospectionException exception) {}
+        } catch (IntrospectionException exception) {
+        }
     }
 
     public void testPropertyDescriptorStringClass_PropertyNameNull() {
@@ -244,7 +245,8 @@
         try {
             new PropertyDescriptor(null, beanClass);
             fail("Should throw IntrospectionException.");
-        } catch (IntrospectionException exception) {}
+        } catch (IntrospectionException exception) {
+        }
     }
 
     public void testPropertyDescriptorStringClass_BeanClassNull()
@@ -253,7 +255,8 @@
         try {
             new PropertyDescriptor(propertyName, null);
             fail("Should throw IntrospectionException.");
-        } catch (IntrospectionException exception) {}
+        } catch (IntrospectionException exception) {
+        }
     }
 
     public void testPropertyDescriptorStringClass_PropertyNameInvalid() {
@@ -262,7 +265,8 @@
         try {
             new PropertyDescriptor(propertyName, beanClass);
             fail("Should throw IntrospectionException.");
-        } catch (IntrospectionException exception) {}
+        } catch (IntrospectionException exception) {
+        }
     }
 
     public void testPropertyDescriptorStringClass_ProtectedGetter() {
@@ -271,7 +275,8 @@
         try {
             new PropertyDescriptor(propertyName, beanClass);
             fail("Should throw IntrospectionException.");
-        } catch (IntrospectionException exception) {}
+        } catch (IntrospectionException exception) {
+        }
     }
 
     /*
@@ -311,7 +316,8 @@
             new PropertyDescriptor(null, beanClass, "get" + propertyName, "set"
                     + propertyName);
             fail("Should throw IntrospectionException.");
-        } catch (IntrospectionException e) {}
+        } catch (IntrospectionException e) {
+        }
     }
 
     public void testPropertyDescriptorStringClassStringString_BeanClassNull()
@@ -322,7 +328,8 @@
             new PropertyDescriptor(propertyName, beanClass, "get"
                     + propertyName, "set" + propertyName);
             fail("Should throw IntrospectionException.");
-        } catch (IntrospectionException e) {}
+        } catch (IntrospectionException e) {
+        }
     }
 
     public void testPropertyDescriptorStringClassStringString_ReadMethodNull()
@@ -359,7 +366,8 @@
             new PropertyDescriptor(propertyName, beanClass, "getXX", "set"
                     + propertyName);
             fail("Should throw IntrospectionException.");
-        } catch (IntrospectionException e) {}
+        } catch (IntrospectionException e) {
+        }
     }
 
     public void testPropertyDescriptorStringClassStringString_WriteMethodNull()
@@ -396,7 +404,8 @@
             new PropertyDescriptor(propertyName, beanClass, "get"
                     + propertyName, "");
             fail("Should throw IntrospectionException.");
-        } catch (IntrospectionException e) {}
+        } catch (IntrospectionException e) {
+        }
 
     }
 
@@ -408,7 +417,8 @@
             new PropertyDescriptor(propertyName, beanClass, "get"
                     + propertyName, "setXXX");
             fail("Should throw IntrospectionException.");
-        } catch (IntrospectionException e) {}
+        } catch (IntrospectionException e) {
+        }
 
     }
 
@@ -458,7 +468,8 @@
         try {
             new PropertyDescriptor(null, readMethod, writeMethod);
             fail("Should throw IntrospectionException.");
-        } catch (IntrospectionException e) {}
+        } catch (IntrospectionException e) {
+        }
 
     }
 
@@ -506,7 +517,8 @@
         try {
             new PropertyDescriptor(propertyName, readMethod, writeMethod);
             fail("Should throw IntrospectionException.");
-        } catch (IntrospectionException e) {}
+        } catch (IntrospectionException e) {
+        }
 
     }
 
@@ -554,7 +566,8 @@
         try {
             new PropertyDescriptor(propertyName, readMethod, writeMethod);
             fail("Should throw IntrospectionException.");
-        } catch (IntrospectionException e) {}
+        } catch (IntrospectionException e) {
+        }
 
     }
 
@@ -574,9 +587,9 @@
         assertEquals(pd.getWriteMethod().getName(), "setPropertyOne"); //$NON-NLS-1$			
 
         pd = new PropertyDescriptor(
-                "prop1", SubMockJavaBean.class, "getPropertyOne", null); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+                "prop1", SubMockJavaBean.class, "getPropertyOne", null); //$NON-NLS-1$ //$NON-NLS-2$ 
         assertEquals(pd.getReadMethod().getName(), "getPropertyOne"); //$NON-NLS-1$
-        assertNull(pd.getWriteMethod()); //$NON-NLS-1$		
+        assertNull(pd.getWriteMethod()); 
     }
 
     public void testSetReadMethod() throws SecurityException,
@@ -638,7 +651,8 @@
         try {
             pd.setReadMethod(readMethod);
             fail("Should throw IntrospectionException.");
-        } catch (IntrospectionException e) {}
+        } catch (IntrospectionException e) {
+        }
     }
 
     /**
@@ -657,7 +671,8 @@
         try {
             pd.setReadMethod(readMethod);
             fail("Should throw IntrospectionException.");
-        } catch (IntrospectionException e) {}
+        } catch (IntrospectionException e) {
+        }
     }
 
     /**
@@ -681,7 +696,8 @@
         try {
             pd.setReadMethod(readMethod);
             fail("Should throw IntrospectionException.");
-        } catch (IntrospectionException e) {}
+        } catch (IntrospectionException e) {
+        }
     }
 
     /**
@@ -748,7 +764,8 @@
         try {
             pd.setWriteMethod(writeMethod);
             fail("Should throw IntrospectionException.");
-        } catch (IntrospectionException e) {}
+        } catch (IntrospectionException e) {
+        }
     }
 
     /**
@@ -770,7 +787,8 @@
         try {
             pd.setWriteMethod(writeMethod);
             fail("Should throw IntrospectionException.");
-        } catch (IntrospectionException e) {}
+        } catch (IntrospectionException e) {
+        }
     }
 
     public void testSetBound_true() throws SecurityException,
@@ -918,7 +936,7 @@
         new PropertyDescriptor("fox01", FakeFox01.class);
     }
 
-    //Regression test for HARMONY-237
+    // Regression test for HARMONY-237
     public void testIntrospectionExpections() {
         try {
             new PropertyDescriptor(null, null);
@@ -964,10 +982,10 @@
             assertEquals("bad property name", e.getMessage());
         }
     }
-    
+
     public void testCreatePropertyEditor() throws IntrospectionException {
-        PropertyDescriptor pd =
-                new PropertyDescriptor("propertyOne", MockJavaBean.class);
+        PropertyDescriptor pd = new PropertyDescriptor("propertyOne",
+                MockJavaBean.class);
         PropertyEditor pe;
 
         pe = pd.createPropertyEditor(this);
@@ -991,10 +1009,10 @@
 
     }
 
-    public void testCreatePropertyEditor_Invalid() throws
-            IntrospectionException {
-        PropertyDescriptor pd =
-                new PropertyDescriptor("propertyOne", MockJavaBean.class);
+    public void testCreatePropertyEditor_Invalid()
+            throws IntrospectionException {
+        PropertyDescriptor pd = new PropertyDescriptor("propertyOne",
+                MockJavaBean.class);
 
         try {
             pd.setPropertyEditorClass(InvalidPropertyEditor.class);
@@ -1013,14 +1031,14 @@
         }
     }
 
-
     static class FakeFox01 {
 
         public String getFox01() {
             return null;
         }
 
-        public void setFox01(String value) {}
+        public void setFox01(String value) {
+        }
     }
 
     class MockBeanPropertyDesc implements Serializable {
@@ -1056,10 +1074,10 @@
         private static final long serialVersionUID = 7423254295680570566L;
         //
     }
-    
 
     public static class CoolPropertyEditor extends PropertyEditorSupport {
         String str;
+
         String suffix;
 
         public CoolPropertyEditor() {
@@ -1085,13 +1103,11 @@
         }
     }
 
-
     public static class InvalidPropertyEditor extends PropertyEditorSupport {
         // there is no valid constructors
         public InvalidPropertyEditor(Object arg1, Object arg2) {
         }
     }
-
 
     public static class InvalidPropertyEditor2 {
         // is not assignable from PropertyEditor

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PropertyEditorManagerRegressionTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PropertyEditorManagerRegressionTest.java?view=diff&rev=452415&r1=452414&r2=452415
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PropertyEditorManagerRegressionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PropertyEditorManagerRegressionTest.java Tue Oct  3 04:05:57 2006
@@ -17,9 +17,10 @@
 
 package org.apache.harmony.beans.tests.java.beans;
 
-import java.beans.*;
+import java.beans.PropertyEditor;
+import java.beans.PropertyEditorManager;
+
 import junit.framework.TestCase;
-import org.apache.harmony.beans.tests.support.StringEditor;
 
 /**
  * Regression test for PropertyEditorManager

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PropertyEditorManagerTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PropertyEditorManagerTest.java?view=diff&rev=452415&r1=452414&r2=452415
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PropertyEditorManagerTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PropertyEditorManagerTest.java Tue Oct  3 04:05:57 2006
@@ -201,7 +201,8 @@
         try {
             editor.setAsText(null);
             fail("Should throw a Exception");
-        } catch (Exception e) {}
+        } catch (Exception e) {
+        }
     }
 
     public void testBoolEditor_setAsText_Invalid() {
@@ -209,7 +210,8 @@
         try {
             editor.setAsText("***true***");
             fail("Should throw a IllegalArgumentException");
-        } catch (IllegalArgumentException e) {}
+        } catch (IllegalArgumentException e) {
+        }
     }
 
     public void testByteEditor() {
@@ -227,7 +229,8 @@
         try {
             editor.setAsText(null);
             fail("Should throw a NumberFormatException");
-        } catch (NumberFormatException e) {}
+        } catch (NumberFormatException e) {
+        }
     }
 
     public void testByteEditor_invalid() {
@@ -235,7 +238,8 @@
         try {
             editor.setAsText("invalid");
             fail("Should throw a NumberFormatException");
-        } catch (NumberFormatException e) {}
+        } catch (NumberFormatException e) {
+        }
     }
 
     public void testByteEditor_invalid2() {
@@ -243,7 +247,8 @@
         try {
             editor.setAsText("128");
             fail("Should throw a NumberFormatException");
-        } catch (NumberFormatException e) {}
+        } catch (NumberFormatException e) {
+        }
     }
 
     public void testDoubleEditor() {
@@ -261,7 +266,8 @@
         try {
             editor.setAsText(null);
             fail("Should throw a NullPointerException");
-        } catch (NullPointerException e) {}
+        } catch (NullPointerException e) {
+        }
     }
 
     public void testDoubleEditor_SetAsText_Invalid() {
@@ -269,7 +275,8 @@
         try {
             editor.setAsText("invalid");
             fail("Should throw a NumberFormatException");
-        } catch (NumberFormatException e) {}
+        } catch (NumberFormatException e) {
+        }
     }
 
     public void testFloatEditor() {
@@ -288,7 +295,8 @@
         try {
             editor.setAsText(null);
             fail("Should throw a NullPointerException");
-        } catch (NullPointerException e) {}
+        } catch (NullPointerException e) {
+        }
     }
 
     public void testFloatEditor_SetAsText_Invalid() {
@@ -296,7 +304,8 @@
         try {
             editor.setAsText("invalid");
             fail("Should throw a NumberFormatException");
-        } catch (NumberFormatException e) {}
+        } catch (NumberFormatException e) {
+        }
     }
 
     public void testLongEditor() {
@@ -315,7 +324,8 @@
         try {
             editor.setAsText(null);
             fail("Should throw a NumberFormatException");
-        } catch (NumberFormatException e) {}
+        } catch (NumberFormatException e) {
+        }
     }
 
     public void testLongEditor_SetAsText_Invalid() {
@@ -323,7 +333,8 @@
         try {
             editor.setAsText("invalid");
             fail("Should throw a NumberFormatException");
-        } catch (NumberFormatException e) {}
+        } catch (NumberFormatException e) {
+        }
     }
 
     public void testShortEditor() {
@@ -343,7 +354,8 @@
         try {
             editor.setAsText(null);
             fail("Should throw a NumberFormatException");
-        } catch (NumberFormatException e) {}
+        } catch (NumberFormatException e) {
+        }
     }
 
     public void testShortEditor_SetAsText_Invalid() {
@@ -351,7 +363,8 @@
         try {
             editor.setAsText("invalid");
             fail("Should throw a NumberFormatException");
-        } catch (NumberFormatException e) {}
+        } catch (NumberFormatException e) {
+        }
     }
 
     public void testIntegerEditor() {
@@ -370,7 +383,8 @@
         try {
             editor.setAsText(null);
             fail("Should throw a NumberFormatException");
-        } catch (NumberFormatException e) {}
+        } catch (NumberFormatException e) {
+        }
     }
 
     public void testIntegerEditor_SetAsText_Invalid() {
@@ -428,7 +442,7 @@
          * @see java.beans.PropertyEditor#addPropertyChangeListener(java.beans.PropertyChangeListener)
          */
         public void addPropertyChangeListener(PropertyChangeListener listener) {
-        // TO DO Auto-generated method stub
+            // TO DO Auto-generated method stub
 
         }
 
@@ -499,7 +513,7 @@
          *      java.awt.Rectangle)
          */
         public void paintValue(Graphics graphics, Rectangle box) {
-        // TO DO Auto-generated method stub
+            // TO DO Auto-generated method stub
 
         }
 
@@ -509,7 +523,7 @@
          * @see java.beans.PropertyEditor#removePropertyChangeListener(java.beans.PropertyChangeListener)
          */
         public void removePropertyChangeListener(PropertyChangeListener listener) {
-        // TO DO Auto-generated method stub
+            // TO DO Auto-generated method stub
 
         }
 
@@ -519,7 +533,7 @@
          * @see java.beans.PropertyEditor#setAsText(java.lang.String)
          */
         public void setAsText(String text) throws IllegalArgumentException {
-        // TO DO Auto-generated method stub
+            // TO DO Auto-generated method stub
 
         }
 
@@ -529,7 +543,7 @@
          * @see java.beans.PropertyEditor#setValue(java.lang.Object)
          */
         public void setValue(Object value) {
-        // TO DO Auto-generated method stub
+            // TO DO Auto-generated method stub
 
         }
 
@@ -553,7 +567,7 @@
          * @see java.beans.PropertyEditor#addPropertyChangeListener(java.beans.PropertyChangeListener)
          */
         public void addPropertyChangeListener(PropertyChangeListener listener) {
-        // TO DO Auto-generated method stub
+            // TO DO Auto-generated method stub
 
         }
 
@@ -624,7 +638,7 @@
          *      java.awt.Rectangle)
          */
         public void paintValue(Graphics graphics, Rectangle box) {
-        // TO DO Auto-generated method stub
+            // TO DO Auto-generated method stub
 
         }
 
@@ -634,7 +648,7 @@
          * @see java.beans.PropertyEditor#removePropertyChangeListener(java.beans.PropertyChangeListener)
          */
         public void removePropertyChangeListener(PropertyChangeListener listener) {
-        // TO DO Auto-generated method stub
+            // TO DO Auto-generated method stub
 
         }
 
@@ -644,7 +658,7 @@
          * @see java.beans.PropertyEditor#setAsText(java.lang.String)
          */
         public void setAsText(String text) throws IllegalArgumentException {
-        // TO DO Auto-generated method stub
+            // TO DO Auto-generated method stub
 
         }
 
@@ -654,7 +668,7 @@
          * @see java.beans.PropertyEditor#setValue(java.lang.Object)
          */
         public void setValue(Object value) {
-        // TO DO Auto-generated method stub
+            // TO DO Auto-generated method stub
 
         }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PropertyEditorSupportTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PropertyEditorSupportTest.java?view=diff&rev=452415&r1=452414&r2=452415
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PropertyEditorSupportTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PropertyEditorSupportTest.java Tue Oct  3 04:05:57 2006
@@ -56,8 +56,7 @@
      */
     public void testPropertyEditorSupportObject() {
         MockSource source = new MockSource();
-        PropertyEditorSupport support = new PropertyEditorSupport(
-                source);
+        PropertyEditorSupport support = new PropertyEditorSupport(source);
 
         assertEquals("null", support.getAsText());
         assertNull(support.getValue());
@@ -97,8 +96,7 @@
     public void testAddPropertyChangeListener_source() {
         MockTarget target = new MockTarget();
         MockSource source = new MockSource();
-        PropertyEditorSupport support = new PropertyEditorSupport(
-                source);
+        PropertyEditorSupport support = new PropertyEditorSupport(source);
         support.addPropertyChangeListener(EventHandler.create(
                 PropertyChangeListener.class, target, "eventSource", "source"));
         support.firePropertyChange();
@@ -226,7 +224,8 @@
         try {
             support.setAsText("string");
             fail("IllegalArgumentException expected");
-        } catch (IllegalArgumentException e) {}
+        } catch (IllegalArgumentException e) {
+        }
 
         support = new PropertyEditorSupport();
         support.setValue(new String());
@@ -294,7 +293,7 @@
         } catch (NullPointerException e) {
         }
     }
-    
+
     public static class MockSource {
 
         String id;
@@ -314,7 +313,8 @@
         }
 
         /**
-         * @param id The id to set.
+         * @param id
+         *            The id to set.
          */
         public void setId(String id) {
             this.id = id;
@@ -328,7 +328,8 @@
         }
 
         /**
-         * @param text The text to set.
+         * @param text
+         *            The text to set.
          */
         public void setText(String text) {
             this.text = text;
@@ -397,6 +398,7 @@
             this.eventSource = eventSource;
         }
 
+        @Override
         public boolean equals(Object o) {
             if (!(o instanceof MockTarget)) {
                 return false;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PropertyVetoExceptionTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PropertyVetoExceptionTest.java?view=diff&rev=452415&r1=452414&r2=452415
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PropertyVetoExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PropertyVetoExceptionTest.java Tue Oct  3 04:05:57 2006
@@ -33,39 +33,41 @@
  */
 public class PropertyVetoExceptionTest extends TestCase {
 
-	private PropertyChangeEvent event;
+    private PropertyChangeEvent event;
 
-	protected void setUp() throws Exception {
-		super.setUp();
-		MockJavaBean myBean = new MockJavaBean("Bean_PropertyVetoExceptionTest");
-		event = new PropertyChangeEvent(myBean, "propertyOne", "value_old",
-				"value_one");
-	}
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+        MockJavaBean myBean = new MockJavaBean("Bean_PropertyVetoExceptionTest");
+        event = new PropertyChangeEvent(myBean, "propertyOne", "value_old",
+                "value_one");
+    }
 
-	protected void tearDown() throws Exception {
-		super.tearDown();
-	}
+    @Override
+    protected void tearDown() throws Exception {
+        super.tearDown();
+    }
 
-	public void testPropertyVetoException() {
-		String message = "testPropertyVetoException";
-		PropertyVetoException e = new PropertyVetoException(message, event);
-		assertSame(message, e.getMessage());
-		assertSame(event, e.getPropertyChangeEvent());
-	}
+    public void testPropertyVetoException() {
+        String message = "testPropertyVetoException";
+        PropertyVetoException e = new PropertyVetoException(message, event);
+        assertSame(message, e.getMessage());
+        assertSame(event, e.getPropertyChangeEvent());
+    }
 
-	public void testPropertyVetoException_MessageNull() {
-		String message = null;
-		PropertyVetoException e = new PropertyVetoException(message, event);
-		assertNull(e.getMessage());
-		assertSame(event, e.getPropertyChangeEvent());
-	}
+    public void testPropertyVetoException_MessageNull() {
+        String message = null;
+        PropertyVetoException e = new PropertyVetoException(message, event);
+        assertNull(e.getMessage());
+        assertSame(event, e.getPropertyChangeEvent());
+    }
 
-	public void testPropertyVetoException_EventNull() {
-		String message = "testPropertyVetoException";
-		PropertyVetoException e = new PropertyVetoException(message, null);
-		assertSame(message, e.getMessage());
-		assertNull(e.getPropertyChangeEvent());
-	}
+    public void testPropertyVetoException_EventNull() {
+        String message = "testPropertyVetoException";
+        PropertyVetoException e = new PropertyVetoException(message, null);
+        assertSame(message, e.getMessage());
+        assertNull(e.getPropertyChangeEvent());
+    }
 
     // comparator for PropertyVetoException objects
     private static final SerializableAssert comparator = new SerializableAssert() {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/SimpleBeanInfoTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/SimpleBeanInfoTest.java?view=diff&rev=452415&r1=452414&r2=452415
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/SimpleBeanInfoTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/SimpleBeanInfoTest.java Tue Oct  3 04:05:57 2006
@@ -17,66 +17,66 @@
 
 package org.apache.harmony.beans.tests.java.beans;
 
+import java.beans.BeanInfo;
 import java.beans.SimpleBeanInfo;
 
 import junit.framework.TestCase;
 
-
 /**
  * Unit test for SimpleBeanInfo
  */
 public class SimpleBeanInfoTest extends TestCase {
 
-	public void testGetAdditionalBeanInfo() {
-		SimpleBeanInfo info = new SimpleBeanInfo();
-		assertNull(info.getAdditionalBeanInfo());
-	}
-
-	public void testGetBeanDescriptor() {
-		SimpleBeanInfo info = new SimpleBeanInfo();
-		assertNull(info.getBeanDescriptor());
-	}
-
-	public void testGetDefaultEventIndex() {
-		SimpleBeanInfo info = new SimpleBeanInfo();
-		assertEquals(-1, info.getDefaultEventIndex());
-	}
-
-	public void testGetDefaultPropertyIndex() {
-		SimpleBeanInfo info = new SimpleBeanInfo();
-		assertEquals(-1, info.getDefaultPropertyIndex());
-	}
-
-	public void testGetEventSetDescriptors() {
-		SimpleBeanInfo info = new SimpleBeanInfo();
-		assertNull(info.getEventSetDescriptors());
-	}
-
-	public void testGetIcon() {
-		SimpleBeanInfo info = new SimpleBeanInfo();
-		assertNull(info.getIcon(SimpleBeanInfo.ICON_COLOR_16x16));
-	}
-
-	public void testGetMethodDescriptors() {
-		SimpleBeanInfo info = new SimpleBeanInfo();
-		assertNull(info.getMethodDescriptors());
-	}
-
-	public void testGetPropertyDescriptors() {
-		SimpleBeanInfo info = new SimpleBeanInfo();
-		assertNull(info.getPropertyDescriptors());
-	}
-
-    // Depends on AWT functionality that is currently stubbed out. 
-//	public void testLoadImage() {
-//		// TODO The bahavior is not implemented
-//		MockSimpleBeanInfo info = new MockSimpleBeanInfo();
-//		Image image = info.loadImage("/gif/harmony-logo.gif");
-//		// assertTrue(image instanceof Image);
-//
-//        // TODO The bahavior is not implemented
-//        SimpleBeanInfo sbi = new SimpleBeanInfo();
-//        image = sbi.loadImage("/gif/test.gif");
-//        // assertNotNull(image);
-//    }
+    public void testGetAdditionalBeanInfo() {
+        SimpleBeanInfo info = new SimpleBeanInfo();
+        assertNull(info.getAdditionalBeanInfo());
+    }
+
+    public void testGetBeanDescriptor() {
+        SimpleBeanInfo info = new SimpleBeanInfo();
+        assertNull(info.getBeanDescriptor());
+    }
+
+    public void testGetDefaultEventIndex() {
+        SimpleBeanInfo info = new SimpleBeanInfo();
+        assertEquals(-1, info.getDefaultEventIndex());
+    }
+
+    public void testGetDefaultPropertyIndex() {
+        SimpleBeanInfo info = new SimpleBeanInfo();
+        assertEquals(-1, info.getDefaultPropertyIndex());
+    }
+
+    public void testGetEventSetDescriptors() {
+        SimpleBeanInfo info = new SimpleBeanInfo();
+        assertNull(info.getEventSetDescriptors());
+    }
+
+    public void testGetIcon() {
+        SimpleBeanInfo info = new SimpleBeanInfo();
+        assertNull(info.getIcon(BeanInfo.ICON_COLOR_16x16));
+    }
+
+    public void testGetMethodDescriptors() {
+        SimpleBeanInfo info = new SimpleBeanInfo();
+        assertNull(info.getMethodDescriptors());
+    }
+
+    public void testGetPropertyDescriptors() {
+        SimpleBeanInfo info = new SimpleBeanInfo();
+        assertNull(info.getPropertyDescriptors());
+    }
+
+    // Depends on AWT functionality that is currently stubbed out.
+    // public void testLoadImage() {
+    // // TODO The bahavior is not implemented
+    // MockSimpleBeanInfo info = new MockSimpleBeanInfo();
+    // Image image = info.loadImage("/gif/harmony-logo.gif");
+    // // assertTrue(image instanceof Image);
+    //
+    // // TODO The bahavior is not implemented
+    // SimpleBeanInfo sbi = new SimpleBeanInfo();
+    // image = sbi.loadImage("/gif/test.gif");
+    // // assertNotNull(image);
+    // }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/StatementTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/StatementTest.java?view=diff&rev=452415&r1=452414&r2=452415
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/StatementTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/StatementTest.java Tue Oct  3 04:05:57 2006
@@ -146,7 +146,8 @@
     /**
      * 
      */
-    public static void methodWithIntArray(int[] array) {}
+    public static void methodWithIntArray(int[] array) {
+    }
 
     /**
      * 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/VetoableChangeListenerProxyTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/VetoableChangeListenerProxyTest.java?view=diff&rev=452415&r1=452414&r2=452415
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/VetoableChangeListenerProxyTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/VetoableChangeListenerProxyTest.java Tue Oct  3 04:05:57 2006
@@ -28,80 +28,82 @@
  * Unit test for VetoableChangeListenerProxy
  */
 public class VetoableChangeListenerProxyTest extends TestCase {
-	VetoableChangeListenerProxy proxy;
+    VetoableChangeListenerProxy proxy;
 
-	VetoableChangeListener listener = new MockVetoableChangeListener();
+    VetoableChangeListener listener = new MockVetoableChangeListener();
 
-	String name = "mock";
+    String name = "mock";
 
-	private static PropertyChangeEvent event = null;
+    private static PropertyChangeEvent event = null;
 
-	/*
-	 * @see TestCase#setUp()
-	 */
-	protected void setUp() throws Exception {
-		super.setUp();
-		proxy = new VetoableChangeListenerProxy(name, listener);
-	}
-
-	/*
-	 * @see TestCase#tearDown()
-	 */
-	protected void tearDown() throws Exception {
-		super.tearDown();
-	}
-
-	public void testVetoableChangeListenerProxy() throws PropertyVetoException {
-		proxy = new VetoableChangeListenerProxy(null, listener);
-		assertSame(listener, proxy.getListener());
-		assertNull(proxy.getPropertyName());
-		PropertyChangeEvent newevent = new PropertyChangeEvent(new Object(),
-				"name", new Object(), new Object());
-		proxy.vetoableChange(newevent);
-		assertSame(newevent, event);
-		proxy = new VetoableChangeListenerProxy(name, null);
-		assertSame(name, proxy.getPropertyName());
-		assertNull(proxy.getListener());
-		try {
-			proxy.vetoableChange(new PropertyChangeEvent(new Object(), "name",
-					new Object(), new Object()));
-			fail("should null pointer");
-		} catch (NullPointerException e) {
-		}
-
-		proxy = new VetoableChangeListenerProxy(name, listener);
-		assertSame(listener, proxy.getListener());
-		assertSame(name, proxy.getPropertyName());
-		newevent = new PropertyChangeEvent(new Object(), "name", new Object(),
-				new Object());
-		assertSame(name, proxy.getPropertyName());
-		proxy.vetoableChange(newevent);
-		assertSame(newevent, event);
-	}
-
-	public void testVetoableChange() throws PropertyVetoException {
-		PropertyChangeEvent newevent = new PropertyChangeEvent(new Object(),
-				"exception", new Object(), new Object());
-		try {
-			proxy.vetoableChange(newevent);
-			fail("should throw exception");
-		} catch (PropertyVetoException e) {
-		}
-		proxy.vetoableChange(null);
-		assertNull(event);
-	}
-
-	public static class MockVetoableChangeListener implements
-			VetoableChangeListener {
-
-		public void vetoableChange(PropertyChangeEvent newevent)
-				throws PropertyVetoException {
-			event = newevent;
-			if (event != null && event.getPropertyName().equals("exception")) {
-				throw new PropertyVetoException("", newevent);
-			}
-		}
+    /*
+     * @see TestCase#setUp()
+     */
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+        proxy = new VetoableChangeListenerProxy(name, listener);
+    }
+
+    /*
+     * @see TestCase#tearDown()
+     */
+    @Override
+    protected void tearDown() throws Exception {
+        super.tearDown();
+    }
+
+    public void testVetoableChangeListenerProxy() throws PropertyVetoException {
+        proxy = new VetoableChangeListenerProxy(null, listener);
+        assertSame(listener, proxy.getListener());
+        assertNull(proxy.getPropertyName());
+        PropertyChangeEvent newevent = new PropertyChangeEvent(new Object(),
+                "name", new Object(), new Object());
+        proxy.vetoableChange(newevent);
+        assertSame(newevent, event);
+        proxy = new VetoableChangeListenerProxy(name, null);
+        assertSame(name, proxy.getPropertyName());
+        assertNull(proxy.getListener());
+        try {
+            proxy.vetoableChange(new PropertyChangeEvent(new Object(), "name",
+                    new Object(), new Object()));
+            fail("should null pointer");
+        } catch (NullPointerException e) {
+        }
+
+        proxy = new VetoableChangeListenerProxy(name, listener);
+        assertSame(listener, proxy.getListener());
+        assertSame(name, proxy.getPropertyName());
+        newevent = new PropertyChangeEvent(new Object(), "name", new Object(),
+                new Object());
+        assertSame(name, proxy.getPropertyName());
+        proxy.vetoableChange(newevent);
+        assertSame(newevent, event);
+    }
+
+    public void testVetoableChange() throws PropertyVetoException {
+        PropertyChangeEvent newevent = new PropertyChangeEvent(new Object(),
+                "exception", new Object(), new Object());
+        try {
+            proxy.vetoableChange(newevent);
+            fail("should throw exception");
+        } catch (PropertyVetoException e) {
+        }
+        proxy.vetoableChange(null);
+        assertNull(event);
+    }
+
+    public static class MockVetoableChangeListener implements
+            VetoableChangeListener {
+
+        public void vetoableChange(PropertyChangeEvent newevent)
+                throws PropertyVetoException {
+            event = newevent;
+            if (event != null && event.getPropertyName().equals("exception")) {
+                throw new PropertyVetoException("", newevent);
+            }
+        }
 
-	}
+    }
 
 }



Mime
View raw message