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/06/05 09:39:28 UTC

[camel] 03/07: CAMEL-13220: Remove deprecated producer.

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 60c1e38ef13cc0f2a83e53a14cf49dbef2532366
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Wed Jun 5 11:16:57 2019 +0200

    CAMEL-13220: Remove deprecated producer.
---
 .../greeter/JettyRecipientListCxfIssueTest.java    |  2 +-
 .../jetty/JettyBridgeHostHeaderIssueTest.java      |  4 +-
 .../itest/jetty/JettyFailoverRoundRobinTest.java   |  6 +-
 .../camel/itest/jetty/JettyFileMulticastTest.java  | 79 ----------------------
 .../org/apache/camel/itest/jetty/JettyJmsTest.java |  2 +-
 .../camel/itest/jetty/JettyJmsTwowayTest.java      |  2 +-
 .../itest/jetty/JettyMulticastJmsFileTest.java     |  2 +-
 .../camel/itest/jetty/JettyRestRedirectTest.java   |  2 +-
 .../jetty/JettySimulateFailoverRoundRobinTest.java |  6 +-
 .../apache/camel/itest/jms/JmsJettyAsyncTest.java  |  2 +-
 .../itest/jetty/JettyFileMulticastTest-context.xml | 58 ----------------
 .../jetty/JettySpringFailoverRoundRobinTest.xml    | 12 ++--
 .../JMSTransactionIsTransactedRedeliveredTest.xml  |  2 +-
 13 files changed, 27 insertions(+), 152 deletions(-)

diff --git a/tests/camel-itest/src/test/java/org/apache/camel/itest/greeter/JettyRecipientListCxfIssueTest.java b/tests/camel-itest/src/test/java/org/apache/camel/itest/greeter/JettyRecipientListCxfIssueTest.java
index 081468f..3e0c1b5 100644
--- a/tests/camel-itest/src/test/java/org/apache/camel/itest/greeter/JettyRecipientListCxfIssueTest.java
+++ b/tests/camel-itest/src/test/java/org/apache/camel/itest/greeter/JettyRecipientListCxfIssueTest.java
@@ -54,7 +54,7 @@ public class JettyRecipientListCxfIssueTest extends CamelSpringTestSupport {
         assertNotNull(request);
 
         // send a message to jetty
-        Exchange out = template.request("jetty:http://0.0.0.0:{{RecipientListCxfTest.port3}}/myapp", new Processor() {
+        Exchange out = template.request("http://0.0.0.0:{{RecipientListCxfTest.port3}}/myapp", new Processor() {
             @Override
             public void process(Exchange exchange) throws Exception {
                 exchange.getIn().setHeader("operationName", "greetMe");
diff --git a/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyBridgeHostHeaderIssueTest.java b/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyBridgeHostHeaderIssueTest.java
index e5aa036..1954350 100644
--- a/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyBridgeHostHeaderIssueTest.java
+++ b/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyBridgeHostHeaderIssueTest.java
@@ -111,8 +111,8 @@ public class JettyBridgeHostHeaderIssueTest extends CamelTestSupport {
                     .loadBalance().roundRobin()
                         .to("http4://localhost:" + port2 + "/foo?bridgeEndpoint=true&throwExceptionOnFailure=false&preserveHostHeader=true")
                         .to("http4://localhost:" + port3 + "/bar?bridgeEndpoint=true&throwExceptionOnFailure=false")
-                        .to("jetty:http://localhost:" + port4 + "/jbar?bridgeEndpoint=true&throwExceptionOnFailure=false&preserveHostHeader=true")
-                        .to("jetty:http://localhost:" + port5 + "/jbarf?bridgeEndpoint=true&throwExceptionOnFailure=false");
+                        .to("http://localhost:" + port4 + "/jbar?bridgeEndpoint=true&throwExceptionOnFailure=false&preserveHostHeader=true")
+                        .to("http://localhost:" + port5 + "/jbarf?bridgeEndpoint=true&throwExceptionOnFailure=false");
 
                 from("jetty:http://localhost:" + port2 + "/foo")
                         .process(new Processor() {
diff --git a/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyFailoverRoundRobinTest.java b/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyFailoverRoundRobinTest.java
index c5c9d7d..28613a1 100644
--- a/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyFailoverRoundRobinTest.java
+++ b/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyFailoverRoundRobinTest.java
@@ -33,6 +33,10 @@ public class JettyFailoverRoundRobinTest extends CamelTestSupport {
     private String bad2 = "jetty:http://localhost:" + port2 + "/bad2";
     private String good = "jetty:http://localhost:" + port3 + "/good";
     private String good2 = "jetty:http://localhost:" + port4 + "/good2";
+    private String hbad = "http://localhost:" + port1 + "/bad";
+    private String hbad2 = "http://localhost:" + port2 + "/bad2";
+    private String hgood = "http://localhost:" + port3 + "/good";
+    private String hgood2 = "http://localhost:" + port4 + "/good2";
 
     @Test
     public void testJettyFailoverRoundRobin() throws Exception {
@@ -72,7 +76,7 @@ public class JettyFailoverRoundRobinTest extends CamelTestSupport {
                     // -1 is to indicate that failover LB should newer exhaust and keep trying
                     .loadBalance().failover(-1, false, true)
                         // this is the four endpoints we will load balance with failover
-                        .to(bad, bad2, good, good2);
+                        .to(hbad, hbad2, hgood, hgood2);
                 // END SNIPPET: e1
 
                 from(bad)
diff --git a/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyFileMulticastTest.java b/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyFileMulticastTest.java
deleted file mode 100644
index 60781ae..0000000
--- a/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyFileMulticastTest.java
+++ /dev/null
@@ -1,79 +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.itest.jetty;
-
-import java.util.List;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.EndpointInject;
-import org.apache.camel.Exchange;
-import org.apache.camel.ProducerTemplate;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.AvailablePortFinder;
-import org.junit.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-@ContextConfiguration
-public class JettyFileMulticastTest extends AbstractJUnit4SpringContextTests {
-    
-    private static int port = AvailablePortFinder.getNextAvailable(20033);
-    static {
-        //set them as system properties so Spring can use the property placeholder
-        //things to set them into the URL's in the spring contexts 
-        System.setProperty("JettyFileMulticastTest.port", Integer.toString(port));
-    }
-    
-    @Autowired
-    protected CamelContext camelContext;
-
-    @EndpointInject("mock:resultEndpoint")
-    protected MockEndpoint resultEndpoint;
-   
-    @EndpointInject("mock:fileEndpoint")
-    protected MockEndpoint fileEndpoint;
-    
-    @Test
-    public void testMulticastEndpoint() throws Exception {
-        assertNotNull(resultEndpoint);
-        assertNotNull(fileEndpoint);
-        
-        resultEndpoint.reset();
-        fileEndpoint.reset();
-        
-        ProducerTemplate template = camelContext.createProducerTemplate();
-        template.sendBodyAndHeader("direct:start", "Hello form Willem", "Operation", "greetMe");
-
-        // Sleep a while and wait for the message whole processing
-        Thread.sleep(2000);
-        template.stop();
-
-        MockEndpoint.assertIsSatisfied(camelContext);
-        List<Exchange> resultExchanges = resultEndpoint.getReceivedExchanges();
-        assertEquals("Should get one message for mock endpoint", resultExchanges.size(), 1);
-        
-        String result = resultExchanges.get(0).getIn().getBody(String.class);
-        assertEquals("Should get the request", "<response>Hello form Willem</response>", result);        
-        assertEquals("Should get the responise code", 200, resultExchanges.get(0).getIn().getHeader(Exchange.HTTP_RESPONSE_CODE));        
-        
-    }
-
-}
diff --git a/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyJmsTest.java b/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyJmsTest.java
index 92a0a66..e2bea72 100644
--- a/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyJmsTest.java
+++ b/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyJmsTest.java
@@ -35,7 +35,7 @@ import static org.junit.Assert.assertNotNull;
 @ContextConfiguration
 public class JettyJmsTest extends AbstractJUnit4SpringContextTests {
     private static int port = AvailablePortFinder.getNextAvailable(20038);
-    private static final String URL = "jetty:http://localhost:" + port + "/test";
+    private static final String URL = "http://localhost:" + port + "/test";
     static {
         //set them as system properties so Spring can use the property placeholder
         //things to set them into the URL's in the spring contexts 
diff --git a/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyJmsTwowayTest.java b/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyJmsTwowayTest.java
index 3b2e770..2985751 100644
--- a/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyJmsTwowayTest.java
+++ b/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyJmsTwowayTest.java
@@ -33,7 +33,7 @@ import static org.junit.Assert.assertNotNull;
 public class JettyJmsTwowayTest extends AbstractJUnit4SpringContextTests {
     
     private static int port = AvailablePortFinder.getNextAvailable(20123);
-    private static final String URL = "jetty:http://localhost:" + port + "/test";
+    private static final String URL = "http://localhost:" + port + "/test";
     static {
         //set them as system properties so Spring can use the property placeholder
         //things to set them into the URL's in the spring contexts 
diff --git a/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyMulticastJmsFileTest.java b/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyMulticastJmsFileTest.java
index 41bbe35..53446fe 100644
--- a/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyMulticastJmsFileTest.java
+++ b/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyMulticastJmsFileTest.java
@@ -32,7 +32,7 @@ import static org.junit.Assert.assertEquals;
 public class JettyMulticastJmsFileTest extends AbstractJUnit4SpringContextTests {
     
     private static int port = AvailablePortFinder.getNextAvailable(20040);
-    private static final String URL = "jetty:http://localhost:" + port + "/test";
+    private static final String URL = "http://localhost:" + port + "/test";
     static {
         //set them as system properties so Spring can use the property placeholder
         //things to set them into the URL's in the spring contexts 
diff --git a/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyRestRedirectTest.java b/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyRestRedirectTest.java
index c88826b..3bd25af 100644
--- a/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyRestRedirectTest.java
+++ b/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyRestRedirectTest.java
@@ -40,7 +40,7 @@ public class JettyRestRedirectTest extends CamelTestSupport {
 
         return new RouteBuilder() {
             public void configure() {
-                restConfiguration().component("jetty").host("localhost").scheme("http").port(port);
+                restConfiguration().component("jetty").host("localhost").scheme("http").port(port).producerComponent("http4");
                 rest("/metadata/profile")
                     .get("/{id}").to("direct:profileLookup")
                     .post("/tag").to("direct:tag");
diff --git a/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettySimulateFailoverRoundRobinTest.java b/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettySimulateFailoverRoundRobinTest.java
index d51bc31..a697bda 100644
--- a/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettySimulateFailoverRoundRobinTest.java
+++ b/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettySimulateFailoverRoundRobinTest.java
@@ -39,6 +39,10 @@ public class JettySimulateFailoverRoundRobinTest extends CamelTestSupport {
     private String bad2 = "jetty:http://localhost:" + port2 + "/bad2";
     private String good = "jetty:http://localhost:" + port3 + "/good";
     private String good2 = "jetty:http://localhost:" + port4 + "/good2";
+    private String hbad = "http://localhost:" + port1 + "/bad";
+    private String hbad2 = "http://localhost:" + port2 + "/bad2";
+    private String hgood = "http://localhost:" + port3 + "/good";
+    private String hgood2 = "http://localhost:" + port4 + "/good2";
 
     @Test
     public void testJettySimulateFailoverRoundRobin() throws Exception {
@@ -71,7 +75,7 @@ public class JettySimulateFailoverRoundRobinTest extends CamelTestSupport {
             @Override
             public void configure() throws Exception {
                 from("direct:start")
-                    .process(new MyFailoverLoadBalancer(template, bad, bad2, good, good2));
+                    .process(new MyFailoverLoadBalancer(template, hbad, hbad2, hgood, hgood2));
 
                 from(bad)
                     .to("mock:bad")
diff --git a/tests/camel-itest/src/test/java/org/apache/camel/itest/jms/JmsJettyAsyncTest.java b/tests/camel-itest/src/test/java/org/apache/camel/itest/jms/JmsJettyAsyncTest.java
index dc76e8f..bcb01b7 100644
--- a/tests/camel-itest/src/test/java/org/apache/camel/itest/jms/JmsJettyAsyncTest.java
+++ b/tests/camel-itest/src/test/java/org/apache/camel/itest/jms/JmsJettyAsyncTest.java
@@ -58,7 +58,7 @@ public class JmsJettyAsyncTest extends CamelTestSupport {
             public void configure() throws Exception {
                 // enable async consumer to process messages faster
                 from("activemq:queue:inbox?asyncConsumer=false")
-                    .to("jetty:http://0.0.0.0:" + port + "/myapp")
+                    .to("http://0.0.0.0:" + port + "/myapp")
                     .to("log:result?groupSize=10", "mock:result");
 
                 from("jetty:http://0.0.0.0:" + port + "/myapp")
diff --git a/tests/camel-itest/src/test/resources/org/apache/camel/itest/jetty/JettyFileMulticastTest-context.xml b/tests/camel-itest/src/test/resources/org/apache/camel/itest/jetty/JettyFileMulticastTest-context.xml
deleted file mode 100644
index d9be9d5..0000000
--- a/tests/camel-itest/src/test/resources/org/apache/camel/itest/jetty/JettyFileMulticastTest-context.xml
+++ /dev/null
@@ -1,58 +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="properties" class="org.apache.camel.component.properties.PropertiesComponent"/>
-  <bean id="SetResponseProcessor" class="org.apache.camel.itest.jetty.SetResponseProcessor"/>
-
-  <!-- START SNIPPET: example -->
-  <camelContext xmlns="http://camel.apache.org/schema/spring" trace="true">
-    <route>
-        <from uri="jetty:http://localhost:{{JettyFileMulticastTest.port}}/test"/>        
-        <process ref="SetResponseProcessor"/>        
-    </route>
-    <route>
-        <from uri="direct:start"/>
-        <to uri="jetty:http://localhost:{{JettyFileMulticastTest.port}}/test"/>       
-        <multicast>
-          <to uri="direct:file"/> 
-          <to uri="direct:mock"/>
-        </multicast>
-    </route>
-    <route>
-        <from uri="direct:file"/>
-        <setHeader headerName="CamelFileName">
-           <constant>test.xml</constant>
-        </setHeader>
-        <to uri="file://target?fileExist=Override"/>
-        <to uri="mock:fileEndpoint"/>
-    </route>
-    <route>
-    	<from uri="direct:mock"/>    	
-    	<to uri="mock:resultEndpoint"/>
-    </route>
-  </camelContext>
-  <!-- END SNIPPET: example -->
-
-</beans>
diff --git a/tests/camel-itest/src/test/resources/org/apache/camel/itest/jetty/JettySpringFailoverRoundRobinTest.xml b/tests/camel-itest/src/test/resources/org/apache/camel/itest/jetty/JettySpringFailoverRoundRobinTest.xml
index 325b5d1..6a2bd12 100644
--- a/tests/camel-itest/src/test/resources/org/apache/camel/itest/jetty/JettySpringFailoverRoundRobinTest.xml
+++ b/tests/camel-itest/src/test/resources/org/apache/camel/itest/jetty/JettySpringFailoverRoundRobinTest.xml
@@ -31,6 +31,10 @@
         <endpoint id="bad2" uri="jetty:http://localhost:{{JettySpringFailoverRoundRobinTest.port2}}/bad2"/>
         <endpoint id="good" uri="jetty:http://localhost:{{JettySpringFailoverRoundRobinTest.port3}}/good"/>
         <endpoint id="good2" uri="jetty:http://localhost:{{JettySpringFailoverRoundRobinTest.port4}}/good2"/>
+        <endpoint id="hbad" uri="http://localhost:{{JettySpringFailoverRoundRobinTest.port1}}/bar"/>
+        <endpoint id="hbad2" uri="http://localhost:{{JettySpringFailoverRoundRobinTest.port2}}/bad2"/>
+        <endpoint id="hgood" uri="http://localhost:{{JettySpringFailoverRoundRobinTest.port3}}/good"/>
+        <endpoint id="hgood2" uri="http://localhost:{{JettySpringFailoverRoundRobinTest.port4}}/good2"/>
 
         <!-- START SNIPPET: e1 -->
         <route>
@@ -41,10 +45,10 @@
             <loadBalance inheritErrorHandler="false">
                 <failover roundRobin="true"/>
                 <!-- and this is the four endpoints we will load balance with failover -->
-                <to uri="ref:bad"/>
-                <to uri="ref:bad2"/>
-                <to uri="ref:good"/>
-                <to uri="ref:good2"/>
+                <to uri="ref:hbad"/>
+                <to uri="ref:hbad2"/>
+                <to uri="ref:hgood"/>
+                <to uri="ref:hgood2"/>
             </loadBalance>
         </route>
         <!-- END SNIPPET: e1 -->
diff --git a/tests/camel-itest/src/test/resources/org/apache/camel/itest/jms/JMSTransactionIsTransactedRedeliveredTest.xml b/tests/camel-itest/src/test/resources/org/apache/camel/itest/jms/JMSTransactionIsTransactedRedeliveredTest.xml
index 71256fa..c43458a 100644
--- a/tests/camel-itest/src/test/resources/org/apache/camel/itest/jms/JMSTransactionIsTransactedRedeliveredTest.xml
+++ b/tests/camel-itest/src/test/resources/org/apache/camel/itest/jms/JMSTransactionIsTransactedRedeliveredTest.xml
@@ -60,7 +60,7 @@
       <transacted/>
       <to uri="mock:before"/>
       <process ref="myBeforeProcessor"/>
-      <to uri="jetty:http://localhost:{{Jetty.port}}/test"/>
+      <to uri="http://localhost:{{Jetty.port}}/test"/>
       <process ref="myAfterProcessor"/>
       <to uri="mock:result"/>
     </route>