[HtmlUnit] SVN: [14458] trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/ html/HtmlScript3Test.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[HtmlUnit] SVN: [14458] trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/ html/HtmlScript3Test.java

rbri
Revision: 14458
          http://sourceforge.net/p/htmlunit/code/14458
Author:   rbri
Date:     2017-05-17 14:37:19 +0000 (Wed, 17 May 2017)
Log Message:
-----------
more html encoding tests (wip)

Modified Paths:
--------------
    trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlScript3Test.java

Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlScript3Test.java
===================================================================
--- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlScript3Test.java 2017-05-17 09:34:05 UTC (rev 14457)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlScript3Test.java 2017-05-17 14:37:19 UTC (rev 14458)
@@ -80,7 +80,7 @@
         final List<Object[]> list = new ArrayList<>();
 
         final TestCharset[] charsetHtmlResponseHeader =
-                new TestCharset[] {/* null, TestCharset.UTF8, */ TestCharset.ISO88591};
+                new TestCharset[] {/**null, */TestCharset.UTF8, TestCharset.ISO88591};
         final TestCharset[] charsetAttribute = new TestCharset[] {null, TestCharset.UTF8, TestCharset.ISO88591};
         final TestCharset[] charsetResponseHeader = new TestCharset[] {null, TestCharset.UTF8, TestCharset.ISO88591};
         final TestCharset[] charsetResponseEncoding = new TestCharset[] {null, TestCharset.UTF8, TestCharset.ISO88591};
@@ -138,7 +138,7 @@
     @Alerts("أهلاً")
     @Default
     public void charset() throws Exception {
-        charset(TestCharset.ISO88591, charsetAttribute_, charsetResponseHeader_, charsetResponseEncoding_, bom_);
+        charset(charsetHtmlResponseHeader_, charsetAttribute_, charsetResponseHeader_, charsetResponseEncoding_, bom_);
     }
 
     private void charset(
@@ -755,4 +755,514 @@
     public void _ISO88591_ISO88591_ISO88591_ISO88591_BOMUTF16BE() throws Exception {
         charset(TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.ISO88591, BOM_UTF_16BE);
     }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("?????")
+    public void _UTF8_ISO88591_ISO88591_ISO88591_() throws Exception {
+        charset(TestCharset.UTF8, TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.ISO88591, null);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    public void _UTF8_ISO88591_ISO88591_ISO88591_BOMUTF16BE() throws Exception {
+        charset(TestCharset.UTF8, TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.ISO88591, BOM_UTF_16BE);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("?????")
+    public void _UTF8_ISO88591_ISO88591_ISO88591_BOMUTF8() throws Exception {
+        charset(TestCharset.UTF8, TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.ISO88591, BOM_UTF_8);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("\u00D8\u00A3\u00D9\u2021\u00D9\u201E\u00D8\u00A7\u00D9\u2039")
+    public void _UTF8_ISO88591_ISO88591_UTF8_() throws Exception {
+        charset(TestCharset.UTF8, TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.UTF8, null);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    public void _UTF8_ISO88591_ISO88591_UTF8_BOMUTF16BE() throws Exception {
+        charset(TestCharset.UTF8, TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.UTF8, BOM_UTF_16BE);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("\u00D8\u00A3\u00D9\u2021\u00D9\u201E\u00D8\u00A7\u00D9\u2039")
+    public void _UTF8_ISO88591_ISO88591__() throws Exception {
+        charset(TestCharset.UTF8, TestCharset.ISO88591, TestCharset.ISO88591, null, null);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    public void _UTF8_ISO88591_ISO88591__BOMUTF16BE() throws Exception {
+        charset(TestCharset.UTF8, TestCharset.ISO88591, TestCharset.ISO88591, null, BOM_UTF_16BE);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("?????")
+    public void _UTF8_ISO88591_UTF8_ISO88591_() throws Exception {
+        charset(TestCharset.UTF8, TestCharset.ISO88591, TestCharset.UTF8, TestCharset.ISO88591, null);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    public void _UTF8_ISO88591_UTF8_ISO88591_BOMUTF16BE() throws Exception {
+        charset(TestCharset.UTF8, TestCharset.ISO88591, TestCharset.UTF8, TestCharset.ISO88591, BOM_UTF_16BE);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("?????")
+    public void _UTF8_ISO88591_UTF8_ISO88591_BOMUTF8() throws Exception {
+        charset(TestCharset.UTF8, TestCharset.ISO88591, TestCharset.UTF8, TestCharset.ISO88591, BOM_UTF_8);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    public void _UTF8_ISO88591_UTF8_UTF8_BOMUTF16BE() throws Exception {
+        charset(TestCharset.UTF8, TestCharset.ISO88591, TestCharset.UTF8, TestCharset.UTF8, BOM_UTF_16BE);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    public void _UTF8_ISO88591_UTF8__BOMUTF16BE() throws Exception {
+        charset(TestCharset.UTF8, TestCharset.ISO88591, TestCharset.UTF8, null, BOM_UTF_16BE);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("?????")
+    public void _UTF8_ISO88591__ISO88591_() throws Exception {
+        charset(TestCharset.UTF8, TestCharset.ISO88591, null, TestCharset.ISO88591, null);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    public void _UTF8_ISO88591__ISO88591_BOMUTF16BE() throws Exception {
+        charset(TestCharset.UTF8, TestCharset.ISO88591, null, TestCharset.ISO88591, BOM_UTF_16BE);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("?????")
+    public void _UTF8_ISO88591__ISO88591_BOMUTF8() throws Exception {
+        charset(TestCharset.UTF8, TestCharset.ISO88591, null, TestCharset.ISO88591, BOM_UTF_8);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("\u00D8\u00A3\u00D9\u2021\u00D9\u201E\u00D8\u00A7\u00D9\u2039")
+    public void _UTF8_ISO88591__UTF8_() throws Exception {
+        charset(TestCharset.UTF8, TestCharset.ISO88591, null, TestCharset.UTF8, null);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    public void _UTF8_ISO88591__UTF8_BOMUTF16BE() throws Exception {
+        charset(TestCharset.UTF8, TestCharset.ISO88591, null, TestCharset.UTF8, BOM_UTF_16BE);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("\u00D8\u00A3\u00D9\u2021\u00D9\u201E\u00D8\u00A7\u00D9\u2039")
+    public void _UTF8_ISO88591___() throws Exception {
+        charset(TestCharset.UTF8, TestCharset.ISO88591, null, null, null);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    public void _UTF8_ISO88591___BOMUTF16BE() throws Exception {
+        charset(TestCharset.UTF8, TestCharset.ISO88591, null, null, BOM_UTF_16BE);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("?????")
+    public void _UTF8_UTF8_ISO88591_ISO88591_() throws Exception {
+        charset(TestCharset.UTF8, TestCharset.UTF8, TestCharset.ISO88591, TestCharset.ISO88591, null);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    public void _UTF8_UTF8_ISO88591_ISO88591_BOMUTF16BE() throws Exception {
+        charset(TestCharset.UTF8, TestCharset.UTF8, TestCharset.ISO88591, TestCharset.ISO88591, BOM_UTF_16BE);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("?????")
+    public void _UTF8_UTF8_ISO88591_ISO88591_BOMUTF8() throws Exception {
+        charset(TestCharset.UTF8, TestCharset.UTF8, TestCharset.ISO88591, TestCharset.ISO88591, BOM_UTF_8);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("\u00D8\u00A3\u00D9\u2021\u00D9\u201E\u00D8\u00A7\u00D9\u2039")
+    public void _UTF8_UTF8_ISO88591_UTF8_() throws Exception {
+        charset(TestCharset.UTF8, TestCharset.UTF8, TestCharset.ISO88591, TestCharset.UTF8, null);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    public void _UTF8_UTF8_ISO88591_UTF8_BOMUTF16BE() throws Exception {
+        charset(TestCharset.UTF8, TestCharset.UTF8, TestCharset.ISO88591, TestCharset.UTF8, BOM_UTF_16BE);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("\u00D8\u00A3\u00D9\u2021\u00D9\u201E\u00D8\u00A7\u00D9\u2039")
+    public void _UTF8_UTF8_ISO88591__() throws Exception {
+        charset(TestCharset.UTF8, TestCharset.UTF8, TestCharset.ISO88591, null, null);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    public void _UTF8_UTF8_ISO88591__BOMUTF16BE() throws Exception {
+        charset(TestCharset.UTF8, TestCharset.UTF8, TestCharset.ISO88591, null, BOM_UTF_16BE);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("?????")
+    public void _UTF8_UTF8_UTF8_ISO88591_() throws Exception {
+        charset(TestCharset.UTF8, TestCharset.UTF8, TestCharset.UTF8, TestCharset.ISO88591, null);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    public void _UTF8_UTF8_UTF8_ISO88591_BOMUTF16BE() throws Exception {
+        charset(TestCharset.UTF8, TestCharset.UTF8, TestCharset.UTF8, TestCharset.ISO88591, BOM_UTF_16BE);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("?????")
+    public void _UTF8_UTF8_UTF8_ISO88591_BOMUTF8() throws Exception {
+        charset(TestCharset.UTF8, TestCharset.UTF8, TestCharset.UTF8, TestCharset.ISO88591, BOM_UTF_8);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    public void _UTF8_UTF8_UTF8_UTF8_BOMUTF16BE() throws Exception {
+        charset(TestCharset.UTF8, TestCharset.UTF8, TestCharset.UTF8, TestCharset.UTF8, BOM_UTF_16BE);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    public void _UTF8_UTF8_UTF8__BOMUTF16BE() throws Exception {
+        charset(TestCharset.UTF8, TestCharset.UTF8, TestCharset.UTF8, null, BOM_UTF_16BE);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("?????")
+    public void _UTF8_UTF8__ISO88591_() throws Exception {
+        charset(TestCharset.UTF8, TestCharset.UTF8, null, TestCharset.ISO88591, null);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    public void _UTF8_UTF8__ISO88591_BOMUTF16BE() throws Exception {
+        charset(TestCharset.UTF8, TestCharset.UTF8, null, TestCharset.ISO88591, BOM_UTF_16BE);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("?????")
+    public void _UTF8_UTF8__ISO88591_BOMUTF8() throws Exception {
+        charset(TestCharset.UTF8, TestCharset.UTF8, null, TestCharset.ISO88591, BOM_UTF_8);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    public void _UTF8_UTF8__UTF8_BOMUTF16BE() throws Exception {
+        charset(TestCharset.UTF8, TestCharset.UTF8, null, TestCharset.UTF8, BOM_UTF_16BE);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    public void _UTF8_UTF8___BOMUTF16BE() throws Exception {
+        charset(TestCharset.UTF8, TestCharset.UTF8, null, null, BOM_UTF_8);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("?????")
+    public void _UTF8__ISO88591_ISO88591_() throws Exception {
+        charset(TestCharset.UTF8, null, TestCharset.ISO88591, TestCharset.ISO88591, null);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    public void _UTF8__ISO88591_ISO88591_BOMUTF16BE() throws Exception {
+        charset(TestCharset.UTF8, null, TestCharset.ISO88591, TestCharset.ISO88591, BOM_UTF_16BE);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("?????")
+    public void _UTF8__ISO88591_ISO88591_BOMUTF8() throws Exception {
+        charset(TestCharset.UTF8, null, TestCharset.ISO88591, TestCharset.ISO88591, BOM_UTF_8);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("\u00D8\u00A3\u00D9\u2021\u00D9\u201E\u00D8\u00A7\u00D9\u2039")
+    public void _UTF8__ISO88591_UTF8_() throws Exception {
+        charset(TestCharset.UTF8, null, TestCharset.ISO88591, TestCharset.UTF8, null);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    public void _UTF8__ISO88591_UTF8_BOMUTF16BE() throws Exception {
+        charset(TestCharset.UTF8, null, TestCharset.ISO88591, TestCharset.UTF8, BOM_UTF_16BE);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("\u00D8\u00A3\u00D9\u2021\u00D9\u201E\u00D8\u00A7\u00D9\u2039")
+    public void _UTF8__ISO88591__() throws Exception {
+        charset(TestCharset.UTF8, null, TestCharset.ISO88591, null, null);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    public void _UTF8__ISO88591__BOMUTF16BE() throws Exception {
+        charset(TestCharset.UTF8, null, TestCharset.ISO88591, null, BOM_UTF_16BE);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("?????")
+    public void _UTF8__UTF8_ISO88591_() throws Exception {
+        charset(TestCharset.UTF8, null, TestCharset.UTF8, TestCharset.ISO88591, null);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    public void _UTF8__UTF8_ISO88591_BOMUTF16BE() throws Exception {
+        charset(TestCharset.UTF8, null, TestCharset.UTF8, TestCharset.ISO88591, BOM_UTF_16BE);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("?????")
+    public void _UTF8__UTF8_ISO88591_BOMUTF8() throws Exception {
+        charset(TestCharset.UTF8, null, TestCharset.UTF8, TestCharset.ISO88591, BOM_UTF_8);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    public void _UTF8__UTF8_UTF8_BOMUTF16BE() throws Exception {
+        charset(TestCharset.UTF8, null, TestCharset.UTF8, TestCharset.UTF8, BOM_UTF_16BE);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    public void _UTF8__UTF8__BOMUTF16BE() throws Exception {
+        charset(TestCharset.UTF8, null, TestCharset.UTF8, null, BOM_UTF_16BE);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("?????")
+    public void _UTF8___ISO88591_() throws Exception {
+        charset(TestCharset.UTF8, null, null, TestCharset.ISO88591, null);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    public void _UTF8___ISO88591_BOMUTF16BE() throws Exception {
+        charset(TestCharset.UTF8, null, null, TestCharset.ISO88591, BOM_UTF_16BE);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("?????")
+    public void _UTF8___ISO88591_BOMUTF8() throws Exception {
+        charset(TestCharset.UTF8, null, null, TestCharset.ISO88591, BOM_UTF_8);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    public void _UTF8___UTF8_BOMUTF16BE() throws Exception {
+        charset(TestCharset.UTF8, null, null, TestCharset.UTF8, BOM_UTF_16BE);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    public void _UTF8____BOMUTF16BE() throws Exception {
+        charset(TestCharset.UTF8, null, null, null, BOM_UTF_16BE);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts(DEFAULT = "أهلاً",
+            IE = "\u00D8\u00A3\u00D9\u2021\u00D9\u201E\u00D8\u00A7\u00D9\u2039")
+    public void _UTF8_ISO88591_ISO88591_UTF8_BOMUTF8() throws Exception {
+        charset(TestCharset.UTF8, TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.UTF8, BOM_UTF_8);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts(DEFAULT = "أهلاً",
+            IE = "\u00D8\u00A3\u00D9\u2021\u00D9\u201E\u00D8\u00A7\u00D9\u2039")
+    public void _UTF8_ISO88591_ISO88591__BOMUTF8() throws Exception {
+        charset(TestCharset.UTF8, TestCharset.ISO88591, TestCharset.ISO88591, null, BOM_UTF_8);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts(DEFAULT = "أهلاً",
+            IE = "\u00D8\u00A3\u00D9\u2021\u00D9\u201E\u00D8\u00A7\u00D9\u2039")
+    public void _UTF8_UTF8_ISO88591_UTF8_BOMUTF8() throws Exception {
+        charset(TestCharset.UTF8, TestCharset.UTF8, TestCharset.ISO88591, TestCharset.UTF8, BOM_UTF_8);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts(DEFAULT = "أهلاً",
+            IE = "\u00D8\u00A3\u00D9\u2021\u00D9\u201E\u00D8\u00A7\u00D9\u2039")
+    public void _UTF8_UTF8_ISO88591__BOMUTF8() throws Exception {
+        charset(TestCharset.UTF8, TestCharset.UTF8, TestCharset.ISO88591, null, BOM_UTF_8);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts(DEFAULT = "أهلاً",
+            IE = "\u00D8\u00A3\u00D9\u2021\u00D9\u201E\u00D8\u00A7\u00D9\u2039")
+    public void _UTF8__ISO88591_UTF8_BOMUTF8() throws Exception {
+        charset(TestCharset.UTF8, null, TestCharset.ISO88591, TestCharset.UTF8, BOM_UTF_8);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts(DEFAULT = "أهلاً",
+            IE = "\u00D8\u00A3\u00D9\u2021\u00D9\u201E\u00D8\u00A7\u00D9\u2039")
+    public void _UTF8__ISO88591__BOMUTF8() throws Exception {
+        charset(TestCharset.UTF8, null, TestCharset.ISO88591, null, BOM_UTF_8);
+    }
 }


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
HtmlUnit-develop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop
Loading...