harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r442436 - /incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PropertyEditorSupportTest.java
Date Tue, 12 Sep 2006 03:42:40 GMT
Author: smishura
Date: Mon Sep 11 20:42:39 2006
New Revision: 442436

URL: http://svn.apache.org/viewvc?view=rev&rev=442436
Log:
Add regression test for HARMONY-1409 ([classlib][beans] add missing get/setSource methods
to PropertyEditorSupport)

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

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=442436&r1=442435&r2=442436
==============================================================================
--- 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
Mon Sep 11 20:42:39 2006
@@ -27,8 +27,8 @@
  */
 public class PropertyEditorSupportTest extends TestCase {
 
-    /*
-     * Class under test for void PropertyEditorSupport()
+    /**
+     * @tests java.beans.PropertyEditorSupport#PropertyEditorSupport()
      */
     public void testPropertyEditorSupport() {
         // Regression for HARMONY-516
@@ -41,14 +41,16 @@
         assertNull(support.getTags());
         assertFalse(support.supportsCustomEditor());
         assertFalse(support.isPaintable());
+        assertSame(support, support.getSource());
 
         Object value = new String[] { "java.awt.Color.orange" };
         support.setValue(value);
         assertEquals(value.toString(), support.getAsText());
     }
 
-    /*
-     * Class under test for void PropertyEditorSupport(Object)
+    /**
+     * @tests java.beans.PropertyEditorSupport#PropertyEditorSupport(
+     *        java.lang.Object)
      */
     public void testPropertyEditorSupportObject() {
         MockSource source = new MockSource();
@@ -62,6 +64,7 @@
         assertNull(support.getTags());
         assertFalse(support.supportsCustomEditor());
         assertFalse(support.isPaintable());
+        assertSame(source, support.getSource());
     }
 
     /*
@@ -269,6 +272,27 @@
         assertFalse(support.isPaintable());
     }
 
+    /**
+     * @tests java.beans.PropertyEditorSupport#setSource(Object)
+     * @tests java.beans.PropertyEditorSupport#getSource()
+     */
+    public void test_setSourceLjava_lang_Object() {
+
+        // Regression for HARMONY-1409
+        PropertyEditorSupport support = new PropertyEditorSupport();
+
+        Object source = new Object();
+
+        support.setSource(source);
+        assertSame(source, support.getSource());
+
+        try {
+            support.setSource(null);
+            fail("No expected NullPointerException");
+        } catch (NullPointerException e) {
+        }
+    }
+    
     public static class MockSource {
 
         String id;



Mime
View raw message