Hi,

As I ran the Tomcat 8.5 APR tests on Debian I noticed several failures
in TestOpenSSLCipherConfigurationParser. They were caused by the missing
IDEA cipher which was historically disabled in Debian due to patent
issues, but that wasn't immediately obvious because the failure message
simply states that ciphers are missing but not which ones are missing.
The message looked like this:

    Testcase: testMEDIUM took 0.003 sec
            FAILED
    expected:<4> but was:<6>

I'd like to suggest this minor modification to improve the messages:

--- 
a/test/org/apache/tomcat/util/net/openssl/ciphers/TestOpenSSLCipherConfigurationParser.java
+++ 
b/test/org/apache/tomcat/util/net/openssl/ciphers/TestOpenSSLCipherConfigurationParser.java
@@ -562,8 +563,8 @@

         // First check the lists have the same entries
         // Order is NOT important at this point. It is checked below.
-        Assert.assertEquals(jsseCipherListFromOpenSSL.size(), 
jsseCipherListFromParser.size());
-        
Assert.assertTrue(jsseCipherListFromOpenSSL.containsAll(jsseCipherListFromParser));
+        Assert.assertEquals("Expected " + jsseCipherListFromParser.size() + " 
ciphers but got " + jsseCipherListFromOpenSSL.size() + " for the specification 
'" + specification + "'",
+                            new TreeSet(jsseCipherListFromParser), new 
TreeSet(jsseCipherListFromOpenSSL));

         // OpenSSL treats many ciphers as having equal preference. The order
         // returned depends on the order they are requested. The following code

This will display something like this:

    Expected 6 ciphers but got 4 for the specification 'MEDIUM' 

followed by the sorted ciphers in both lists, such that they can
be easily compared.

Emmanuel Bourg

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

Reply via email to