harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r572749 - in /harmony/enhanced/classlib/trunk/modules/swing/src/test: api/java.injected/javax/swing/ resources/javax/swing/content-type/
Date Tue, 04 Sep 2007 17:37:14 GMT
Author: tellison
Date: Tue Sep  4 10:37:13 2007
New Revision: 572749

URL: http://svn.apache.org/viewvc?rev=572749&view=rev
Log:
Tests for HARMONY-4696 ([classlib][swing][html] JEditorPane doesn't recognize HTML by file
name)

Added:
    harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/
    harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/html
    harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/html.html
  (with props)
    harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/html.rtf
    harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/html.txt
  (with props)
    harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/rtf
    harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/rtf.html
  (with props)
    harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/rtf.rtf
    harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/rtf.txt
  (with props)
    harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/txt
    harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/txt.html
  (with props)
    harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/txt.rtf
    harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/txt.txt
  (with props)
Modified:
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java.injected/javax/swing/JEditorPaneTest.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java.injected/javax/swing/JEditorPaneTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java.injected/javax/swing/JEditorPaneTest.java?rev=572749&r1=572748&r2=572749&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java.injected/javax/swing/JEditorPaneTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java.injected/javax/swing/JEditorPaneTest.java
Tue Sep  4 10:37:13 2007
@@ -724,6 +724,35 @@
         }
     }
 
+    static void checkContentType(String fileName, String expected) throws IOException {
+        if (!fileName.startsWith("http")) {
+            fileName = "content-type/" + fileName;
+            URL url = JEditorPaneTest.class.getResource(fileName);
+            assertNotNull("Resource not found: " + fileName, url);
+            fileName = url.toString();
+        }
+        JEditorPane pane = new JEditorPane(fileName);
+        assertEquals(pane.getContentType(), expected);
+        assertEquals(pane.getEditorKit().getContentType(), expected);
+    }
+
+    public void testGetContentType() throws IOException {
+        // Regression for HARMONY-4696
+        checkContentType("txt", "text/plain");
+        checkContentType("html", "text/html");
+        checkContentType("rtf", "text/plain");
+        checkContentType("txt.txt", "text/plain");
+        checkContentType("txt.html", "text/html");
+        checkContentType("txt.rtf", "text/plain");  // Change to "text/rtf" when RTFEditorKit
becomes available.
+        checkContentType("html.txt", "text/plain");
+        checkContentType("html.html", "text/html");
+        checkContentType("html.rtf", "text/plain"); // Change to "text/rtf" when RTFEditorKit
becomes available.
+        checkContentType("rtf.txt", "text/plain");
+        checkContentType("rtf.html", "text/html");
+        checkContentType("rtf.rtf", "text/plain");  // Change to "text/rtf" when RTFEditorKit
becomes available.
+        checkContentType("http://www.apache.org", "text/html");
+    }
+
     private String getClassName(final Object obj) {
         assertNotNull(obj);
         return obj.getClass().getName();

Added: harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/html
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/html?rev=572749&view=auto
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/html
(added)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/html
Tue Sep  4 10:37:13 2007
@@ -0,0 +1 @@
+<html><body>normal <i>italic</body></html>

Added: harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/html.html
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/html.html?rev=572749&view=auto
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/html.html
(added)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/html.html
Tue Sep  4 10:37:13 2007
@@ -0,0 +1 @@
+<html><body>normal <i>italic</body></html>

Propchange: harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/html.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/html.rtf
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/html.rtf?rev=572749&view=auto
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/html.rtf
(added)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/html.rtf
Tue Sep  4 10:37:13 2007
@@ -0,0 +1 @@
+<html><body>normal <i>italic</body></html>

Added: harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/html.txt
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/html.txt?rev=572749&view=auto
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/html.txt
(added)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/html.txt
Tue Sep  4 10:37:13 2007
@@ -0,0 +1 @@
+<html><body>normal <i>italic</body></html>

Propchange: harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/html.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/rtf
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/rtf?rev=572749&view=auto
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/rtf
(added)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/rtf
Tue Sep  4 10:37:13 2007
@@ -0,0 +1 @@
+{\rtf1\ansi\deff0{\fonttbl{\f0 Times New Roman;}}{\pard text\par}}

Added: harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/rtf.html
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/rtf.html?rev=572749&view=auto
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/rtf.html
(added)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/rtf.html
Tue Sep  4 10:37:13 2007
@@ -0,0 +1 @@
+{\rtf1\ansi\deff0{\fonttbl{\f0 Times New Roman;}}{\pard text\par}}

Propchange: harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/rtf.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/rtf.rtf
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/rtf.rtf?rev=572749&view=auto
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/rtf.rtf
(added)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/rtf.rtf
Tue Sep  4 10:37:13 2007
@@ -0,0 +1 @@
+{\rtf1\ansi\deff0{\fonttbl{\f0 Times New Roman;}}{\pard text\par}}

Added: harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/rtf.txt
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/rtf.txt?rev=572749&view=auto
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/rtf.txt
(added)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/rtf.txt
Tue Sep  4 10:37:13 2007
@@ -0,0 +1 @@
+{\rtf1\ansi\deff0{\fonttbl{\f0 Times New Roman;}}{\pard text\par}}

Propchange: harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/rtf.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/txt
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/txt?rev=572749&view=auto
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/txt
(added)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/txt
Tue Sep  4 10:37:13 2007
@@ -0,0 +1 @@
+text

Added: harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/txt.html
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/txt.html?rev=572749&view=auto
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/txt.html
(added)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/txt.html
Tue Sep  4 10:37:13 2007
@@ -0,0 +1 @@
+text

Propchange: harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/txt.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/txt.rtf
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/txt.rtf?rev=572749&view=auto
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/txt.rtf
(added)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/txt.rtf
Tue Sep  4 10:37:13 2007
@@ -0,0 +1 @@
+text

Added: harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/txt.txt
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/txt.txt?rev=572749&view=auto
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/txt.txt
(added)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/txt.txt
Tue Sep  4 10:37:13 2007
@@ -0,0 +1 @@
+text

Propchange: harmony/enhanced/classlib/trunk/modules/swing/src/test/resources/javax/swing/content-type/txt.txt
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message