camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [2/2] camel git commit: CAMEL-9482: Removed option which has been deprecated for a very long time
Date Tue, 05 Jan 2016 16:39:00 GMT
CAMEL-9482: Removed option which has been deprecated for a very long time


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/df701cc3
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/df701cc3
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/df701cc3

Branch: refs/heads/master
Commit: df701cc3776833c98a3e2b53f86dfd8f01eabe4b
Parents: bc5a402
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Tue Jan 5 17:22:47 2016 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Tue Jan 5 17:38:53 2016 +0100

----------------------------------------------------------------------
 .../camel/component/http/HttpComponent.java     | 14 ++-------
 .../http/HttpReferenceParameterTest.java        |  6 ++--
 .../camel/component/http4/HttpComponent.java    | 32 ++++----------------
 .../http4/HttpReferenceParameterTest.java       | 10 +++---
 .../component/servlet/ServletComponent.java     |  7 +----
 .../servlet/rest/RestServletGetTest.java        |  2 +-
 .../rest/RestServletGetWildcardsTest.java       |  2 +-
 7 files changed, 19 insertions(+), 54 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/df701cc3/components/camel-http/src/main/java/org/apache/camel/component/http/HttpComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-http/src/main/java/org/apache/camel/component/http/HttpComponent.java
b/components/camel-http/src/main/java/org/apache/camel/component/http/HttpComponent.java
index 104ff84..3106f2d 100644
--- a/components/camel-http/src/main/java/org/apache/camel/component/http/HttpComponent.java
+++ b/components/camel-http/src/main/java/org/apache/camel/component/http/HttpComponent.java
@@ -65,12 +65,7 @@ public class HttpComponent extends HttpCommonComponent {
      */
     protected HttpClientConfigurer createHttpClientConfigurer(Map<String, Object> parameters,
Set<AuthMethod> authMethods) {
         // prefer to use endpoint configured over component configured
-        // TODO cmueller: remove the "httpClientConfigurerRef" look up in Camel 3.0
-        HttpClientConfigurer configurer = resolveAndRemoveReferenceParameter(parameters,
"httpClientConfigurerRef", HttpClientConfigurer.class);
-        if (configurer == null) {
-            // try without ref
-            configurer = resolveAndRemoveReferenceParameter(parameters, "httpClientConfigurer",
HttpClientConfigurer.class);
-        }
+        HttpClientConfigurer configurer = resolveAndRemoveReferenceParameter(parameters,
"httpClientConfigurer", HttpClientConfigurer.class);
         if (configurer == null) {
             // fallback to component configured
             configurer = getHttpClientConfigurer();
@@ -200,12 +195,7 @@ public class HttpComponent extends HttpCommonComponent {
         }
         Map<String, Object> httpClientParameters = new HashMap<String, Object>(parameters);
         // must extract well known parameters before we create the endpoint
-        // TODO cmueller: remove the "httpBindingRef" look up in Camel 3.0
-        HttpBinding binding = resolveAndRemoveReferenceParameter(parameters, "httpBindingRef",
HttpBinding.class);
-        if (binding == null) {
-            // try without ref
-            binding = resolveAndRemoveReferenceParameter(parameters, "httpBinding", HttpBinding.class);
-        }
+        HttpBinding binding = resolveAndRemoveReferenceParameter(parameters, "httpBinding",
HttpBinding.class);
         String proxyHost = getAndRemoveParameter(parameters, "proxyHost", String.class);
         Integer proxyPort = getAndRemoveParameter(parameters, "proxyPort", Integer.class);
         String authMethodPriority = getAndRemoveParameter(parameters, "authMethodPriority",
String.class);

http://git-wip-us.apache.org/repos/asf/camel/blob/df701cc3/components/camel-http/src/test/java/org/apache/camel/component/http/HttpReferenceParameterTest.java
----------------------------------------------------------------------
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpReferenceParameterTest.java
b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpReferenceParameterTest.java
index 5e93ee3..82ab548 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpReferenceParameterTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpReferenceParameterTest.java
@@ -28,8 +28,8 @@ import org.junit.Test;
  */
 public class HttpReferenceParameterTest extends CamelTestSupport {
 
-    private static final String TEST_URI_1 = "http://localhost:8080?httpBindingRef=#customBinding&httpClientConfigurerRef=#customConfigurer";
-    private static final String TEST_URI_2 = "http://localhost:8081?httpBindingRef=customBinding&httpClientConfigurerRef=customConfigurer";
+    private static final String TEST_URI_1 = "http://localhost:8080?httpBinding=#customBinding&httpClientConfigurer=#customConfigurer";
+    private static final String TEST_URI_2 = "http://localhost:8081?httpBinding=customBinding&httpClientConfigurer=customConfigurer";
     
     private HttpEndpoint endpoint1;
     private HttpEndpoint endpoint2;
@@ -47,7 +47,7 @@ public class HttpReferenceParameterTest extends CamelTestSupport {
     }
     
     @Test
-    public void testHttpBindingRef() {
+    public void testHttpBinding() {
         assertSame(testBinding, endpoint1.getBinding());
         assertSame(testBinding, endpoint2.getBinding());
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/df701cc3/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpComponent.java
b/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpComponent.java
index df47d50..c2f8c3c 100644
--- a/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpComponent.java
+++ b/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpComponent.java
@@ -94,16 +94,10 @@ public class HttpComponent extends HttpCommonComponent {
      */
     protected HttpClientConfigurer createHttpClientConfigurer(Map<String, Object> parameters,
boolean secure) throws Exception {
         // prefer to use endpoint configured over component configured
-        // TODO cmueller: remove the "httpClientConfigurerRef" look up in Camel 3.0
-        HttpClientConfigurer configurer = resolveAndRemoveReferenceParameter(parameters,
"httpClientConfigurerRef", HttpClientConfigurer.class);
+        HttpClientConfigurer configurer = resolveAndRemoveReferenceParameter(parameters,
"httpClientConfigurer", HttpClientConfigurer.class);
         if (configurer == null) {
-            // try without ref
-            configurer = resolveAndRemoveReferenceParameter(parameters, "httpClientConfigurer",
HttpClientConfigurer.class);
-            
-            if (configurer == null) {
-                // fallback to component configured
-                configurer = getHttpClientConfigurer();
-            }
+            // fallback to component configured
+            configurer = getHttpClientConfigurer();
         }
 
         configurer = configureBasicAuthentication(parameters, configurer);
@@ -167,29 +161,15 @@ public class HttpComponent extends HttpCommonComponent {
         // validate that we could resolve all httpClient. parameters as this component is
lenient
         validateParameters(uri, parameters, "httpClient.");
         
-        // TODO cmueller: remove the "httpBindingRef" look up in Camel 3.0
-        HttpBinding httpBinding = resolveAndRemoveReferenceParameter(parameters, "httpBindingRef",
HttpBinding.class);
-        if (httpBinding == null) {
-            httpBinding = resolveAndRemoveReferenceParameter(parameters, "httpBinding", HttpBinding.class);
-        }
-
-        // TODO cmueller: remove the "httpContextRef" look up in Camel 3.0
-        HttpContext httpContext = resolveAndRemoveReferenceParameter(parameters, "httpContextRef",
HttpContext.class);
-        if (httpContext == null) {
-            httpContext = resolveAndRemoveReferenceParameter(parameters, "httpContext", HttpContext.class);
-        }
+        HttpBinding httpBinding = resolveAndRemoveReferenceParameter(parameters, "httpBinding",
HttpBinding.class);
+        HttpContext httpContext = resolveAndRemoveReferenceParameter(parameters, "httpContext",
HttpContext.class);
 
         X509HostnameVerifier x509HostnameVerifier = resolveAndRemoveReferenceParameter(parameters,
"x509HostnameVerifier", X509HostnameVerifier.class);
         if (x509HostnameVerifier == null) {
             x509HostnameVerifier = getX509HostnameVerifier();
         }
-        
 
-        // TODO cmueller: remove the "sslContextParametersRef" look up in Camel 3.0
-        SSLContextParameters sslContextParameters = resolveAndRemoveReferenceParameter(parameters,
"sslContextParametersRef", SSLContextParameters.class);
-        if (sslContextParameters == null) {
-            sslContextParameters = resolveAndRemoveReferenceParameter(parameters, "sslContextParameters",
SSLContextParameters.class);
-        }
+        SSLContextParameters sslContextParameters = resolveAndRemoveReferenceParameter(parameters,
"sslContextParameters", SSLContextParameters.class);
         if (sslContextParameters == null) {
             sslContextParameters = getSslContextParameters();
         }

http://git-wip-us.apache.org/repos/asf/camel/blob/df701cc3/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpReferenceParameterTest.java
----------------------------------------------------------------------
diff --git a/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpReferenceParameterTest.java
b/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpReferenceParameterTest.java
index c750a4d..5046e5e 100644
--- a/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpReferenceParameterTest.java
+++ b/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpReferenceParameterTest.java
@@ -32,8 +32,8 @@ import org.junit.Test;
  */
 public class HttpReferenceParameterTest extends CamelTestSupport {
 
-    private static final String TEST_URI_1 = "http4://localhost:8080?httpBindingRef=#customBinding&httpClientConfigurerRef=#customConfigurer&httpContext=#customContext";
-    private static final String TEST_URI_2 = "http4://localhost:8081?httpBindingRef=customBinding&httpClientConfigurerRef=customConfigurer&httpContext=customContext";
+    private static final String TEST_URI_1 = "http4://localhost:8080?httpBinding=#customBinding&httpClientConfigurer=#customConfigurer&httpContext=#customContext";
+    private static final String TEST_URI_2 = "http4://localhost:8081?httpBinding=customBinding&httpClientConfigurer=customConfigurer&httpContext=customContext";
 
     private HttpEndpoint endpoint1;
     private HttpEndpoint endpoint2;
@@ -53,19 +53,19 @@ public class HttpReferenceParameterTest extends CamelTestSupport {
     }
 
     @Test
-    public void testHttpBindingRef() {
+    public void testHttpBinding() {
         assertSame(testBinding, endpoint1.getBinding());
         assertSame(testBinding, endpoint2.getBinding());
     }
 
     @Test
-    public void testHttpClientConfigurerRef() {
+    public void testHttpClientConfigurer() {
         assertSame(testConfigurer, endpoint1.getHttpClientConfigurer());
         assertSame(testConfigurer, endpoint2.getHttpClientConfigurer());
     }
 
     @Test
-    public void testHttpContextRef() {
+    public void testHttpContext() {
         assertSame(testHttpContext, endpoint1.getHttpContext());
         assertSame(testHttpContext, endpoint2.getHttpContext());
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/df701cc3/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/ServletComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/ServletComponent.java
b/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/ServletComponent.java
index 92dd398..51cfed1 100644
--- a/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/ServletComponent.java
+++ b/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/ServletComponent.java
@@ -56,12 +56,7 @@ public class ServletComponent extends HttpCommonComponent implements RestConsume
         Boolean throwExceptionOnFailure = getAndRemoveParameter(parameters, "throwExceptionOnFailure",
Boolean.class);
         Boolean transferException = getAndRemoveParameter(parameters, "transferException",
Boolean.class);
         Boolean bridgeEndpoint = getAndRemoveParameter(parameters, "bridgeEndpoint", Boolean.class);
-        // TODO we need to remove the Ref in Camel 3.0
-        HttpBinding binding = resolveAndRemoveReferenceParameter(parameters, "httpBindingRef",
HttpBinding.class);
-        if (binding == null) {
-            // just check the httpBinding parameter
-            binding = resolveAndRemoveReferenceParameter(parameters, "httpBinding", HttpBinding.class);
-        }
+        HttpBinding binding = resolveAndRemoveReferenceParameter(parameters, "httpBinding",
HttpBinding.class);
         Boolean matchOnUriPrefix = getAndRemoveParameter(parameters, "matchOnUriPrefix",
Boolean.class);
         String servletName = getAndRemoveParameter(parameters, "servletName", String.class,
getServletName());
         String httpMethodRestrict = getAndRemoveParameter(parameters, "httpMethodRestrict",
String.class);

http://git-wip-us.apache.org/repos/asf/camel/blob/df701cc3/components/camel-servlet/src/test/java/org/apache/camel/component/servlet/rest/RestServletGetTest.java
----------------------------------------------------------------------
diff --git a/components/camel-servlet/src/test/java/org/apache/camel/component/servlet/rest/RestServletGetTest.java
b/components/camel-servlet/src/test/java/org/apache/camel/component/servlet/rest/RestServletGetTest.java
index 12dc536..a8420d4 100644
--- a/components/camel-servlet/src/test/java/org/apache/camel/component/servlet/rest/RestServletGetTest.java
+++ b/components/camel-servlet/src/test/java/org/apache/camel/component/servlet/rest/RestServletGetTest.java
@@ -55,7 +55,7 @@ public class RestServletGetTest extends ServletCamelRouterTestSupport {
             @Override
             public void configure() throws Exception {
                 // configure to use servlet on localhost
-                restConfiguration().component("servlet").host("localhost").endpointProperty("httpBindingRef",
"#myBinding");
+                restConfiguration().component("servlet").host("localhost").endpointProperty("httpBinding",
"#myBinding");
                 
                 // use the rest DSL to define the rest services
                 rest("/users/")

http://git-wip-us.apache.org/repos/asf/camel/blob/df701cc3/components/camel-servlet/src/test/java/org/apache/camel/component/servlet/rest/RestServletGetWildcardsTest.java
----------------------------------------------------------------------
diff --git a/components/camel-servlet/src/test/java/org/apache/camel/component/servlet/rest/RestServletGetWildcardsTest.java
b/components/camel-servlet/src/test/java/org/apache/camel/component/servlet/rest/RestServletGetWildcardsTest.java
index 67a1b7a..e6f68ce 100644
--- a/components/camel-servlet/src/test/java/org/apache/camel/component/servlet/rest/RestServletGetWildcardsTest.java
+++ b/components/camel-servlet/src/test/java/org/apache/camel/component/servlet/rest/RestServletGetWildcardsTest.java
@@ -67,7 +67,7 @@ public class RestServletGetWildcardsTest extends ServletCamelRouterTestSupport
{
             @Override
             public void configure() throws Exception {
                 // configure to use servlet on localhost
-                restConfiguration().component("servlet").host("localhost").endpointProperty("httpBindingRef",
"#myBinding");
+                restConfiguration().component("servlet").host("localhost").endpointProperty("httpBinding",
"#myBinding");
                 
                 // use the rest DSL to define the rest services
                 rest("/users/")


Mime
View raw message