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 2019/03/29 09:27:50 UTC

[camel] branch master updated: CAMEL-13221: Upgrade Jetty

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


The following commit(s) were added to refs/heads/master by this push:
     new b038ba4  CAMEL-13221: Upgrade Jetty
b038ba4 is described below

commit b038ba461217e3964d904d3ee56f5610c83a5afc
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri Mar 29 10:26:57 2019 +0100

    CAMEL-13221: Upgrade Jetty
---
 .../CxfRsProducerClientFactoryCache2Test.java      | 100 ---------------------
 .../jaxrs/CxfRsProducerClientFactoryCacheTest2.xml |  79 ----------------
 2 files changed, 179 deletions(-)

diff --git a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerClientFactoryCache2Test.java b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerClientFactoryCache2Test.java
deleted file mode 100644
index 70a8091..0000000
--- a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerClientFactoryCache2Test.java
+++ /dev/null
@@ -1,100 +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.cxf.jaxrs;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.Exchange;
-import org.apache.camel.ExchangePattern;
-import org.apache.camel.Message;
-import org.apache.camel.Processor;
-import org.apache.camel.ProducerTemplate;
-import org.apache.camel.component.cxf.CXFTestSupport;
-import org.apache.camel.component.cxf.common.message.CxfConstants;
-import org.apache.camel.component.cxf.jaxrs.testbean.Customer;
-import org.apache.camel.spring.SpringCamelContext;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.springframework.context.support.AbstractApplicationContext;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
-
-/**
- *
- */
-public class CxfRsProducerClientFactoryCache2Test extends Assert {
-    private static int port2 = CXFTestSupport.getPort("mySecurePort");
-
-    private CamelContext context2;
-    private ProducerTemplate template2;
-    private AbstractApplicationContext applicationContext;
-
-    @Before
-    public void setUp() throws Exception {
-        applicationContext = new ClassPathXmlApplicationContext("org/apache/camel/component/cxf/jaxrs/CxfRsProducerClientFactoryCacheTest2.xml");
-        context2 = SpringCamelContext.springCamelContext(applicationContext, false);
-        context2.start();
-
-        template2 = context2.createProducerTemplate();
-        template2.start();
-    }
-    
-    @After
-    public void tearDown() throws Exception {
-        if (context2 != null) {
-            context2.stop();
-            template2.stop();
-        }
-        // need to shutdown the application context to shutdown the bus
-        if (applicationContext != null) {
-            applicationContext.close();
-        }
-    }
-    
-    @Test
-    public void testGetCostumerWithHttpCentralClientAPI() throws Exception {
-        doRunTest(template2, getPort2());
-    }
-
-    private void doRunTest(ProducerTemplate template, final int clientPort) {
-        // use request as we want InOut
-        Exchange exchange = template.request("direct://http", new Processor() {
-            public void process(Exchange exchange) throws Exception {
-                exchange.setPattern(ExchangePattern.InOut);
-                Message inMessage = exchange.getIn();
-                inMessage.setHeader(CxfConstants.CAMEL_CXF_RS_USING_HTTP_API, Boolean.TRUE);
-                inMessage.setHeader(Exchange.HTTP_METHOD, "GET");
-                inMessage.setHeader(Exchange.HTTP_PATH, "/customerservice/customers/123");                
-                inMessage.setHeader(CxfConstants.CAMEL_CXF_RS_RESPONSE_CLASS, Customer.class);
-                inMessage.setHeader("clientPort", clientPort);
-                inMessage.setBody(null);                
-            }
-        });
-     
-        // get the response message 
-        Customer response = (Customer) exchange.getOut().getBody();
-        
-        assertNotNull("The response should not be null ", response);
-        assertEquals("Get a wrong customer id ", String.valueOf(response.getId()), "123");
-        assertEquals("Get a wrong customer name", response.getName(), "John");
-        assertEquals("Get a wrong response code", 200, exchange.getOut().getHeader(Exchange.HTTP_RESPONSE_CODE));
-    }
-
-    public int getPort2() {
-        return port2;
-    }
-}
diff --git a/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsProducerClientFactoryCacheTest2.xml b/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsProducerClientFactoryCacheTest2.xml
deleted file mode 100644
index f535e08..0000000
--- a/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsProducerClientFactoryCacheTest2.xml
+++ /dev/null
@@ -1,79 +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"
-	xmlns:cxf="http://camel.apache.org/schema/cxf" xmlns:jaxrs="http://cxf.apache.org/jaxrs"
-	xmlns:cxfcore="http://cxf.apache.org/core"
-	xmlns:httpj="http://cxf.apache.org/transports/http-jetty/configuration" xmlns:sec="http://cxf.apache.org/configuration/security"
-	xmlns:http="http://cxf.apache.org/transports/http/configuration" xsi:schemaLocation="
-	http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
-	http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf.xsd
-	http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd http://camel.apache.org/schema/spring
-	http://camel.apache.org/schema/spring/camel-spring.xsd http://cxf.apache.org/transports/http-jetty/configuration
-	http://cxf.apache.org/schemas/configuration/http-jetty.xsd http://cxf.apache.org/configuration/security
-	http://cxf.apache.org/schemas/configuration/security.xsd http://cxf.apache.org/transports/http/configuration
-	http://cxf.apache.org/schemas/configuration/http-conf.xsd 
-	http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd">
-	<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
-    
-	<jaxrs:server id="restService" address="https://localhost:${mySecurePort}/CxfRsProducerTest/"
-		staticSubresourceResolution="true">
-		<jaxrs:serviceBeans>
-			<ref bean="customerService"/>
-		</jaxrs:serviceBeans>
-	</jaxrs:server>
-
-	<bean id="customerService" class="org.apache.camel.component.cxf.jaxrs.testbean.CustomerService"/>
-	
-	<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
-		<route>
-			<from uri="direct://http"/>
-			<recipientList>
-			    <!-- need to pass the spring http conduit setting the CxfProducer, as we don't create a default bus for the CxfRsEndpoint anymore -->
-				<simple>cxfrs://https://localhost:${header.clientPort}/CxfRsProducerTest/?bus=#cxf</simple>
-			</recipientList>
-		</route>
-	</camelContext>
-
-	<httpj:engine-factory id="tls-config" >
-		<httpj:engine port="${mySecurePort}">
-			<httpj:tlsServerParameters>
-				<sec:keyManagers keyPassword="password">
-					<sec:keyStore type="JKS" password="password"  file="src/test/resources/org/apache/camel/component/cxf/jaxrs/Bethal.jks"/>
-				</sec:keyManagers>
-				<sec:trustManagers>
-					<sec:keyStore type="JKS" password="password" file="src/test/resources/org/apache/camel/component/cxf/jaxrs/Truststore.jks"/>
-				</sec:trustManagers>
-			</httpj:tlsServerParameters>
-		</httpj:engine>
-	</httpj:engine-factory>
-
-	<http:conduit name="*.http-conduit">
-		<http:client ConnectionTimeout="3000000" ReceiveTimeout="3000000"/>
-		<http:tlsClientParameters disableCNCheck="true">
-			<sec:keyManagers keyPassword="password">
-				<sec:keyStore type="JKS" password="password"  file="src/test/resources/org/apache/camel/component/cxf/jaxrs/Morpit.jks"/>
-			</sec:keyManagers>
-			<sec:trustManagers>
-				<sec:keyStore type="JKS" password="password" file="src/test/resources/org/apache/camel/component/cxf/jaxrs/Truststore.jks"/>
-			</sec:trustManagers>
-		</http:tlsClientParameters>
-	</http:conduit>
-
-</beans>