Repository: camel Updated Branches: refs/heads/master 702db0c98 -> b3437769c
CAMEL-9908: Removing jetty 8 Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/b3437769 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/b3437769 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/b3437769 Branch: refs/heads/master Commit: b3437769c11996647115a58faf771e3c6a81795c Parents: 702db0c Author: Claus Ibsen <davscl...@apache.org> Authored: Wed Apr 27 20:08:53 2016 +0200 Committer: Claus Ibsen <davscl...@apache.org> Committed: Wed Apr 27 20:08:53 2016 +0200 ---------------------------------------------------------------------- components/camel-spring-ws/pom.xml | 10 +- .../ws/SSLContextParametersLocalRouteTest.java | 110 --------------- ...LContextParametersLocalRouteTest-context.xml | 141 ------------------- ...ParametersLocalRouteTest-servlet-context.xml | 41 ------ 4 files changed, 3 insertions(+), 299 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/b3437769/components/camel-spring-ws/pom.xml ---------------------------------------------------------------------- diff --git a/components/camel-spring-ws/pom.xml b/components/camel-spring-ws/pom.xml index 9d838ca..2cb7c26 100644 --- a/components/camel-spring-ws/pom.xml +++ b/components/camel-spring-ws/pom.xml @@ -32,10 +32,6 @@ <description>Camel support for Spring Web Services</description> <properties> - - <!-- TODO: upgrade to jetty 9 --> - <jetty8-version>8.1.17.v20150415</jetty8-version> - <camel.osgi.import.before.defaults> org.springframework.beans.*;version="${spring-version-range}", org.springframework.util.*;version="${spring-version-range}" @@ -76,19 +72,19 @@ <dependency> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-server</artifactId> - <version>${jetty8-version}</version> + <version>${jetty-version}</version> <scope>test</scope> </dependency> <dependency> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-security</artifactId> - <version>${jetty8-version}</version> + <version>${jetty-version}</version> <scope>test</scope> </dependency> <dependency> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-servlet</artifactId> - <version>${jetty8-version}</version> + <version>${jetty-version}</version> <scope>test</scope> <exclusions> <exclusion> http://git-wip-us.apache.org/repos/asf/camel/blob/b3437769/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/SSLContextParametersLocalRouteTest.java ---------------------------------------------------------------------- diff --git a/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/SSLContextParametersLocalRouteTest.java b/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/SSLContextParametersLocalRouteTest.java deleted file mode 100644 index 922a06d..0000000 --- a/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/SSLContextParametersLocalRouteTest.java +++ /dev/null @@ -1,110 +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.spring.ws; - -import javax.annotation.Resource; -import javax.xml.transform.Source; - -import org.apache.camel.EndpointInject; -import org.apache.camel.Produce; -import org.apache.camel.ProducerTemplate; -import org.apache.camel.StringSource; -import org.apache.camel.component.mock.MockEndpoint; -import org.junit.Test; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -@ContextConfiguration -public class SSLContextParametersLocalRouteTest extends AbstractJUnit4SpringContextTests { - - private final String stockQuoteWebserviceUri = "https://localhost"; - private final String xmlRequestForGoogleStockQuote = "<GetQuote xmlns=\"http://www.webserviceX.NET/\"><symbol>GOOG</symbol></GetQuote>"; - - @Produce - private ProducerTemplate template; - - @EndpointInject(uri = "mock:result") - private MockEndpoint resultEndpoint; - - @Resource - private int port; - - @Test - public void consumeStockQuoteWebserviceWithDefaultTemplate() throws Exception { - Object result = template.requestBody("direct:stockQuoteWebserviceWithDefaultTemplate", xmlRequestForGoogleStockQuote); - - assertNotNull(result); - assertTrue(result instanceof Source); - } - - @Test - public void consumeStockQuoteWebserviceAndPreserveHeaders() throws Exception { - resultEndpoint.expectedHeaderReceived("helloHeader", "hello world!"); - - Object result = template.requestBodyAndHeader("direct:stockQuoteWebserviceMock", xmlRequestForGoogleStockQuote, "helloHeader", "hello world!"); - - assertNotNull(result); - resultEndpoint.assertIsSatisfied(); - } - - @Test - public void consumeStockQuoteWebservice() throws Exception { - Object result = template.requestBody("direct:stockQuoteWebservice", xmlRequestForGoogleStockQuote); - - assertNotNull(result); - assertTrue(result instanceof Source); - } - - @Test - public void consumeStockQuoteWebserviceWithCamelStringSourceInput() throws Exception { - Object result = template.requestBody("direct:stockQuoteWebservice", new StringSource(xmlRequestForGoogleStockQuote)); - - assertNotNull(result); - assertTrue(result instanceof Source); - } - - @Test - public void consumeStockQuoteWebserviceWithNonDefaultMessageFactory() throws Exception { - Object result = template.requestBody("direct:stockQuoteWebserviceWithNonDefaultMessageFactory", xmlRequestForGoogleStockQuote); - - assertNotNull(result); - assertTrue(result instanceof Source); - } - - @Test - public void consumeStockQuoteWebserviceAndConvertResult() throws Exception { - Object result = template.requestBody("direct:stockQuoteWebserviceAsString", xmlRequestForGoogleStockQuote); - - assertNotNull(result); - assertTrue(result instanceof String); - String resultMessage = (String) result; - assertTrue(resultMessage.contains("Google Inc.")); - } - - @Test - public void consumeStockQuoteWebserviceAndProvideEndpointUriByHeader() throws Exception { - Object result = template.requestBodyAndHeader("direct:stockQuoteWebserviceWithoutDefaultUri", xmlRequestForGoogleStockQuote, - SpringWebserviceConstants.SPRING_WS_ENDPOINT_URI, stockQuoteWebserviceUri + ":" + port); - - assertNotNull(result); - assertTrue(result instanceof String); - String resultMessage = (String) result; - assertTrue(resultMessage.contains("Google Inc.")); - } -} http://git-wip-us.apache.org/repos/asf/camel/blob/b3437769/components/camel-spring-ws/src/test/resources/org/apache/camel/component/spring/ws/SSLContextParametersLocalRouteTest-context.xml ---------------------------------------------------------------------- diff --git a/components/camel-spring-ws/src/test/resources/org/apache/camel/component/spring/ws/SSLContextParametersLocalRouteTest-context.xml b/components/camel-spring-ws/src/test/resources/org/apache/camel/component/spring/ws/SSLContextParametersLocalRouteTest-context.xml deleted file mode 100644 index 235d643..0000000 --- a/components/camel-spring-ws/src/test/resources/org/apache/camel/component/spring/ws/SSLContextParametersLocalRouteTest-context.xml +++ /dev/null @@ -1,141 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - 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. ---> -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation=" - http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd - http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"> - - - <bean id="port" class="org.apache.camel.test.AvailablePortFinder" - factory-method="getNextAvailable" /> - - <camelContext xmlns="http://camel.apache.org/schema/spring"> - <!-- producer routes (web service clients) --> - <route> - <from uri="direct:stockQuoteWebservice" /> - <to - uri="spring-ws:https://localhost:#{port}?webServiceTemplate=#webServiceTemplate&soapAction=http://www.stockquotes.edu/GetQuote&sslContextParameters=#sslContextParameters" /> - </route> - <route> - <from uri="direct:stockQuoteWebserviceMock" /> - <pipeline> - <to - uri="spring-ws:https://localhost:#{port}?webServiceTemplate=#webServiceTemplate&soapAction=http://www.stockquotes.edu/GetQuote&sslContextParameters=#sslContextParameters" /> - <to uri="mock:result" /> - </pipeline> - </route> - <route> - <from uri="direct:stockQuoteWebserviceAsString" /> - <to - uri="spring-ws:https://localhost:#{port}?webServiceTemplate=#webServiceTemplate&soapAction=http://www.stockquotes.edu/GetQuote&sslContextParameters=#sslContextParameters" /> - <convertBodyTo type="java.lang.String" /> - </route> - <route> - <from uri="direct:stockQuoteWebserviceWithDefaultTemplate" /> - <to - uri="spring-ws:https://localhost:#{port}?webServiceTemplate=#webServiceTemplate&soapAction=http://www.stockquotes.edu/GetQuote&sslContextParameters=#sslContextParameters" /> - </route> - <route> - <from uri="direct:stockQuoteWebserviceWithNonDefaultMessageFactory" /> - <to - uri="spring-ws:https://localhost:#{port}?webServiceTemplate=#webServiceTemplate&soapAction=http://www.stockquotes.edu/GetQuote&messageFactory=#messageFactory&sslContextParameters=#sslContextParameters" /> - </route> - <route> - <from uri="direct:stockQuoteWebserviceWithoutDefaultUri" /> - <to - uri="spring-ws:https://dummy?webServiceTemplate=#webServiceTemplate&soapAction=http://www.stockquotes.edu/GetQuote&sslContextParameters=#sslContextParameters" /> - <convertBodyTo type="java.lang.String" /> - </route> - </camelContext> - - <sslContextParameters xmlns="http://camel.apache.org/schema/spring" - id="sslContextParameters" sessionTimeout="1" secureSocketProtocol="TLS"> - - <keyManagers keyPassword="changeit"> - <keyStore resource="localhost.ks" password="changeit" /> - </keyManagers> - - <trustManagers> - <keyStore resource="localhost.ks" password="changeit" /> - </trustManagers> - - </sslContextParameters> - - <bean id="messageFactory" - class="org.springframework.ws.soap.saaj.SaajSoapMessageFactory" /> - - <bean id="webServiceTemplate" class="org.springframework.ws.client.core.WebServiceTemplate"> - <property name="defaultUri" value="https://localhost:#{port}/GetQuote" /> - </bean> - - <bean id="jettyServer" class="org.eclipse.jetty.server.Server" - destroy-method="stop" init-method="start"> - <property name="connectors"> - <list> - <bean id="Connector" - class="org.eclipse.jetty.server.ssl.SslSelectChannelConnector"> - <constructor-arg> - <bean class="org.eclipse.jetty.http.ssl.SslContextFactory"> - <property name="keyStorePath" value="src/test/resources/localhost.ks" /> - <property name="keyStorePassword" value="changeit" /> - <property name="trustStore" value="src/test/resources/localhost.ks" /> - <property name="trustStorePassword" value="changeit" /> - </bean> - </constructor-arg> - <property name="port" ref="port" /> - </bean> - </list> - </property> - <property name="handler"> - <bean class="org.eclipse.jetty.servlet.ServletContextHandler"> - <property name="contextPath" value="/"/> - <property name="servletHandler"> - <bean class="org.eclipse.jetty.servlet.ServletHandler"> - <property name="servlets"> - <list> - <bean class="org.eclipse.jetty.servlet.ServletHolder"> - <property name="name" value="test"/> - <property name="servlet"> - <bean - class="org.springframework.ws.transport.http.MessageDispatcherServlet"> - </bean> - </property> - <property name="initParameters"> - <map> - <entry key="contextConfigLocation" - value="classpath:org/apache/camel/component/spring/ws/SSLContextParametersLocalRouteTest-servlet-context.xml" /> - </map> - </property> - </bean> - </list> - </property> - <property name="servletMappings"> - <list> - <bean class="org.eclipse.jetty.servlet.ServletMapping"> - <property name="pathSpec" value="/*"/> - <property name="servletName" value="test"/> - </bean> - </list> - </property> - </bean> - </property> - </bean> - </property> - </bean> -</beans> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/b3437769/components/camel-spring-ws/src/test/resources/org/apache/camel/component/spring/ws/SSLContextParametersLocalRouteTest-servlet-context.xml ---------------------------------------------------------------------- diff --git a/components/camel-spring-ws/src/test/resources/org/apache/camel/component/spring/ws/SSLContextParametersLocalRouteTest-servlet-context.xml b/components/camel-spring-ws/src/test/resources/org/apache/camel/component/spring/ws/SSLContextParametersLocalRouteTest-servlet-context.xml deleted file mode 100644 index f8d3791..0000000 --- a/components/camel-spring-ws/src/test/resources/org/apache/camel/component/spring/ws/SSLContextParametersLocalRouteTest-servlet-context.xml +++ /dev/null @@ -1,41 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - 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. ---> -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation=" - http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd - http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"> - - <camelContext xmlns="http://camel.apache.org/schema/spring" id="consumer"> - <!-- consumer route (providing the actual web service) --> - <route> - <from - uri="spring-ws:soapaction:http://www.stockquotes.edu/GetQuote?endpointMapping=#endpointMapping" /> - <to uri="responseProcessor" /> - </route> - </camelContext> - - <bean id="messageFactory" - class="org.springframework.ws.soap.saaj.SaajSoapMessageFactory" /> - - <bean id="endpointMapping" - class="org.apache.camel.component.spring.ws.bean.CamelEndpointMapping" /> - - <bean id="responseProcessor" - class="org.apache.camel.component.spring.ws.StockQuoteResponseProcessor" /> -</beans> \ No newline at end of file