You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2017/11/04 09:05:01 UTC

[camel] branch master updated (42389a0 -> 2c482af)

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

davsclaus pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git.


    from 42389a0  CAMEL-11869: Upgrade mockito-core to 2.11.0 for camel-atmosphere-websocket, camel-salesforce-component and camel-script
     new a840c82  CAMEL-11836: Upgrade to Jetty 9.4.x
     new 2c482af  CAMEL-11836: Upgrade to Jetty 9.4.x

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../camel/component/atom/JettyTestServer.java      |   5 +-
 .../component/jetty/HttpRoundtripHeaderTest.java   | 125 ---------------------
 .../JettyHttpProducerSendEmptyHeaderTest.java      |  53 ---------
 .../camel/component/rss/JettyTestServer.java       |   5 +-
 parent/pom.xml                                     |   3 +-
 platforms/spring-boot/spring-boot-dm/pom.xml       |   3 +-
 6 files changed, 12 insertions(+), 182 deletions(-)
 delete mode 100644 components/camel-jetty9/src/test/java/org/apache/camel/component/jetty/HttpRoundtripHeaderTest.java
 delete mode 100644 components/camel-jetty9/src/test/java/org/apache/camel/component/jetty/jettyproducer/JettyHttpProducerSendEmptyHeaderTest.java

-- 
To stop receiving notification emails like this one, please contact
['"commits@camel.apache.org" <co...@camel.apache.org>'].

[camel] 02/02: CAMEL-11836: Upgrade to Jetty 9.4.x

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 2c482aff7310e60ade2e5d4c08c07ce0697ffa9a
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sat Nov 4 09:53:48 2017 +0100

    CAMEL-11836: Upgrade to Jetty 9.4.x
---
 .../JettyHttpProducerSendEmptyHeaderTest.java      | 53 ----------------------
 parent/pom.xml                                     |  3 +-
 platforms/spring-boot/spring-boot-dm/pom.xml       |  3 +-
 3 files changed, 4 insertions(+), 55 deletions(-)

diff --git a/components/camel-jetty9/src/test/java/org/apache/camel/component/jetty/jettyproducer/JettyHttpProducerSendEmptyHeaderTest.java b/components/camel-jetty9/src/test/java/org/apache/camel/component/jetty/jettyproducer/JettyHttpProducerSendEmptyHeaderTest.java
deleted file mode 100644
index a7db5c1..0000000
--- a/components/camel-jetty9/src/test/java/org/apache/camel/component/jetty/jettyproducer/JettyHttpProducerSendEmptyHeaderTest.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.jetty.jettyproducer;
-
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.jetty.BaseJettyTest;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.junit.Test;
-
-/**
- *
- */
-public class JettyHttpProducerSendEmptyHeaderTest extends BaseJettyTest {
-
-    @Test
-    public void testHttpProducerSendEmptyHeader() throws Exception {
-        MockEndpoint mock = getMockEndpoint("mock:result");
-        mock.expectedMessageCount(1);
-        String expectedValue = "";
-        mock.expectedHeaderReceived("foo", expectedValue);
-
-        template.sendBodyAndHeader("jetty:http://localhost:{{port}}/myapp/mytest", "Hello World", "foo", "");
-
-        assertMockEndpointsSatisfied();
-    }
-
-    @Override
-    protected RouteBuilder createRouteBuilder() throws Exception {
-        return new RouteBuilder() {
-            @Override
-            public void configure() throws Exception {
-                allowNullHeaders();
-                from("jetty:http://localhost:{{port}}/myapp/mytest")
-                    .convertBodyTo(String.class)
-                    .to("mock:result");
-            }
-        };
-    }
-}
diff --git a/parent/pom.xml b/parent/pom.xml
index 34c79df..5033718 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -376,7 +376,8 @@
     <jersey-version>2.11</jersey-version>
     <jetty6-bundle-version>6.1.26_4</jetty6-bundle-version>
     <jetty92-version>9.2.22.v20170606</jetty92-version>
-    <jetty9-version>9.4.7.v20170914</jetty9-version>
+    <!-- Jetty 9.4.7 is buggy, do not use -->
+    <jetty9-version>9.4.6.v20170531</jetty9-version>
     <jetty-version>${jetty9-version}</jetty-version>
     <jetty-plugin-version>${jetty-version}</jetty-plugin-version>
     <jetty-runner-groupId>org.eclipse.jetty</jetty-runner-groupId>
diff --git a/platforms/spring-boot/spring-boot-dm/pom.xml b/platforms/spring-boot/spring-boot-dm/pom.xml
index 8394bfa..dbd973c 100644
--- a/platforms/spring-boot/spring-boot-dm/pom.xml
+++ b/platforms/spring-boot/spring-boot-dm/pom.xml
@@ -67,7 +67,8 @@
     <!-- The following versions should be aligned with the ones in spring-boot-repo/spring-boot-dependencies/pom.xml (for the targeted version of spring-boot) -->
     <!-- for example: https://github.com/spring-projects/spring-boot/blob/v1.5.8.RELEASE/spring-boot-dependencies/pom.xml -->
     <jackson2-version>2.8.10</jackson2-version>
-    <jetty9-version>9.4.7.v20170914</jetty9-version>
+    <!-- jetty 9.4.7 is buggy -->
+    <jetty9-version>9.4.6.v20170531</jetty9-version>
     <jetty-version>${jetty9-version}</jetty-version>
     <jna-version>4.2.2</jna-version>
     <hazelcast-version>3.7.8</hazelcast-version>

-- 
To stop receiving notification emails like this one, please contact
"commits@camel.apache.org" <co...@camel.apache.org>.

[camel] 01/02: CAMEL-11836: Upgrade to Jetty 9.4.x

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit a840c8214b04d6800f0a1ab01d605442cf3524e1
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri Nov 3 13:05:39 2017 +0100

    CAMEL-11836: Upgrade to Jetty 9.4.x
---
 .../camel/component/atom/JettyTestServer.java      |   5 +-
 .../component/jetty/HttpRoundtripHeaderTest.java   | 125 ---------------------
 .../camel/component/rss/JettyTestServer.java       |   5 +-
 parent/pom.xml                                     |   2 +-
 4 files changed, 9 insertions(+), 128 deletions(-)

diff --git a/components/camel-atom/src/test/java/org/apache/camel/component/atom/JettyTestServer.java b/components/camel-atom/src/test/java/org/apache/camel/component/atom/JettyTestServer.java
index 417f41e..4d7ae4e 100644
--- a/components/camel-atom/src/test/java/org/apache/camel/component/atom/JettyTestServer.java
+++ b/components/camel-atom/src/test/java/org/apache/camel/component/atom/JettyTestServer.java
@@ -29,6 +29,7 @@ import org.eclipse.jetty.security.ConstraintMapping;
 import org.eclipse.jetty.security.ConstraintSecurityHandler;
 import org.eclipse.jetty.security.HashLoginService;
 import org.eclipse.jetty.security.SecurityHandler;
+import org.eclipse.jetty.security.UserStore;
 import org.eclipse.jetty.security.authentication.BasicAuthenticator;
 import org.eclipse.jetty.server.Server;
 import org.eclipse.jetty.servlet.ServletContextHandler;
@@ -85,7 +86,9 @@ public final class JettyTestServer {
     private SecurityHandler basicAuth(String username, String password, String realm) {
 
         HashLoginService l = new HashLoginService();
-        l.putUser(username, Credential.getCredential(password), new String[]{"user"});
+        UserStore us = new UserStore();
+        us.addUser(username, Credential.getCredential(password), new String[]{"user"});
+        l.setUserStore(us);
         l.setName(realm);
 
         Constraint constraint = new Constraint();
diff --git a/components/camel-jetty9/src/test/java/org/apache/camel/component/jetty/HttpRoundtripHeaderTest.java b/components/camel-jetty9/src/test/java/org/apache/camel/component/jetty/HttpRoundtripHeaderTest.java
deleted file mode 100644
index c125bc6..0000000
--- a/components/camel-jetty9/src/test/java/org/apache/camel/component/jetty/HttpRoundtripHeaderTest.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.jetty;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.camel.Exchange;
-import org.apache.camel.Message;
-import org.apache.camel.Processor;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.impl.DefaultHeaderFilterStrategy;
-import org.apache.camel.util.IOHelper;
-import org.junit.Test;
-
-public class HttpRoundtripHeaderTest extends BaseJettyTest {
-    protected final String uri = "http://localhost:" + getPort() + "/WhichWillGetCloseException";
-    protected final String jettyUri = "jetty:" + uri;
-    protected final String outputText = ":output";
-    protected String inputText = "input";
-    protected String expectedText = inputText + outputText;
-
-    // http://issues.apache.org/activemq/browse/CAMEL-324
-    @Test
-    public void testHttpRoundTripHeaders() throws Exception {
-        MockEndpoint mockEndpoint = resolveMandatoryEndpoint("mock:results", MockEndpoint.class);
-        mockEndpoint.expectedMessageCount(1);
-
-        InputStream answer = (InputStream) template.requestBody(uri, inputText);
-
-        verifyMockGotExpectedText(mockEndpoint, expectedText);
-
-        // read the response data
-        String lastLine = readLastLine(answer);
-
-        assertNotNull("last response line", lastLine);
-        assertEquals("response matches: " + expectedText, expectedText, lastLine);
-    }
-
-    @Test
-    public void testHttpRoundTripHeadersWithNoIgnoredHeaders() throws Exception {
-        MockEndpoint mockEndpoint = resolveMandatoryEndpoint("mock:results", MockEndpoint.class);
-        mockEndpoint.expectedMessageCount(1);
-
-        JettyHttpEndpoint endpoint = context.getEndpoint(jettyUri, JettyHttpEndpoint.class);
-        // override the default set of ignored headers which includes Content-Length
-        ((DefaultHeaderFilterStrategy)endpoint.getHeaderFilterStrategy()).setOutFilter(null);
-
-        // read the response data
-        InputStream answer = (InputStream) template.requestBody(uri, inputText);
-        verifyMockGotExpectedText(mockEndpoint, expectedText);
-
-        String lastLine = readLastLine(answer);
-        assertNotNull("last response line", lastLine);
-        
-        // Content-Length from request will truncate the output to just the inputText
-        assertEquals("response matches: " + inputText, inputText, lastLine);
-    }
-
-    @Override
-    protected RouteBuilder createRouteBuilder() throws Exception {
-        return new RouteBuilder() {
-            public void configure() {
-                Processor processor = new Processor() {
-                    public void process(Exchange exchange) {
-                        String input = (String) exchange.getIn().getBody();
-                        // append some text to invalidate Context-Length
-                        // for the http reply
-                        exchange.getIn().setBody(input + outputText);
-                    }
-                };
-
-                // the unmarshaller does a copy from in message to out
-                // including all headers
-                from(jettyUri).unmarshal().string().process(processor).to("mock:results");
-            }
-        };
-    }
-
-    private void verifyMockGotExpectedText(MockEndpoint mockEndpoint, String expected) throws InterruptedException {
-        mockEndpoint.assertIsSatisfied();
-        List<Exchange> list = mockEndpoint.getReceivedExchanges();
-        Exchange exchange = list.get(0);
-        assertNotNull("exchange", exchange);
-        Message in = exchange.getIn();
-        assertNotNull("in", in);
-        Map<String, Object> headers = in.getHeaders();
-        assertTrue("no headers are propagated", !headers.isEmpty());
-        assertEquals("body has expectedText:" + expected, expected, in.getBody());
-    }
-
-    private String readLastLine(InputStream answer) throws IOException {
-        String lastLine = null;
-        BufferedReader reader = IOHelper.buffered(new InputStreamReader(answer));
-        while (true) {
-            String line = reader.readLine();
-            if (line == null) {
-                break;
-            }
-            lastLine = line;
-            log.info("Read: " + line);
-        }
-        reader.close();
-        return lastLine;
-    }
-}
diff --git a/components/camel-rss/src/test/java/org/apache/camel/component/rss/JettyTestServer.java b/components/camel-rss/src/test/java/org/apache/camel/component/rss/JettyTestServer.java
index 9c0b9e2..8977342 100644
--- a/components/camel-rss/src/test/java/org/apache/camel/component/rss/JettyTestServer.java
+++ b/components/camel-rss/src/test/java/org/apache/camel/component/rss/JettyTestServer.java
@@ -29,6 +29,7 @@ import org.eclipse.jetty.security.ConstraintMapping;
 import org.eclipse.jetty.security.ConstraintSecurityHandler;
 import org.eclipse.jetty.security.HashLoginService;
 import org.eclipse.jetty.security.SecurityHandler;
+import org.eclipse.jetty.security.UserStore;
 import org.eclipse.jetty.security.authentication.BasicAuthenticator;
 import org.eclipse.jetty.server.Server;
 import org.eclipse.jetty.servlet.ServletContextHandler;
@@ -85,7 +86,9 @@ public final class JettyTestServer {
 
     private SecurityHandler basicAuth(String username, String password, String realm) {
         HashLoginService l = new HashLoginService();
-        l.putUser(username, Credential.getCredential(password), new String[]{"user"});
+        UserStore us = new UserStore();
+        us.addUser(username, Credential.getCredential(password), new String[]{"user"});
+        l.setUserStore(us);
         l.setName(realm);
 
         Constraint constraint = new Constraint();
diff --git a/parent/pom.xml b/parent/pom.xml
index 61b5de8..34c79df 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -376,7 +376,7 @@
     <jersey-version>2.11</jersey-version>
     <jetty6-bundle-version>6.1.26_4</jetty6-bundle-version>
     <jetty92-version>9.2.22.v20170606</jetty92-version>
-    <jetty9-version>9.3.21.v20170918</jetty9-version>
+    <jetty9-version>9.4.7.v20170914</jetty9-version>
     <jetty-version>${jetty9-version}</jetty-version>
     <jetty-plugin-version>${jetty-version}</jetty-plugin-version>
     <jetty-runner-groupId>org.eclipse.jetty</jetty-runner-groupId>

-- 
To stop receiving notification emails like this one, please contact
"commits@camel.apache.org" <co...@camel.apache.org>.