felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1693389 - in /felix/trunk/http/jetty/src: main/java/org/apache/felix/http/jetty/internal/JettyConfig.java test/java/org/apache/felix/http/jetty/internal/JettyConfigTest.java
Date Thu, 30 Jul 2015 06:18:09 GMT
Author: cziegeler
Date: Thu Jul 30 06:18:08 2015
New Revision: 1693389

URL: http://svn.apache.org/r1693389
Log:
FELIX-4979 : [Jetty] String array properties are not parsed correctly when supplied through
framework properties. Apply patch from Adrien Pailhes

Modified:
    felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java
    felix/trunk/http/jetty/src/test/java/org/apache/felix/http/jetty/internal/JettyConfigTest.java

Modified: felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java
URL: http://svn.apache.org/viewvc/felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java?rev=1693389&r1=1693388&r2=1693389&view=diff
==============================================================================
--- felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java
(original)
+++ felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java
Thu Jul 30 06:18:08 2015
@@ -551,7 +551,7 @@ public final class JettyConfig
             final String stringVal = ((String) value).trim();
             if (stringVal.length() > 0)
             {
-                return new String[] { stringVal };
+                return stringVal.split(",");
             }
         }
         else if (value instanceof String[])

Modified: felix/trunk/http/jetty/src/test/java/org/apache/felix/http/jetty/internal/JettyConfigTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/http/jetty/src/test/java/org/apache/felix/http/jetty/internal/JettyConfigTest.java?rev=1693389&r1=1693388&r2=1693389&view=diff
==============================================================================
--- felix/trunk/http/jetty/src/test/java/org/apache/felix/http/jetty/internal/JettyConfigTest.java
(original)
+++ felix/trunk/http/jetty/src/test/java/org/apache/felix/http/jetty/internal/JettyConfigTest.java
Thu Jul 30 06:18:08 2015
@@ -18,6 +18,7 @@ package org.apache.felix.http.jetty.inte
 
 import static org.easymock.EasyMock.createNiceMock;
 import static org.easymock.EasyMock.replay;
+import static org.junit.Assert.assertArrayEquals;
 
 import java.util.Hashtable;
 
@@ -113,6 +114,15 @@ public class JettyConfigTest extends Tes
         assertTrue(this.config.getHttpsPort() == port);
     }
 
+    public void testParseStringArrayProperty() {
+        Hashtable<String, Object> props = new Hashtable<>();
+        props.put("org.apache.felix.https.jetty.ciphersuites.excluded",
+                  "TLS_DHE_RSA_WITH_AES_128_CBC_SHA,TLS_DHE_RSA_WITH_AES_128_CBC_SHA256,TLS_ECDH_anon_WITH_RC4_128_SHA");
+        this.config.update(props);
+        String[] expecteds = {"TLS_DHE_RSA_WITH_AES_128_CBC_SHA", "TLS_DHE_RSA_WITH_AES_128_CBC_SHA256",
"TLS_ECDH_anon_WITH_RC4_128_SHA"};
+        assertArrayEquals(expecteds, this.config.getExcludedCipherSuites());
+    }
+
     @Override
     protected void setUp()
     {
@@ -120,4 +130,4 @@ public class JettyConfigTest extends Tes
         replay(this.context);
         this.config = new JettyConfig(this.context);
     }
-}
\ No newline at end of file
+}



Mime
View raw message