This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/9.0.x by this push:
     new b6cc542  Speed up unit tests.
b6cc542 is described below

commit b6cc5425aeb777aac0ce28727b45c22f38da3c06
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Tue Mar 31 20:33:05 2020 +0100

    Speed up unit tests.
    
    Only run TestCharsetUtil#testIsAcsiiSupersetAll() if a new Charset is
    detected.
---
 java/org/apache/tomcat/util/buf/CharsetCache.java    | 2 ++
 test/org/apache/tomcat/util/buf/TestCharsetUtil.java | 5 ++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/buf/CharsetCache.java 
b/java/org/apache/tomcat/util/buf/CharsetCache.java
index 2f09168..3146d6a 100644
--- a/java/org/apache/tomcat/util/buf/CharsetCache.java
+++ b/java/org/apache/tomcat/util/buf/CharsetCache.java
@@ -152,6 +152,8 @@ public class CharsetCache {
             "ibm858", "x-ibm29626c",
             // Added from HPE JVM 1.8.0.17-hp-ux
             "cp1051", "cp1386", "cshproman8", "hp-roman8", "ibm-1051", "r8", 
"roman8", "roman9"
+            // If you add and entry to this list, ensure you run
+            // TestCharsetUtil#testIsAcsiiSupersetAll()
             };
 
     private static final Charset DUMMY_CHARSET = new DummyCharset("Dummy",  
null);
diff --git a/test/org/apache/tomcat/util/buf/TestCharsetUtil.java 
b/test/org/apache/tomcat/util/buf/TestCharsetUtil.java
index b6b7790..309f415 100644
--- a/test/org/apache/tomcat/util/buf/TestCharsetUtil.java
+++ b/test/org/apache/tomcat/util/buf/TestCharsetUtil.java
@@ -46,8 +46,11 @@ public class TestCharsetUtil {
     /*
      * More comprehensive test that checks that, part from where the encoding
      * overlaps with ASCII, no valid ASCII bytes are used.
+     *
+     * This is relatively slow.
+     * Only need to run this when we detect a new Charset.
      */
-    @Test
+    //@Test
     public void testIsAcsiiSupersetAll() {
         for (Charset charset : Charset.availableCharsets().values()) {
             System.out.println("Testing: " + charset.name());


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to