harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r497730 - in /harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text: ComponentViewTest.java StyleConstantsTest.java
Date Fri, 19 Jan 2007 08:03:27 GMT
Author: hindessm
Date: Fri Jan 19 00:03:26 2007
New Revision: 497730

URL: http://svn.apache.org/viewvc?view=rev&rev=497730
Log:
Applying update patches from "[#HARMONY-1767] [classlib][swing]
javax.swing.text.ComponentView(Element) throws unexpected
NullPointerException on user's implementation".

Modified:
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/ComponentViewTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/StyleConstantsTest.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/ComponentViewTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/ComponentViewTest.java?view=diff&rev=497730&r1=497729&r2=497730
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/ComponentViewTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/ComponentViewTest.java
Fri Jan 19 00:03:26 2007
@@ -34,8 +34,8 @@
 import javax.swing.JTextPane;
 import javax.swing.SwingTestCase;
 import javax.swing.text.Element;
-import javax.swing.text.html.HTMLDocument;
-import javax.swing.text.html.ListView;
+import javax.swing.text.PlainDocument;
+import javax.swing.text.PlainView;
 
 
 public class ComponentViewTest extends SwingTestCase {
@@ -655,10 +655,10 @@
 
     public void testSetParent_View() {
         // Regression test for HARMONY-1767 
-        HTMLDocument doc = new HTMLDocument();
+        PlainDocument doc = new PlainDocument();
         Element e = doc.getDefaultRootElement();
         ComponentView obj = new ComponentView(new TestElement());
-        obj.setParent(new ListView(e));        
+        obj.setParent(new PlainView(e));
     }  
 
     private class TestElement implements Element {
@@ -733,4 +733,4 @@
             assertEquals(position, componentElement.getStartOffset());
         }
     }
-}
\ No newline at end of file
+}

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/StyleConstantsTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/StyleConstantsTest.java?view=diff&rev=497730&r1=497729&r2=497730
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/StyleConstantsTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/StyleConstantsTest.java
Fri Jan 19 00:03:26 2007
@@ -434,6 +434,11 @@
         assertEquals(val, StyleConstants.getComponent(attr));
     }
 
+    public void testGetComponent_Null() {
+        // Regression test for HARMONY-1767
+        assertNull(StyleConstants.getComponent(null));
+    }
+
     public void testSetComponent() {
         attr.removeAttributes(attr);
         Component val = new JLabel("test component");



Mime
View raw message