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

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

commit 574f39c491ea5afa490119b9de4deffd87296046
Author: Willian Antunes <willian.lima.antu...@gmail.com>
AuthorDate: Mon May 28 09:01:51 2018 -0300

    CAMEL-12541: Test object reference and no need for version check anymore
    
    Version check was removed as we already move to 2.6.x
---
 .../cxf/jaxrs/CxfRsSpringEndpointTest.java         | 16 ++----
 .../cxf/jaxrs/CxfRsSpringEndpointBeans-2.6.xml     | 57 ----------------------
 .../cxf/jaxrs/CxfRsSpringEndpointBeans.xml         | 17 +++++--
 3 files changed, 17 insertions(+), 73 deletions(-)

diff --git 
a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpointTest.java
 
b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpointTest.java
index 08ed017..5e1c109 100644
--- 
a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpointTest.java
+++ 
b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpointTest.java
@@ -22,7 +22,6 @@ import 
org.apache.camel.component.cxf.jaxrs.testbean.CustomerService;
 import org.apache.camel.component.cxf.spring.SpringJAXRSClientFactoryBean;
 import org.apache.camel.component.cxf.spring.SpringJAXRSServerFactoryBean;
 import org.apache.camel.test.spring.CamelSpringTestSupport;
-import org.apache.cxf.version.Version;
 import org.junit.Test;
 import org.springframework.beans.factory.support.BeanDefinitionBuilder;
 import org.springframework.beans.factory.support.DefaultListableBeanFactory;
@@ -75,11 +74,12 @@ public class CxfRsSpringEndpointTest extends 
CamelSpringTestSupport {
         CxfRsEndpoint endpoint = resolveMandatoryEndpoint("cxfrs://bean://" + 
BEAN_SERVICE_ENDPOINT_NAME, CxfRsEndpoint.class);
         SpringJAXRSClientFactoryBean cfb = 
(SpringJAXRSClientFactoryBean)endpoint.createJAXRSClientFactoryBean();
         
+        assertNotSame("Got the same object but must be different", 
super.applicationContext.getBean(BEAN_SERVICE_ENDPOINT_NAME), cfb);
         assertEquals("Got the wrong address", BEAN_SERVICE_ADDRESS, 
cfb.getAddress());
         assertNotNull("Service class must not be null", cfb.getServiceClass());
         assertEquals("Got the wrong ServiceClass", CustomerService.class, 
cfb.getServiceClass());
         assertEquals("Got the wrong username", BEAN_SERVICE_USERNAME, 
cfb.getUsername());
-        assertEquals("Got the wrong password", BEAN_SERVICE_PASSWORD, 
cfb.getPassword());
+        assertEquals("Got the wrong password", BEAN_SERVICE_PASSWORD, 
cfb.getPassword());                
     }
 
     public static SpringJAXRSClientFactoryBean serviceEndpoint() {
@@ -94,17 +94,9 @@ public class CxfRsSpringEndpointTest extends 
CamelSpringTestSupport {
     }    
     
     @Override
-    protected AbstractXmlApplicationContext createApplicationContext() {
-        String version = Version.getCurrentVersion();
-        
-        ClassPathXmlApplicationContext applicationContext = null;
-        
-        if (version.startsWith("2") && (version.contains("2.5") || 
version.contains("2.4"))) {
-            applicationContext = new ClassPathXmlApplicationContext(new 
String("org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpointBeans.xml"));
-        } else {
-            applicationContext = new ClassPathXmlApplicationContext(new 
String("org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpointBeans-2.6.xml"));
    
-        }
+    protected AbstractXmlApplicationContext createApplicationContext() {      
         
+        ClassPathXmlApplicationContext applicationContext = new 
ClassPathXmlApplicationContext(new 
String("org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpointBeans.xml"));   
     
         emulateBeanRegistrationProgrammatically(applicationContext);
         
         return applicationContext;
diff --git 
a/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpointBeans-2.6.xml
 
b/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpointBeans-2.6.xml
deleted file mode 100644
index 8b0ca34..0000000
--- 
a/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpointBeans-2.6.xml
+++ /dev/null
@@ -1,57 +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";
-       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://camel.apache.org/schema/spring 
http://camel.apache.org/schema/spring/camel-spring.xsd";>
-
-
-  <cxf:rsServer id="rsServer" address="http://localhost:9000/router";
-    
serviceClass="org.apache.camel.component.cxf.jaxrs.testbean.CustomerService"
-    loggingFeatureEnabled="true" loggingSizeLimit="200">
-    <cxf:properties>
-        <entry key="aKey" value="aValue"/>
-    </cxf:properties>
-    <cxf:providers>
-       <ref bean="jsonProvider"/>
-    </cxf:providers>
-    <cxf:inInterceptors>
-        <bean class="org.apache.camel.component.cxf.jaxrs.TestInInterceptor"/>
-    </cxf:inInterceptors>
-  </cxf:rsServer>
-
-  <cxf:rsClient id="rsClient" address="http://localhost:9002/helloworld";
-    
serviceClass="org.apache.camel.component.cxf.jaxrs.testbean.CustomerService">
-    <cxf:inInterceptors>
-        <bean class="org.apache.camel.component.cxf.jaxrs.TestInInterceptor"/>
-    </cxf:inInterceptors>
-  </cxf:rsClient>
-
-  <bean id="jsonProvider" 
class="org.apache.cxf.jaxrs.provider.json.JSONProvider"/>
-
-  <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring";>
-  </camelContext>
-  
-  
-
-</beans>
diff --git 
a/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpointBeans.xml
 
b/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpointBeans.xml
index fcd0e82..8b0ca34 100644
--- 
a/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpointBeans.xml
+++ 
b/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpointBeans.xml
@@ -23,22 +23,31 @@
        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://camel.apache.org/schema/spring 
http://camel.apache.org/schema/spring/camel-spring.xsd
-    ">
+       http://camel.apache.org/schema/spring 
http://camel.apache.org/schema/spring/camel-spring.xsd";>
 
 
   <cxf:rsServer id="rsServer" address="http://localhost:9000/router";
     
serviceClass="org.apache.camel.component.cxf.jaxrs.testbean.CustomerService"
     loggingFeatureEnabled="true" loggingSizeLimit="200">
+    <cxf:properties>
+        <entry key="aKey" value="aValue"/>
+    </cxf:properties>
     <cxf:providers>
        <ref bean="jsonProvider"/>
     </cxf:providers>
+    <cxf:inInterceptors>
+        <bean class="org.apache.camel.component.cxf.jaxrs.TestInInterceptor"/>
+    </cxf:inInterceptors>
   </cxf:rsServer>
 
   <cxf:rsClient id="rsClient" address="http://localhost:9002/helloworld";
-    
serviceClass="org.apache.camel.component.cxf.jaxrs.testbean.CustomerService"/>
+    
serviceClass="org.apache.camel.component.cxf.jaxrs.testbean.CustomerService">
+    <cxf:inInterceptors>
+        <bean class="org.apache.camel.component.cxf.jaxrs.TestInInterceptor"/>
+    </cxf:inInterceptors>
+  </cxf:rsClient>
 
-  <bean id="jsonProvider" class="org.apache.cxf.jaxrs.provider.JSONProvider"/>
+  <bean id="jsonProvider" 
class="org.apache.cxf.jaxrs.provider.json.JSONProvider"/>
 
   <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring";>
   </camelContext>

-- 
To stop receiving notification emails like this one, please contact
ningji...@apache.org.

Reply via email to