harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r468093 - in /incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans: ./ beancontext/
Date Thu, 26 Oct 2006 18:46:00 GMT
Author: hindessm
Date: Thu Oct 26 11:45:59 2006
New Revision: 468093

URL: http://svn.apache.org/viewvc?view=rev&rev=468093
Log:
Really applying patch from "[#HARMONY-1976] [classlib][beans] fix asserts in
tests".

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/BeanDescriptorTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/EventHandlerTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/IntrospectorTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PropertyDescriptorTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/VetoableChangeSupportTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/XMLDecoderTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/XMLEncoderTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextChildSupportTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextServicesSupportTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/BeanDescriptorTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/BeanDescriptorTest.java?view=diff&rev=468093&r1=468092&r2=468093
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/BeanDescriptorTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/BeanDescriptorTest.java
Thu Oct 26 11:45:59 2006
@@ -204,6 +204,6 @@
      */
     public void testNullaryConstructor() {
         BeanDescriptor bd = new BeanDescriptor(String.class);
-        assertEquals(bd.getName(), "String");
+        assertEquals("String", bd.getName());
     }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/EventHandlerTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/EventHandlerTest.java?view=diff&rev=468093&r1=468092&r2=468093
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/EventHandlerTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/EventHandlerTest.java
Thu Oct 26 11:45:59 2006
@@ -202,7 +202,7 @@
         listener.fireSampleEvent(event);
 
         assertEquals("doSomething", getMethodName());
-        assertTrue(event.getI() == invocationObject.getIntValue());
+        assertEquals(event.getI(), invocationObject.getIntValue());
     }
 
     /**

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/IntrospectorTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/IntrospectorTest.java?view=diff&rev=468093&r1=468092&r2=468093
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/IntrospectorTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/IntrospectorTest.java
Thu Oct 26 11:45:59 2006
@@ -650,7 +650,7 @@
         PropertyDescriptor[] pds2 = info.getPropertyDescriptors();
         assertEquals(pds.length, pds2.length);
         for (int i = 0; i < pds.length; i++) {
-            assertTrue(pds[i].equals(pds2[i]));
+            assertEquals(pds[i], pds2[i]);
         }
     }
 
@@ -681,7 +681,7 @@
         PropertyDescriptor[] pds = info.getPropertyDescriptors();
         for (PropertyDescriptor element : pds) {
             String name = element.getName();
-            assertEquals(name, "text.MockFooLabelBeanInfo");
+            assertEquals("text.MockFooLabelBeanInfo", name);
         }
 
         String[] path = Introspector.getBeanInfoSearchPath();

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=468093&r1=468092&r2=468093
==============================================================================
--- 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
Thu Oct 26 11:45:59 2006
@@ -592,16 +592,16 @@
         PropertyDescriptor pd = new PropertyDescriptor(
                 "prop1", SubMockJavaBean.class, null, "setPropertyOne"); //$NON-NLS-1$ //$NON-NLS-2$
         assertNull(pd.getReadMethod());
-        assertEquals(pd.getWriteMethod().getName(), "setPropertyOne"); //$NON-NLS-1$			
+        assertEquals("setPropertyOne", pd.getWriteMethod().getName()); //$NON-NLS-1$			
 
         pd = new PropertyDescriptor(
                 "prop1", SubMockJavaBean.class, "getPropertyOne", "setPropertyOne"); //$NON-NLS-1$
//$NON-NLS-2$ //$NON-NLS-3$
-        assertEquals(pd.getReadMethod().getName(), "getPropertyOne"); //$NON-NLS-1$
-        assertEquals(pd.getWriteMethod().getName(), "setPropertyOne"); //$NON-NLS-1$			
+        assertEquals("getPropertyOne", pd.getReadMethod().getName()); //$NON-NLS-1$
+        assertEquals("setPropertyOne", pd.getWriteMethod().getName()); //$NON-NLS-1$			
 
         pd = new PropertyDescriptor(
                 "prop1", SubMockJavaBean.class, "getPropertyOne", null); //$NON-NLS-1$ //$NON-NLS-2$

-        assertEquals(pd.getReadMethod().getName(), "getPropertyOne"); //$NON-NLS-1$
+        assertEquals("getPropertyOne", pd.getReadMethod().getName()); //$NON-NLS-1$
         assertNull(pd.getWriteMethod()); 
     }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/VetoableChangeSupportTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/VetoableChangeSupportTest.java?view=diff&rev=468093&r1=468092&r2=468093
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/VetoableChangeSupportTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/VetoableChangeSupportTest.java
Thu Oct 26 11:45:59 2006
@@ -1163,9 +1163,9 @@
         try {
             support.fireVetoableChange("propName", 0, 1);
         } catch (PropertyVetoException pve) {
-            assertTrue("Illegal sequence:" + sb, sb.toString().equals("abBaAb"));
+            assertEquals("Illegal sequence:" + sb, "abBaAb", sb.toString());
             String message = pve.getMessage();
-            assertTrue("Illegal exception:" + message, message.equals(B_THROW));
+            assertEquals("Illegal exception:" + message, B_THROW, message);
             return;
         }
         fail("Unreachable path:" + sb);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/XMLDecoderTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/XMLDecoderTest.java?view=diff&rev=468093&r1=468092&r2=468093
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/XMLDecoderTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/XMLDecoderTest.java
Thu Oct 26 11:45:59 2006
@@ -250,7 +250,7 @@
                 "/xml/MockBean4Owner_SetOwner.xml"), o1);
         MockBean4Owner_Target t1 = (MockBean4Owner_Target) dec1.readObject();
 
-        assertEquals(o1.getV(), 1);
+        assertEquals(1, o1.getV());
         assertEquals(o1, t1.getV());
     }
 
@@ -260,7 +260,7 @@
                 "/xml/MockBean4Owner_SetOwnerWithWriteStatement.xml"), o2);
         MockBean4Owner_Target t2 = (MockBean4Owner_Target) dec2.readObject();
 
-        assertEquals(o2.getV(), 999);
+        assertEquals(999, o2.getV());
         assertEquals(o2, t2.getV());
     }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/XMLEncoderTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/XMLEncoderTest.java?view=diff&rev=468093&r1=468092&r2=468093
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/XMLEncoderTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/XMLEncoderTest.java
Thu Oct 26 11:45:59 2006
@@ -313,7 +313,7 @@
         };
         XMLEncoder enc = new XMLEncoder(out);
         enc.writeObject(new Integer(3));
-        assertTrue(out.size() == 0);
+        assertEquals(0, out.size());
 
         enc.close();
 
@@ -331,7 +331,7 @@
         XMLEncoder enc = new XMLEncoder(out);
         Integer i = new Integer(3);
         enc.writeObject(i);
-        assertTrue(out.size() == 0);
+        assertEquals(0, out.size());
         assertNotNull(enc.get(i));
 
         enc.flush();

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextChildSupportTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextChildSupportTest.java?view=diff&rev=468093&r1=468092&r2=468093
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextChildSupportTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextChildSupportTest.java
Thu Oct 26 11:45:59 2006
@@ -167,24 +167,24 @@
         l1.clearLastEvent();
         l2.clearLastEvent();
         support.firePropertyChange(propName, oldValue, newValue);
-        assertEquals(l1.lastEvent.getPropertyName(), propName);
-        assertSame(l1.lastEvent.getOldValue(), oldValue);
-        assertSame(l1.lastEvent.getNewValue(), newValue);
-        assertSame(l1.lastEvent.getSource(), support);
+        assertEquals(propName, l1.lastEvent.getPropertyName());
+        assertSame(oldValue, l1.lastEvent.getOldValue());
+        assertSame(newValue, l1.lastEvent.getNewValue());
+        assertSame(support, l1.lastEvent.getSource());
         assertNull(l2.lastEvent);
 
         support.addPropertyChangeListener(propName, l2);
         l1.clearLastEvent();
         l2.clearLastEvent();
         support.firePropertyChange(propName, oldValue, newValue);
-        assertEquals(l1.lastEvent.getPropertyName(), propName);
-        assertSame(l1.lastEvent.getOldValue(), oldValue);
-        assertSame(l1.lastEvent.getNewValue(), newValue);
-        assertSame(l1.lastEvent.getSource(), support);
-        assertEquals(l2.lastEvent.getPropertyName(), propName);
-        assertSame(l2.lastEvent.getOldValue(), oldValue);
-        assertSame(l2.lastEvent.getNewValue(), newValue);
-        assertSame(l2.lastEvent.getSource(), support);
+        assertEquals(propName, l1.lastEvent.getPropertyName());
+        assertSame(oldValue, l1.lastEvent.getOldValue());
+        assertSame(newValue, l1.lastEvent.getNewValue());
+        assertSame(support, l1.lastEvent.getSource());
+        assertEquals(propName, l2.lastEvent.getPropertyName());
+        assertSame(oldValue, l2.lastEvent.getOldValue());
+        assertSame(newValue, l2.lastEvent.getNewValue());
+        assertSame(support, l2.lastEvent.getSource());
 
         l1.clearLastEvent();
         l2.clearLastEvent();
@@ -233,24 +233,24 @@
         l1.clearLastEvent();
         l2.clearLastEvent();
         support.fireVetoableChange(propName, oldValue, newValue);
-        assertEquals(l1.lastEvent.getPropertyName(), propName);
-        assertSame(l1.lastEvent.getOldValue(), oldValue);
-        assertSame(l1.lastEvent.getNewValue(), newValue);
-        assertSame(l1.lastEvent.getSource(), support);
+        assertEquals(propName, l1.lastEvent.getPropertyName());
+        assertSame(oldValue, l1.lastEvent.getOldValue());
+        assertSame(newValue, l1.lastEvent.getNewValue());
+        assertSame(support, l1.lastEvent.getSource());
         assertNull(l2.lastEvent);
 
         support.addVetoableChangeListener(propName, l2);
         l1.clearLastEvent();
         l2.clearLastEvent();
         support.fireVetoableChange(propName, oldValue, newValue);
-        assertEquals(l1.lastEvent.getPropertyName(), propName);
-        assertSame(l1.lastEvent.getOldValue(), oldValue);
-        assertSame(l1.lastEvent.getNewValue(), newValue);
-        assertSame(l1.lastEvent.getSource(), support);
-        assertEquals(l2.lastEvent.getPropertyName(), propName);
-        assertSame(l2.lastEvent.getOldValue(), oldValue);
-        assertSame(l2.lastEvent.getNewValue(), newValue);
-        assertSame(l2.lastEvent.getSource(), support);
+        assertEquals(propName, l1.lastEvent.getPropertyName());
+        assertSame(oldValue, l1.lastEvent.getOldValue());
+        assertSame(newValue, l1.lastEvent.getNewValue());
+        assertSame(support, l1.lastEvent.getSource());
+        assertEquals(propName, l2.lastEvent.getPropertyName());
+        assertSame(oldValue, l2.lastEvent.getOldValue());
+        assertSame(newValue, l2.lastEvent.getNewValue());
+        assertSame(support, l2.lastEvent.getSource());
 
         l1.clearLastEvent();
         l2.clearLastEvent();
@@ -297,10 +297,10 @@
         l1.clearLastEvent();
         l2.clearLastEvent();
         support.firePropertyChange(propName, oldValue, newValue);
-        assertEquals(l1.lastEvent.getPropertyName(), propName);
-        assertSame(l1.lastEvent.getOldValue(), oldValue);
-        assertSame(l1.lastEvent.getNewValue(), newValue);
-        assertSame(l1.lastEvent.getSource(), support);
+        assertEquals(propName, l1.lastEvent.getPropertyName());
+        assertSame(oldValue, l1.lastEvent.getOldValue());
+        assertSame(newValue, l1.lastEvent.getNewValue());
+        assertSame(support, l1.lastEvent.getSource());
         assertNull(l2.lastEvent);
     }
 
@@ -334,10 +334,10 @@
         l1.clearLastEvent();
         l2.clearLastEvent();
         support.firePropertyChange(propName, oldValue, newValue);
-        assertEquals(l1.lastEvent.getPropertyName(), propName);
+        assertEquals(propName, l1.lastEvent.getPropertyName());
         assertNull(l1.lastEvent.getOldValue());
         assertNull(l1.lastEvent.getNewValue());
-        assertSame(l1.lastEvent.getSource(), support);
+        assertSame(support, l1.lastEvent.getSource());
         assertNull(l2.lastEvent);
     }
 
@@ -359,10 +359,10 @@
         l1.clearLastEvent();
         l2.clearLastEvent();
         support.fireVetoableChange(propName, oldValue, newValue);
-        assertEquals(l1.lastEvent.getPropertyName(), propName);
-        assertSame(l1.lastEvent.getOldValue(), oldValue);
-        assertSame(l1.lastEvent.getNewValue(), newValue);
-        assertSame(l1.lastEvent.getSource(), support);
+        assertEquals(propName, l1.lastEvent.getPropertyName());
+        assertSame(oldValue, l1.lastEvent.getOldValue());
+        assertSame(newValue, l1.lastEvent.getNewValue());
+        assertSame(support, l1.lastEvent.getSource());
         assertNull(l2.lastEvent);
     }
 
@@ -387,18 +387,18 @@
         } catch (PropertyVetoException e) {
             // expected
         }
-        assertEquals(l1.lastEvent.getPropertyName(), propName);
-        assertSame(l1.lastEvent.getOldValue(), newValue);
-        assertSame(l1.lastEvent.getNewValue(), oldValue);
-        assertSame(l1.lastEvent.getSource(), support);
-        assertEquals(l2.lastEvent.getPropertyName(), propName);
-        assertSame(l2.lastEvent.getOldValue(), newValue);
-        assertSame(l2.lastEvent.getNewValue(), oldValue);
-        assertSame(l2.lastEvent.getSource(), support);
-        assertEquals(l3.lastEvent.getPropertyName(), propName);
-        assertSame(l3.lastEvent.getOldValue(), newValue);
-        assertSame(l3.lastEvent.getNewValue(), oldValue);
-        assertSame(l3.lastEvent.getSource(), support);
+        assertEquals(propName, l1.lastEvent.getPropertyName());
+        assertSame(newValue, l1.lastEvent.getOldValue());
+        assertSame(oldValue, l1.lastEvent.getNewValue());
+        assertSame(support, l1.lastEvent.getSource());
+        assertEquals(propName, l2.lastEvent.getPropertyName());
+        assertSame(newValue, l2.lastEvent.getOldValue());
+        assertSame(oldValue, l2.lastEvent.getNewValue());
+        assertSame(support, l2.lastEvent.getSource());
+        assertEquals(propName, l3.lastEvent.getPropertyName());
+        assertSame(newValue, l3.lastEvent.getOldValue());
+        assertSame(oldValue, l3.lastEvent.getNewValue());
+        assertSame(support, l3.lastEvent.getSource());
     }
 
     public void testFireVetoableChange_OldEqualsNew()
@@ -433,10 +433,10 @@
         l1.clearLastEvent();
         l2.clearLastEvent();
         support.fireVetoableChange(propName, oldValue, newValue);
-        assertEquals(l1.lastEvent.getPropertyName(), propName);
+        assertEquals(propName, l1.lastEvent.getPropertyName());
         assertNull(l1.lastEvent.getOldValue());
         assertNull(l1.lastEvent.getNewValue());
-        assertSame(l1.lastEvent.getSource(), support);
+        assertSame(support, l1.lastEvent.getSource());
         assertNull(l2.lastEvent);
     }
 
@@ -448,7 +448,7 @@
         assertSame(mockBeanContext, support.getBeanContext());
     }
 
-    public void testGetBeanContextChildPeer() {
+    public void testGetBeanContextChildPeer() throws Exception {
         BeanContextChildSupport support = new MockBeanContextChildSupport();
         assertSame(support, support.beanContextChildPeer);
         assertSame(support, support.getBeanContextChildPeer());
@@ -458,15 +458,9 @@
         assertSame(mockChild, support.beanContextChildPeer);
         assertSame(mockChild, support.getBeanContextChildPeer());
 
-        try {
-            BeanContextChildSupport sup = new BeanContextChildSupport();
+        BeanContextChildSupport sup = new BeanContextChildSupport();
 
-            if (!sup.getBeanContextChildPeer().equals(sup)) {
-                fail("The objects should be equal");
-            }
-        } catch (Exception e) {
-            fail("Unexpected exception: " + e + " caused by: " + e.getCause());
-        }
+        assertEquals(sup, sup.getBeanContextChildPeer());
     }
 
     public void testInitializeBeanContextResources()
@@ -498,7 +492,7 @@
         assertSame(ctx2, support.lastReleaseBeanContext);
     }
 
-    public void testIsDelegated() {
+    public void testIsDelegated() throws Exception {
         BeanContextChildSupport support = new MockBeanContextChildSupport();
         assertFalse(support.isDelegated());
 
@@ -509,15 +503,10 @@
         support.beanContextChildPeer = support;
         assertFalse(support.isDelegated());
 
-        try {
-            BeanContextChildSupport sup = new BeanContextChildSupport();
+        BeanContextChildSupport sup = new BeanContextChildSupport();
 
-            if (sup.isDelegated()) {
-                fail("Child is not supposed to be delegated");
-            }
-        } catch (Exception e) {
-            fail("Unexpected exception: " + e + " caused by: " + e.getCause());
-        }
+        assertFalse("Child is not supposed to be delegated",
+                sup.isDelegated());
     }
 
     public void testReleaseBeanContextResources() throws PropertyVetoException {
@@ -566,24 +555,24 @@
         l1.clearLastEvent();
         l2.clearLastEvent();
         support.firePropertyChange(propName, oldValue, newValue);
-        assertEquals(l1.lastEvent.getPropertyName(), propName);
-        assertSame(l1.lastEvent.getOldValue(), oldValue);
-        assertSame(l1.lastEvent.getNewValue(), newValue);
-        assertSame(l1.lastEvent.getSource(), support);
-        assertEquals(l2.lastEvent.getPropertyName(), propName);
-        assertSame(l2.lastEvent.getOldValue(), oldValue);
-        assertSame(l2.lastEvent.getNewValue(), newValue);
-        assertSame(l2.lastEvent.getSource(), support);
+        assertEquals(propName, l1.lastEvent.getPropertyName());
+        assertSame(oldValue, l1.lastEvent.getOldValue());
+        assertSame(newValue, l1.lastEvent.getNewValue());
+        assertSame(support, l1.lastEvent.getSource());
+        assertEquals(propName, l2.lastEvent.getPropertyName());
+        assertSame(oldValue, l2.lastEvent.getOldValue());
+        assertSame(newValue, l2.lastEvent.getNewValue());
+        assertSame(support, l2.lastEvent.getSource());
 
         support.removePropertyChangeListener(propName, l1);
         l1.clearLastEvent();
         l2.clearLastEvent();
         support.firePropertyChange(propName, oldValue, newValue);
         assertNull(l1.lastEvent);
-        assertEquals(l2.lastEvent.getPropertyName(), propName);
-        assertSame(l2.lastEvent.getOldValue(), oldValue);
-        assertSame(l2.lastEvent.getNewValue(), newValue);
-        assertSame(l2.lastEvent.getSource(), support);
+        assertEquals(propName, l2.lastEvent.getPropertyName());
+        assertSame(oldValue, l2.lastEvent.getOldValue());
+        assertSame(newValue, l2.lastEvent.getNewValue());
+        assertSame(support, l2.lastEvent.getSource());
 
         support.removePropertyChangeListener(propName, l2);
         l1.clearLastEvent();
@@ -614,14 +603,14 @@
         l1.clearLastEvent();
         l2.clearLastEvent();
         support.fireVetoableChange(propName, oldValue, newValue);
-        assertEquals(l1.lastEvent.getPropertyName(), propName);
-        assertSame(l1.lastEvent.getOldValue(), oldValue);
-        assertSame(l1.lastEvent.getNewValue(), newValue);
-        assertSame(l1.lastEvent.getSource(), support);
-        assertEquals(l2.lastEvent.getPropertyName(), propName);
-        assertSame(l2.lastEvent.getOldValue(), oldValue);
-        assertSame(l2.lastEvent.getNewValue(), newValue);
-        assertSame(l2.lastEvent.getSource(), support);
+        assertEquals(propName, l1.lastEvent.getPropertyName());
+        assertSame(oldValue, l1.lastEvent.getOldValue());
+        assertSame(newValue, l1.lastEvent.getNewValue());
+        assertSame(support, l1.lastEvent.getSource());
+        assertEquals(propName, l2.lastEvent.getPropertyName());
+        assertSame(oldValue, l2.lastEvent.getOldValue());
+        assertSame(newValue, l2.lastEvent.getNewValue());
+        assertSame(support, l2.lastEvent.getSource());
 
         support.removeVetoableChangeListener(propName, l1);
         l1.clearLastEvent();
@@ -689,14 +678,14 @@
         support.setBeanContext(ctx);
         assertSame(ctx, support.getBeanContext());
         assertSame(ctx, support.lastInitBeanContext);
-        assertEquals(l1.lastEvent.getPropertyName(), "beanContext");
+        assertEquals("beanContext", l1.lastEvent.getPropertyName());
         assertNull(l1.lastEvent.getOldValue());
-        assertSame(l1.lastEvent.getNewValue(), ctx);
-        assertSame(l1.lastEvent.getSource(), peer);
-        assertEquals(l2.lastEvent.getPropertyName(), "beanContext");
+        assertSame(ctx, l1.lastEvent.getNewValue());
+        assertSame(peer, l1.lastEvent.getSource());
+        assertEquals("beanContext", l2.lastEvent.getPropertyName());
         assertNull(l2.lastEvent.getOldValue());
-        assertSame(l2.lastEvent.getNewValue(), ctx);
-        assertSame(l2.lastEvent.getSource(), peer);
+        assertSame(ctx, l2.lastEvent.getNewValue());
+        assertSame(peer, l2.lastEvent.getSource());
 
         support.clearLastRecords();
         l1.clearLastEvent();
@@ -714,14 +703,14 @@
         assertNull(support.getBeanContext());
         assertNull(support.lastInitBeanContext);
         assertSame(ctx, support.lastReleaseBeanContext);
-        assertEquals(l1.lastEvent.getPropertyName(), "beanContext");
+        assertEquals("beanContext", l1.lastEvent.getPropertyName());
         assertNull(l1.lastEvent.getNewValue());
-        assertSame(l1.lastEvent.getOldValue(), ctx);
-        assertSame(l1.lastEvent.getSource(), peer);
-        assertEquals(l2.lastEvent.getPropertyName(), "beanContext");
+        assertSame(ctx, l1.lastEvent.getOldValue());
+        assertSame(peer, l1.lastEvent.getSource());
+        assertEquals("beanContext", l2.lastEvent.getPropertyName());
         assertNull(l2.lastEvent.getNewValue());
-        assertSame(l2.lastEvent.getOldValue(), ctx);
-        assertSame(l2.lastEvent.getSource(), peer);
+        assertSame(ctx, l2.lastEvent.getOldValue());
+        assertSame(peer, l2.lastEvent.getSource());
     }
 
     public void testSetBeanContext_VetoedByListener()
@@ -749,10 +738,10 @@
         assertNull(support.lastInitBeanContext);
         assertNull(support.lastReleaseBeanContext);
         assertNull(l1.lastEvent);
-        assertEquals(l2.lastEvent.getPropertyName(), "beanContext");
-        assertSame(l2.lastEvent.getNewValue(), oldCtx);
-        assertSame(l2.lastEvent.getOldValue(), ctx);
-        assertSame(l2.lastEvent.getSource(), support);
+        assertEquals("beanContext", l2.lastEvent.getPropertyName());
+        assertSame(oldCtx, l2.lastEvent.getNewValue());
+        assertSame(ctx, l2.lastEvent.getOldValue());
+        assertSame(support, l2.lastEvent.getSource());
         assertTrue(support.rejectedSetBCOnce());
     }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextServicesSupportTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextServicesSupportTest.java?view=diff&rev=468093&r1=468092&r2=468093
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextServicesSupportTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextServicesSupportTest.java
Thu Oct 26 11:45:59 2006
@@ -406,9 +406,9 @@
      */
     public void testBeanContextServicesSupport() {
         MockBeanContextServicesSupport support = new MockBeanContextServicesSupport();
-        assertTrue(support.bcsListeners().size() == 0);
+        assertEquals(0, support.bcsListeners().size());
         assertNull(support.proxy());
-        assertTrue(support.serializable() == 0);
+        assertEquals(0, support.serializable());
         assertTrue(support.services().isEmpty());
         assertSame(support, support.getBeanContextServicesPeer());
         assertSame(Locale.getDefault(), support.getLocale());
@@ -423,9 +423,9 @@
         MockBeanContextServices services = new MockBeanContextServices();
         MockBeanContextServicesSupport support = new MockBeanContextServicesSupport(
                 services);
-        assertTrue(support.bcsListeners().size() == 0);
+        assertEquals(0, support.bcsListeners().size());
         assertNull(support.proxy());
-        assertTrue(support.serializable() == 0);
+        assertEquals(0, support.serializable());
         assertTrue(support.services().isEmpty());
         assertSame(services, support.getBeanContextServicesPeer());
         assertSame(Locale.getDefault(), support.getLocale());
@@ -441,9 +441,9 @@
         MockBeanContextServices services = new MockBeanContextServices();
         MockBeanContextServicesSupport support = new MockBeanContextServicesSupport(
                 services, Locale.ITALY);
-        assertTrue(support.bcsListeners().size() == 0);
+        assertEquals(0, support.bcsListeners().size());
         assertNull(support.proxy());
-        assertTrue(support.serializable() == 0);
+        assertEquals(0, support.serializable());
         assertTrue(support.services().isEmpty());
         assertSame(services, support.getBeanContextServicesPeer());
         assertSame(Locale.ITALY, support.getLocale());
@@ -459,9 +459,9 @@
         MockBeanContextServices services = new MockBeanContextServices();
         MockBeanContextServicesSupport support = new MockBeanContextServicesSupport(
                 services, Locale.ITALY, true);
-        assertTrue(support.bcsListeners().size() == 0);
+        assertEquals(0, support.bcsListeners().size());
         assertNull(support.proxy());
-        assertTrue(support.serializable() == 0);
+        assertEquals(0, support.serializable());
         assertTrue(support.services().isEmpty());
         assertSame(services, support.getBeanContextServicesPeer());
         assertSame(Locale.ITALY, support.getLocale());
@@ -477,9 +477,9 @@
         MockBeanContextServices services = new MockBeanContextServices();
         MockBeanContextServicesSupport support = new MockBeanContextServicesSupport(
                 services, Locale.ITALY, true, true);
-        assertTrue(support.bcsListeners().size() == 0);
+        assertEquals(0, support.bcsListeners().size());
         assertNull(support.proxy());
-        assertTrue(support.serializable() == 0);
+        assertEquals(0, support.serializable());
         assertTrue(support.services().isEmpty());
         assertSame(services, support.getBeanContextServicesPeer());
         assertSame(Locale.ITALY, support.getLocale());
@@ -1088,14 +1088,14 @@
     public void testRemoveBeanContextServicesListener() {
         MockBeanContextServicesSupport support = new MockBeanContextServicesSupport();
         MockBeanContextServicesListener l = new MockBeanContextServicesListener();
-        assertTrue(support.bcsListeners().size() == 0);
+        assertEquals(0, support.bcsListeners().size());
 
         support.addBeanContextServicesListener(l);
-        assertTrue(support.bcsListeners().size() == 1);
+        assertEquals(1, support.bcsListeners().size());
         assertSame(l, support.bcsListeners().get(0));
 
         support.removeBeanContextServicesListener(l);
-        assertTrue(support.bcsListeners().size() == 0);
+        assertEquals(0, support.bcsListeners().size());
     }
 
     public void testRevokeService_NullParam() {
@@ -1184,7 +1184,7 @@
         l2.clearLastEvent();
 
         support.revokeService(Collection.class, provider, false);
-        assertTrue(support.services().size() == 0);
+        assertEquals(0, support.services().size());
 
         support.records.assertEndOfRecords();
         childSupport.records.assertEndOfRecords();



Mime
View raw message