camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r628743 - in /activemq/camel/trunk/components/camel-cxf/src: main/java/org/apache/camel/component/cxf/ main/java/org/apache/camel/component/cxf/feature/ main/java/org/apache/camel/component/cxf/spring/ main/java/org/apache/camel/component/c...
Date Mon, 18 Feb 2008 13:48:47 GMT
Author: ningjiang
Date: Mon Feb 18 05:48:41 2008
New Revision: 628743

URL: http://svn.apache.org/viewvc?rev=628743&view=rev
Log:
CAMEL-338 Clean up the camel-cxf component codes

Removed:
    activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfMessageObserver.java
Modified:
    activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CamelInvoker.java
    activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfBinding.java
    activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfConsumer.java
    activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/feature/MessageDataFormatFeature.java
    activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/feature/PayLoadDataFormatFeature.java
    activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/CxfEndpointBeanDefinitionParser.java
    activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/NamespaceHandler.java
    activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/CamelConduit.java
    activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/spring/AbstractCamelContextBeanDefinitionParser.java
    activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/spring/CamelConduitDefinitionParser.java
    activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/spring/CamelDestinationDefinitionParser.java
    activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/util/CxfEndpointUtils.java
    activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/util/DataInInterceptor.java
    activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/util/DataOutInterceptor.java
    activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/util/NullDestination.java
    activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/util/WSDLSoapServiceFactoryBean.java
    activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/phase/PayloadPhaseManagerImplTest.java
    activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/phase/RawMessagePhaseManagerImplTest.java
    activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/spring/CxfEndpointBeanTest.java
    activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/transport/CamelConduitTest.java
    activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/transport/CamelDestinationTest.java
    activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/transport/CamelTestSupport.java
    activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/util/CxfEndpointUtilsTest.java

Modified: activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CamelInvoker.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CamelInvoker.java?rev=628743&r1=628742&r2=628743&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CamelInvoker.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CamelInvoker.java Mon Feb 18 05:48:41 2008
@@ -99,6 +99,7 @@
                 outMessage = endpoint.getBinding().createMessage();
             }
             exchange.setOutMessage(outMessage);
+            outMessage.setExchange(exchange);
         }
 
     }

Modified: activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfBinding.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfBinding.java?rev=628743&r1=628742&r2=628743&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfBinding.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfBinding.java Mon Feb 18 05:48:41 2008
@@ -81,7 +81,7 @@
         CxfMessage out = exchange.getOut();
         if (response != null) {
             out.setMessage(response);
-            out.setBody(getBody(response));
+            out.setBody(response.getContent(InputStream.class));
         }
     }
 

Modified: activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfConsumer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfConsumer.java?rev=628743&r1=628742&r2=628743&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfConsumer.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfConsumer.java Mon Feb 18 05:48:41 2008
@@ -94,11 +94,12 @@
 
             if (dataFormat.equals(DataFormat.PAYLOAD)) {
                 features.add(new PayLoadDataFormatFeature());
-                // add the logging feature here
-                features.add(new LoggingFeature());
+                // adding the logging feature here for debug
+                //features.add(new LoggingFeature());
             }
             if (dataFormat.equals(DataFormat.MESSAGE)) {
                 features.add(new MessageDataFormatFeature());
+                //features.add(new LoggingFeature());
             }
             svrBean.setFeatures(features);
 

Modified: activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/feature/MessageDataFormatFeature.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/feature/MessageDataFormatFeature.java?rev=628743&r1=628742&r2=628743&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/feature/MessageDataFormatFeature.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/feature/MessageDataFormatFeature.java Mon Feb 18 05:48:41 2008
@@ -42,14 +42,13 @@
     public void initialize(Client client, Bus bus) {
 
         removeInterceptorWhichIsOutThePhases(client.getInInterceptors(), REMAINING_IN_PHASES);
-        removeInterceptorWhichIsOutThePhases(client.getEndpoint().getService().getInInterceptors(), REMAINING_IN_PHASES);
         removeInterceptorWhichIsOutThePhases(client.getEndpoint().getInInterceptors(), REMAINING_IN_PHASES);
-        removeInterceptorWhichIsOutThePhases(client.getEndpoint().getBinding().getInInterceptors(), REMAINING_IN_PHASES);
+        client.getEndpoint().getBinding().getInInterceptors().clear();
 
-        removeInterceptorWhichIsOutThePhases(client.getOutInterceptors(), REMAINING_IN_PHASES);
-        removeInterceptorWhichIsOutThePhases(client.getEndpoint().getService().getOutInterceptors(), REMAINING_IN_PHASES);
-        removeInterceptorWhichIsOutThePhases(client.getEndpoint().getOutInterceptors(), REMAINING_IN_PHASES);
-        removeInterceptorWhichIsOutThePhases(client.getEndpoint().getBinding().getOutInterceptors(), REMAINING_IN_PHASES);
+        removeInterceptorWhichIsOutThePhases(client.getOutInterceptors(), REMAINING_OUT_PHASES);
+        removeInterceptorWhichIsOutThePhases(client.getEndpoint().getOutInterceptors(), REMAINING_OUT_PHASES);
+        client.getEndpoint().getBinding().getOutInterceptors().clear();
+        client.getEndpoint().getOutInterceptors().add(new RawMessageContentRedirectInterceptor());
 
 
     }
@@ -70,7 +69,7 @@
 
 
         resetServiceInvokerInterceptor(server);
-        server.getEndpoint().getService().getOutInterceptors().add(new RawMessageContentRedirectInterceptor());
+        server.getEndpoint().getOutInterceptors().add(new RawMessageContentRedirectInterceptor());
     }
 
     @Override

Modified: activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/feature/PayLoadDataFormatFeature.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/feature/PayLoadDataFormatFeature.java?rev=628743&r1=628742&r2=628743&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/feature/PayLoadDataFormatFeature.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/feature/PayLoadDataFormatFeature.java Mon Feb 18 05:48:41 2008
@@ -36,8 +36,8 @@
 public class PayLoadDataFormatFeature extends AbstractDataFormatFeature {
     private static final Logger LOG = LogUtils.getL7dLogger(MessageDataFormatFeature.class);
     // filiter the unused phase
-    private static final String[] REMOVING_IN_PHASES = {Phase.UNMARSHAL };
-    private static final String[] REMOVING_OUT_PHASES = {Phase.MARSHAL, Phase.MARSHAL_ENDING };
+    private static final String[] REMOVING_IN_PHASES = {Phase.UNMARSHAL, Phase.PRE_LOGICAL, Phase.PRE_LOGICAL_ENDING, Phase.POST_LOGICAL, Phase.POST_LOGICAL_ENDING };
+    private static final String[] REMOVING_OUT_PHASES = {Phase.MARSHAL, Phase.MARSHAL_ENDING, Phase.PRE_LOGICAL, Phase.PRE_LOGICAL_ENDING, Phase.POST_LOGICAL, Phase.POST_LOGICAL_ENDING };
 
     @Override
     public void initialize(Client client, Bus bus) {

Modified: activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/CxfEndpointBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/CxfEndpointBeanDefinitionParser.java?rev=628743&r1=628742&r2=628743&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/CxfEndpointBeanDefinitionParser.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/CxfEndpointBeanDefinitionParser.java Mon Feb 18 05:48:41 2008
@@ -22,24 +22,22 @@
 
 import javax.xml.namespace.QName;
 
-import org.w3c.dom.Element;
-
 import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.configuration.spring.AbstractBeanDefinitionParser;
 import org.springframework.beans.factory.BeanDefinitionStoreException;
-import org.springframework.beans.factory.config.BeanDefinition;
 import org.springframework.beans.factory.support.AbstractBeanDefinition;
 import org.springframework.beans.factory.support.BeanDefinitionBuilder;
-import org.springframework.beans.factory.xml.BeanDefinitionParser;
 import org.springframework.beans.factory.xml.ParserContext;
 
+import org.w3c.dom.Element;
+
 public class CxfEndpointBeanDefinitionParser extends AbstractBeanDefinitionParser {
 
     @Override
     protected Class getBeanClass(Element arg0) {
         return CxfEndpointBean.class;
     }
-    
+
     @Override
     protected void mapAttribute(BeanDefinitionBuilder bean, Element e, String name, String val) {
         if ("endpointName".equals(name) || "serviceName".equals(name)) {
@@ -63,10 +61,10 @@
             java.util.List list = (java.util.List)ctx.getDelegate().parseListElement(el, bean.getBeanDefinition());
             bean.addPropertyValue(name, list);
         } else {
-            setFirstChildAsProperty(el, ctx, bean, name);            
-        }        
+            setFirstChildAsProperty(el, ctx, bean, name);
+        }
     }
-    
+
 
     @Override
     protected void doParse(Element element, ParserContext ctx, BeanDefinitionBuilder bean) {
@@ -75,15 +73,15 @@
     }
 
     @Override
-    protected String resolveId(Element elem, 
-                               AbstractBeanDefinition definition, 
-                               ParserContext ctx) 
+    protected String resolveId(Element elem,
+                               AbstractBeanDefinition definition,
+                               ParserContext ctx)
         throws BeanDefinitionStoreException {
         String id = super.resolveId(elem, definition, ctx);
         if (StringUtils.isEmpty(id)) {
             throw new BeanDefinitionStoreException("The bean id is needed.");
         }
-        
+
         return id;
     }
 
@@ -91,6 +89,6 @@
     protected boolean hasBusProperty() {
         return true;
     }
-    
+
 
 }

Modified: activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/NamespaceHandler.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/NamespaceHandler.java?rev=628743&r1=628742&r2=628743&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/NamespaceHandler.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/NamespaceHandler.java Mon Feb 18 05:48:41 2008
@@ -18,14 +18,11 @@
  */
 package org.apache.camel.component.cxf.spring;
 
-import org.apache.cxf.configuration.spring.StringBeanDefinitionParser;
-import org.apache.cxf.frontend.spring.ServerFactoryBeanDefinitionParser;
-import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
 import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
 
 public class NamespaceHandler extends NamespaceHandlerSupport {
     public void init() {
-        registerBeanDefinitionParser("cxfEndpoint", new CxfEndpointBeanDefinitionParser());      
-        
+        registerBeanDefinitionParser("cxfEndpoint", new CxfEndpointBeanDefinitionParser());
+
     }
 }

Modified: activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/CamelConduit.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/CamelConduit.java?rev=628743&r1=628742&r2=628743&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/CamelConduit.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/CamelConduit.java Mon Feb 18 05:48:41 2008
@@ -16,10 +16,7 @@
  */
 package org.apache.camel.component.cxf.transport;
 
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
 import java.io.IOException;
-import java.io.InputStream;
 import java.io.OutputStream;
 import java.util.logging.Level;
 import java.util.logging.Logger;
@@ -38,13 +35,11 @@
 import org.apache.cxf.configuration.Configurer;
 import org.apache.cxf.io.CachedOutputStream;
 import org.apache.cxf.message.Message;
-import org.apache.cxf.message.MessageImpl;
 import org.apache.cxf.service.model.EndpointInfo;
 import org.apache.cxf.transport.AbstractConduit;
 import org.apache.cxf.transport.Conduit;
 import org.apache.cxf.transport.Destination;
 import org.apache.cxf.transport.MessageObserver;
-import org.apache.cxf.ws.addressing.AttributedURIType;
 import org.apache.cxf.ws.addressing.EndpointReferenceType;
 
 /**
@@ -58,30 +53,30 @@
     private String targetCamelEndpointUri;
     private CamelTemplate<Exchange> camelTemplate;
     private Bus bus;
-    
+
     public CamelConduit(CamelContext context, Bus b, EndpointInfo endpointInfo) {
         this(context, b, endpointInfo, null);
     }
-    
+
     public CamelConduit(CamelContext context, Bus b, EndpointInfo epInfo, EndpointReferenceType targetReference) {
         super(targetReference);
         String address = epInfo.getAddress();
         if (address != null) {
             targetCamelEndpointUri = address.substring(CxfConstants.CAMEL_TRANSPORT_PREFIX.length());
             if (targetCamelEndpointUri.startsWith("//")) {
-                targetCamelEndpointUri = targetCamelEndpointUri.substring(2);     
-            }           
+                targetCamelEndpointUri = targetCamelEndpointUri.substring(2);
+            }
         }
         camelContext = context;
-        endpointInfo = epInfo;        
+        endpointInfo = epInfo;
         bus = b;
         initConfig();
     }
-    
-    public void setCamelContext(CamelContext context) {        
+
+    public void setCamelContext(CamelContext context) {
         camelContext = context;
     }
-    
+
     public CamelContext getCamelContext() {
         return camelContext;
     }
@@ -94,7 +89,7 @@
 
     public void close() {
         getLogger().log(Level.FINE, "CamelConduit closed ");
-        
+
     }
 
     protected Logger getLogger() {
@@ -107,17 +102,17 @@
         }
         return endpointInfo.getName().toString() + BASE_BEAN_NAME_SUFFIX;
     }
-    
+
     private void initConfig() {
-        // we could configure the camel context here 
+        // we could configure the camel context here
         if(bus != null) {
             Configurer configurer = bus.getExtension(Configurer.class);
             if (null != configurer) {
                 configurer.configureBean(this);
             }
-        }    
+        }
     }
-    
+
     public CamelTemplate getCamelTemplate() {
         if (camelTemplate == null) {
             if (camelContext != null) {
@@ -128,7 +123,7 @@
         }
         return camelTemplate;
     }
-    
+
     public void setCamelTemplate(CamelTemplate<Exchange> template) {
         camelTemplate = template;
     }
@@ -153,9 +148,9 @@
             // do nothing here
         }
 
-        
+
         private void commitOutputMessage() {
-            ExchangePattern pattern; 
+            ExchangePattern pattern;
             if (isOneWay) {
                 pattern = ExchangePattern.InOnly;
             } else {
@@ -168,20 +163,20 @@
                     CachedOutputStream outputStream = (CachedOutputStream)outMessage.getContent(OutputStream.class);
                     // send out the request message here
                     ex.getIn().setHeaders(outMessage);
-                    ex.getIn().setBody(outputStream.getInputStream());                    
+                    ex.getIn().setBody(outputStream.getInputStream());
                     // setup the out message
                     getLogger().log(Level.FINE, "template sending request: ", ex.getIn());
                 }
             });
-            
+
             if (!isOneWay) {
                 handleResponse(exchange);
             }
-            
+
         }
 
-        private void handleResponse(org.apache.camel.Exchange exchange) {            
-            org.apache.cxf.message.Message inMessage = CxfSoapBinding.getCxfInMessage(exchange, true);           
+        private void handleResponse(org.apache.camel.Exchange exchange) {
+            org.apache.cxf.message.Message inMessage = CxfSoapBinding.getCxfInMessage(exchange, true);
             incomingObserver.onMessage(inMessage);
         }
     }

Modified: activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/spring/AbstractCamelContextBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/spring/AbstractCamelContextBeanDefinitionParser.java?rev=628743&r1=628742&r2=628743&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/spring/AbstractCamelContextBeanDefinitionParser.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/spring/AbstractCamelContextBeanDefinitionParser.java Mon Feb 18 05:48:41 2008
@@ -18,15 +18,15 @@
  */
 package org.apache.camel.component.cxf.transport.spring;
 
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
+import org.apache.camel.util.ObjectHelper;
+import org.apache.cxf.configuration.spring.AbstractBeanDefinitionParser;
 import org.springframework.beans.factory.config.BeanDefinition;
 import org.springframework.beans.factory.support.BeanDefinitionBuilder;
 import org.springframework.beans.factory.xml.ParserContext;
-import org.apache.camel.util.ObjectHelper;
-import org.apache.cxf.configuration.spring.AbstractBeanDefinitionParser;
+
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
 
 public class AbstractCamelContextBeanDefinitionParser extends AbstractBeanDefinitionParser {
     private static final String DEFAULT_CAMEL_CONTEXT_NAME = "camelContext";

Modified: activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/spring/CamelConduitDefinitionParser.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/spring/CamelConduitDefinitionParser.java?rev=628743&r1=628742&r2=628743&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/spring/CamelConduitDefinitionParser.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/spring/CamelConduitDefinitionParser.java Mon Feb 18 05:48:41 2008
@@ -18,20 +18,7 @@
  */
 package org.apache.camel.component.cxf.transport.spring;
 
-import org.w3c.dom.Element;
-
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-
-import org.springframework.beans.factory.config.BeanDefinition;
-import org.springframework.beans.factory.config.BeanDefinitionHolder;
-import org.springframework.beans.factory.support.BeanDefinitionBuilder;
-import org.springframework.beans.factory.xml.ParserContext;
 import org.apache.camel.component.cxf.transport.CamelConduit;
-import org.apache.camel.util.ObjectHelper;
-import org.apache.cxf.configuration.spring.AbstractBeanDefinitionParser;
 
 public class CamelConduitDefinitionParser extends AbstractCamelContextBeanDefinitionParser {
 

Modified: activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/spring/CamelDestinationDefinitionParser.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/spring/CamelDestinationDefinitionParser.java?rev=628743&r1=628742&r2=628743&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/spring/CamelDestinationDefinitionParser.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/spring/CamelDestinationDefinitionParser.java Mon Feb 18 05:48:41 2008
@@ -18,14 +18,7 @@
  */
 package org.apache.camel.component.cxf.transport.spring;
 
-import org.springframework.beans.factory.support.BeanDefinitionBuilder;
-import org.springframework.beans.factory.xml.ParserContext;
-
-import org.w3c.dom.Element;
-
-import org.apache.camel.component.cxf.transport.CamelConduit;
 import org.apache.camel.component.cxf.transport.CamelDestination;
-import org.apache.cxf.configuration.spring.AbstractBeanDefinitionParser;
 
 public class CamelDestinationDefinitionParser extends AbstractCamelContextBeanDefinitionParser {
     public CamelDestinationDefinitionParser() {

Modified: activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/util/CxfEndpointUtils.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/util/CxfEndpointUtils.java?rev=628743&r1=628742&r2=628743&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/util/CxfEndpointUtils.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/util/CxfEndpointUtils.java Mon Feb 18 05:48:41 2008
@@ -27,10 +27,7 @@
 
 import org.apache.camel.CamelException;
 import org.apache.camel.component.cxf.CxfEndpoint;
-import org.apache.camel.component.cxf.CxfMessage;
 import org.apache.camel.component.cxf.DataFormat;
-
-
 import org.apache.cxf.Bus;
 import org.apache.cxf.common.classloader.ClassLoaderUtils;
 import org.apache.cxf.common.i18n.Message;
@@ -47,7 +44,7 @@
 import org.apache.cxf.wsdl11.WSDLServiceFactory;
 
 
-public final class CxfEndpointUtils {    
+public final class CxfEndpointUtils {
     public static final String PROP_NAME_PORT = "port";
     public static final String PROP_NAME_SERVICE = "service";
     public static final String PROP_NAME_SERVICECLASS = "serviceClass";
@@ -56,12 +53,12 @@
     public static final String DATAFORMAT_MESSAGE = "message";
     public static final String DATAFORMAT_PAYLOAD = "payload";
     private static final Logger LOG = LogUtils.getL7dLogger(CxfEndpointUtils.class);
-    
+
     private CxfEndpointUtils() {
         // not constructed
     }
 
-    static QName getQName(final String name) {      
+    static QName getQName(final String name) {
         QName qName = null;
         if (name != null) {
             try {
@@ -69,14 +66,14 @@
             } catch (Exception ex) {
                 ex.printStackTrace();
             }
-        } 
+        }
         return qName;
     }
-    
+
     public static QName getPortName(final CxfEndpoint endpoint) {
         return getQName(endpoint.getPortName());
     }
-    
+
     public static QName getServiceName(final CxfEndpoint endpoint) {
         return getQName(endpoint.getServiceName());
     }
@@ -92,12 +89,12 @@
                 final QName endpointName = QName.valueOf(port);
                 endpointInfo = service.getServiceInfos().get(0).getEndpoint(endpointName);
             }
-            //TBD may be delegate to the EndpointUri params.  
+            //TBD may be delegate to the EndpointUri params.
         }
 
         return endpointInfo;
     }
-    
+
     public static Class getSEIClass(String className) throws ClassNotFoundException {
         if (className == null) {
             return null;
@@ -114,11 +111,11 @@
         if (cls == null || cls == Object.class) {
             return false;
         }
-        
+
         if (null != cls.getAnnotation(annotation)) {
             return true;
         }
-        
+
         for (Class<?> interfaceClass : cls.getInterfaces()) {
             if (null != interfaceClass.getAnnotation(annotation)) {
             	return true;
@@ -126,27 +123,27 @@
         }
         return hasAnnotation(cls.getSuperclass(), annotation);
     }
-    
-    
+
+
     public static ServerFactoryBean getServerFactoryBean(Class<?> cls) throws CamelException {
         ServerFactoryBean serverFactory  = null;
-        try { 
+        try {
             if (cls == null) {
                 serverFactory = new ServerFactoryBean();
                 serverFactory.setServiceFactory(new WSDLSoapServiceFactoryBean());
-                
+
             } else {
                 boolean isJSR181SEnabled = CxfEndpointUtils.hasWebServiceAnnotation(cls);
-                serverFactory = isJSR181SEnabled ? new JaxWsServerFactoryBean() 
+                serverFactory = isJSR181SEnabled ? new JaxWsServerFactoryBean()
                             : new ServerFactoryBean();
-            }    
+            }
             return serverFactory;
         } catch (Exception e) {
             throw new CamelException(e);
         }
-        
+
     }
-    
+
     public static ClientFactoryBean getClientFactoryBean(Class<?> cls) throws CamelException {
         ClientFactoryBean clientFactory = null;
         try {
@@ -155,15 +152,15 @@
                 clientFactory.setServiceFactory(new WSDLSoapServiceFactoryBean());
             } else {
                 boolean isJSR181SEnabled = CxfEndpointUtils.hasWebServiceAnnotation(cls);
-                clientFactory = isJSR181SEnabled ? new JaxWsClientFactoryBean() 
-                        : new ClientFactoryBean(); 
-            }    
+                clientFactory = isJSR181SEnabled ? new JaxWsClientFactoryBean()
+                        : new ClientFactoryBean();
+            }
             return clientFactory;
         } catch (Exception e) {
             throw new CamelException(e);
         }
     }
-    
+
     //TODO check the CxfEndpoint information integration
     public static void checkEndpiontIntegration(CxfEndpoint endpoint, Bus bus) throws CamelException {
 
@@ -202,7 +199,7 @@
                 }
                 if (serviceQName != null) {
                     ((ReflectionServiceFactoryBean)serviceFactory).setServiceName(serviceQName);
-                }    
+                }
                 ((ReflectionServiceFactoryBean)serviceFactory).setServiceClass(cls);
 
             } else {
@@ -216,21 +213,21 @@
             throw new CamelException(new Message("CLASS_X_NOT_FOUND ", LOG, serviceClassName).toString(), cnfe);
         } catch (Exception e) {
             throw new CamelException(e);
-        }       
+        }
     }
-        
+
     public static DataFormat getDataFormat(CxfEndpoint endpoint) throws CamelException {
         String dataFormatString = endpoint.getDataFormat();
         if (dataFormatString == null) {
         	return DataFormat.POJO;
         }
-                
-        DataFormat retval = DataFormat.asEnum(dataFormatString); 
-        
+
+        DataFormat retval = DataFormat.asEnum(dataFormatString);
+
         if (retval == DataFormat.UNKNOWN) {
         	throw new CamelException(new Message("INVALID_MESSAGE_FORMAT_XXXX", LOG, dataFormatString).toString());
         }
-        
+
         return retval;
     }
 }

Modified: activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/util/DataInInterceptor.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/util/DataInInterceptor.java?rev=628743&r1=628742&r2=628743&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/util/DataInInterceptor.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/util/DataInInterceptor.java Mon Feb 18 05:48:41 2008
@@ -16,8 +16,6 @@
  */
 package org.apache.camel.component.cxf.util;
 
-import java.io.IOException;
-import java.io.InputStream;
 import java.util.logging.Logger;
 
 import javax.xml.stream.XMLStreamException;
@@ -25,11 +23,8 @@
 import javax.xml.transform.dom.DOMSource;
 
 import org.apache.cxf.common.logging.LogUtils;
-import org.apache.cxf.helpers.IOUtils;
-import org.apache.cxf.helpers.XMLUtils;
 import org.apache.cxf.interceptor.AbstractInDatabindingInterceptor;
 import org.apache.cxf.interceptor.Fault;
-import org.apache.cxf.io.CachedOutputStream;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.phase.Phase;
 import org.apache.cxf.staxutils.DepthXMLStreamReader;
@@ -37,21 +32,21 @@
 
 public class DataInInterceptor extends AbstractInDatabindingInterceptor {
     private static final Logger LOG = LogUtils.getL7dLogger(DataInInterceptor.class);
-    
+
     public DataInInterceptor() {
-        super(Phase.UNMARSHAL);       
+        super(Phase.UNMARSHAL);
     }
 
     public void handleMessage(Message message) throws Fault {
         DepthXMLStreamReader xmlReader = getXMLStreamReader(message);
-        try {            
+        try {
             // put the payload source as a document
             message.setContent(Source.class, new DOMSource(StaxUtils.read(xmlReader)));
         } catch (XMLStreamException e) {
             throw new Fault(new org.apache.cxf.common.i18n.Message("XMLSTREAM_EXCEPTION",
                                                                    LOG),
                             e);
-        }        
+        }
     }
 
 }

Modified: activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/util/DataOutInterceptor.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/util/DataOutInterceptor.java?rev=628743&r1=628742&r2=628743&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/util/DataOutInterceptor.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/util/DataOutInterceptor.java Mon Feb 18 05:48:41 2008
@@ -16,18 +16,14 @@
  */
 package org.apache.camel.component.cxf.util;
 
-import java.io.IOException;
 import java.util.logging.Logger;
 
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
 import javax.xml.stream.XMLStreamWriter;
 import javax.xml.transform.Source;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.dom.DOMSource;
 
 import org.apache.cxf.common.logging.LogUtils;
-import org.apache.cxf.helpers.XMLUtils;
 import org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor;
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.message.Message;
@@ -36,26 +32,26 @@
 
 public class DataOutInterceptor extends AbstractOutDatabindingInterceptor {
     private static final Logger LOG = LogUtils.getL7dLogger(DataOutInterceptor.class);
-    
+
     public DataOutInterceptor() {
-        super(Phase.MARSHAL);        
+        super(Phase.MARSHAL);
     }
-    
+
     public void handleMessage(Message message) throws Fault {
         XMLStreamWriter xmlWriter = getXMLStreamWriter(message);
-        try {            
+        try {
             // put the payload source as a document
-            Source source = message.getContent(Source.class);            
+            Source source = message.getContent(Source.class);
             if(source != null ) {
                 XMLStreamReader xmlReader = StaxUtils.createXMLStreamReader(source);
                 StaxUtils.copy(xmlReader, xmlWriter);
-            }    
+            }
         } catch (XMLStreamException e) {
             throw new Fault(new org.apache.cxf.common.i18n.Message("XMLSTREAM_EXCEPTION",
                                                                    LOG, e),
                             e);
-        } 
-        
+        }
+
     }
 
 }

Modified: activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/util/NullDestination.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/util/NullDestination.java?rev=628743&r1=628742&r2=628743&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/util/NullDestination.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/util/NullDestination.java Mon Feb 18 05:48:41 2008
@@ -18,10 +18,7 @@
 
 import java.io.IOException;
 
-import org.apache.cxf.Bus;
-import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.message.Message;
-import org.apache.cxf.transport.ChainInitiationObserver;
 import org.apache.cxf.transport.Conduit;
 import org.apache.cxf.transport.Destination;
 import org.apache.cxf.transport.MessageObserver;
@@ -29,11 +26,11 @@
 
 public class NullDestination implements Destination{
     MessageObserver messageObserver;
-       
+
     public NullDestination() {
-        // do nothing here   
+        // do nothing here
     }
-        
+
     public EndpointReferenceType getAddress() {
         // TODO Auto-generated method stub
         return null;
@@ -50,12 +47,12 @@
 
     public void shutdown() {
         messageObserver = null;
-        
+
     }
 
     public void setMessageObserver(MessageObserver observer) {
         messageObserver = observer;
-        
+
     }
 
 }

Modified: activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/util/WSDLSoapServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/util/WSDLSoapServiceFactoryBean.java?rev=628743&r1=628742&r2=628743&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/util/WSDLSoapServiceFactoryBean.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/util/WSDLSoapServiceFactoryBean.java Mon Feb 18 05:48:41 2008
@@ -23,11 +23,9 @@
 import org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor;
 import org.apache.cxf.binding.soap.interceptor.SoapActionInInterceptor;
 import org.apache.cxf.binding.soap.interceptor.SoapActionOutInterceptor;
-import org.apache.cxf.binding.soap.interceptor.SoapHeaderInterceptor;
 import org.apache.cxf.binding.soap.interceptor.SoapHeaderOutFilterInterceptor;
 import org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor;
 import org.apache.cxf.binding.soap.interceptor.SoapPreProtocolOutInterceptor;
-import org.apache.cxf.frontend.MethodDispatcher;
 import org.apache.cxf.interceptor.AttachmentInInterceptor;
 import org.apache.cxf.interceptor.AttachmentOutInterceptor;
 import org.apache.cxf.interceptor.StaxInInterceptor;
@@ -42,25 +40,25 @@
 public class WSDLSoapServiceFactoryBean extends ReflectionServiceFactoryBean {
     private QName serviceName;
     private QName endpointName;
-    
+
     @Override
     public Service create() {
-        
+
         WSDLServiceFactory factory = new WSDLServiceFactory(getBus(), getWsdlURL(), getServiceQName());
-        
-        setService(factory.create()); 
-        initializeSoapInterceptors(); 
-        //disable the date interceptors 
+
+        setService(factory.create());
+        initializeSoapInterceptors();
+        //disable the date interceptors
         updateEndpointInfors();
         createEndpoints();
 
         return getService();
     }
-    
-    
+
+
     private void updateEndpointInfors() {
         Service service = getService();
-    
+
         for (ServiceInfo inf : service.getServiceInfos()) {
             for (EndpointInfo ei : inf.getEndpoints()) {
                 //setup the endpoint address
@@ -68,8 +66,8 @@
                 // working as the dispatch mode, the binding factory will not add interceptor
                 ei.getBinding().setProperty(AbstractBindingFactory.DATABINDING_DISABLED, Boolean.TRUE);
             }
-        }    
-        
+        }
+
     }
 
 
@@ -79,34 +77,34 @@
         getService().getInInterceptors().add(new ReadHeadersInterceptor(getBus()));
         getService().getInInterceptors().add(new MustUnderstandInterceptor());
         getService().getInInterceptors().add(new AttachmentInInterceptor());
-        
-       
+
+
         getService().getInInterceptors().add(new StaxInInterceptor());
         getService().getInInterceptors().add(new SoapActionInInterceptor());
-        
+
         getService().getOutInterceptors().add(new DataOutInterceptor());
         getService().getOutInterceptors().add(new SoapActionOutInterceptor());
         getService().getOutInterceptors().add(new AttachmentOutInterceptor());
         getService().getOutInterceptors().add(new StaxOutInterceptor());
         getService().getOutInterceptors().add(new SoapHeaderOutFilterInterceptor());
-       
+
         getService().getOutInterceptors().add(new SoapPreProtocolOutInterceptor());
         getService().getOutInterceptors().add(new SoapOutInterceptor(getBus()));
         getService().getOutFaultInterceptors().add(new SoapOutInterceptor(getBus()));
     }
-    
+
     public void setServiceName(QName name) {
         serviceName = name;
     }
-    
+
     public String getServiceName() {
         return serviceName.toString();
     }
-    
+
     public QName getServiceQName() {
         return serviceName;
     }
-    
+
     public QName getEndpointName() {
         // get the endpoint name if it is not set
         if (endpointName == null) {
@@ -114,7 +112,7 @@
         }
         return endpointName;
     }
-    
+
     public void setEndpointName(QName name) {
         endpointName = name;
     }

Modified: activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/phase/PayloadPhaseManagerImplTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/phase/PayloadPhaseManagerImplTest.java?rev=628743&r1=628742&r2=628743&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/phase/PayloadPhaseManagerImplTest.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/phase/PayloadPhaseManagerImplTest.java Mon Feb 18 05:48:41 2008
@@ -19,19 +19,18 @@
 import java.util.SortedSet;
 
 import junit.framework.TestCase;
-
 import org.apache.cxf.phase.Phase;
 import org.apache.cxf.phase.PhaseManager;
 
 
 public class PayloadPhaseManagerImplTest extends TestCase {
 
- 
+
     public void testGetInPhases() throws Exception {
         PhaseManager pm = new PayloadPhaseManagerImpl();
         SortedSet<Phase> pl = pm.getInPhases();
         assertNotNull(pl);
-        
+
         assertEquals(Phase.RECEIVE, pl.first().getName());
         assertEquals(Phase.READ, pl.last().getName());
     }
@@ -46,7 +45,7 @@
 
         boolean hasWritePhase = false;
         for (Phase p : pl) {
-            
+
             if (Phase.WRITE.equals(p.getName())) {
                 hasWritePhase = true;
                 break;

Modified: activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/phase/RawMessagePhaseManagerImplTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/phase/RawMessagePhaseManagerImplTest.java?rev=628743&r1=628742&r2=628743&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/phase/RawMessagePhaseManagerImplTest.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/phase/RawMessagePhaseManagerImplTest.java Mon Feb 18 05:48:41 2008
@@ -20,14 +20,13 @@
 import java.util.SortedSet;
 
 import junit.framework.TestCase;
-
 import org.apache.cxf.phase.Phase;
 import org.apache.cxf.phase.PhaseManager;
 
 
 public class RawMessagePhaseManagerImplTest extends TestCase {
 
-    
+
     public void testGetInPhases() throws Exception {
         PhaseManager pm = new RawMessagePhaseManagerImpl();
         SortedSet<Phase> pl = pm.getInPhases();
@@ -36,13 +35,13 @@
         assertEquals(Phase.RECEIVE, pl.first().getName());
     }
 
-    
+
     public void testGetOutPhases() throws Exception {
         PhaseManager pm = new RawMessagePhaseManagerImpl();
         SortedSet<Phase> pl = pm.getOutPhases();
         assertNotNull(pl);
         assertEquals(4, pl.size());
-        
+
         Object[] phaseArray;
         phaseArray = pl.toArray();
         assertEquals(Phase.PREPARE_SEND, ((Phase)phaseArray[0]).getName());

Modified: activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/spring/CxfEndpointBeanTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/spring/CxfEndpointBeanTest.java?rev=628743&r1=628742&r2=628743&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/spring/CxfEndpointBeanTest.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/spring/CxfEndpointBeanTest.java Mon Feb 18 05:48:41 2008
@@ -17,22 +17,20 @@
 package org.apache.camel.component.cxf.spring;
 
 import junit.framework.TestCase;
-import org.apache.cxf.configuration.spring.ConfigurerImpl;
-import org.apache.cxf.frontend.ServerFactoryBean;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
 /**
  *
  */
 public class CxfEndpointBeanTest extends TestCase{
-    
+
     public void testCxfEndpointBeanDefinitionParser() {
-        ClassPathXmlApplicationContext ctx = 
+        ClassPathXmlApplicationContext ctx =
             new ClassPathXmlApplicationContext(new String[]{"org/apache/camel/component/cxf/spring/CxfEndpointBeans.xml"});
-        
+
         CxfEndpointBean routerEndpoint = (CxfEndpointBean)ctx.getBean("routerEndpoint");
         assertEquals("Got the wrong endpoint address", routerEndpoint.getAddress(), "http://localhost:9000/router");
         assertEquals("Got the wrong endpont service class", routerEndpoint.getServiceClass().getCanonicalName(), "org.apache.camel.component.cxf.HelloService");
     }
-    
+
 }

Modified: activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/transport/CamelConduitTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/transport/CamelConduitTest.java?rev=628743&r1=628742&r2=628743&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/transport/CamelConduitTest.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/transport/CamelConduitTest.java Mon Feb 18 05:48:41 2008
@@ -31,39 +31,32 @@
 import org.apache.cxf.Bus;
 import org.apache.cxf.BusFactory;
 import org.apache.cxf.bus.spring.SpringBusFactory;
-import org.apache.cxf.message.Exchange;
-import org.apache.cxf.message.ExchangeImpl;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.message.MessageImpl;
-import org.apache.cxf.service.model.EndpointInfo;
-import org.apache.cxf.transport.Conduit;
-import org.apache.cxf.transport.MessageObserver;
-import org.apache.cxf.ws.addressing.EndpointReferenceType;
-import org.easymock.classextension.EasyMock;
 
-public class CamelConduitTest extends CamelTestSupport {    
-       
+public class CamelConduitTest extends CamelTestSupport {
+
     protected RouteBuilder createRouteBuilder() {
         return new RouteBuilder() {
             public void configure() {
                 from("direct:Producer").to("mock:EndpointA").process(new Processor() {
-                    
+
                     public void process(org.apache.camel.Exchange exchange) throws Exception {
-                        
+
                         if (exchange.getPattern().isOutCapable()) {
-                            Object result = exchange.getIn().getBody();                        
-                            exchange.getOut().setBody(result);                       
+                            Object result = exchange.getIn().getBody();
+                            exchange.getOut().setBody(result);
                         }
                     }
-                });              
+                });
             }
         };
     }
-    
+
     protected CamelContext createCamelContext() throws Exception {
         return new DefaultCamelContext();
-    }    
-        
+    }
+
     public void testCamelConduitConfiguration() throws Exception {
         QName testEndpointQNameA = new QName("http://activemq.apache.org/camel-test", "portA");
         QName testEndpointQNameB = new QName("http://activemq.apache.org/camel-test", "portB");
@@ -72,17 +65,17 @@
         BusFactory.setDefaultBus(null);
         Bus bus = bf.createBus("/org/apache/camel/component/cxf/transport/CamelConduit.xml");
         BusFactory.setDefaultBus(bus);
-        
+
         // create the conduit and set the configuration with it
         endpointInfo.setAddress("camel://direct:EndpointA");
         endpointInfo.setName(testEndpointQNameA);
         CamelConduit conduit = new CamelConduit(null, bus, endpointInfo);
         CamelContext context = conduit.getCamelContext();
-        
+
         assertNotNull("the camel context which get from camel conduit is not null", context);
         assertEquals("get the wrong camel context", context.getName(), "conduit_context");
         assertEquals(context.getRoutes().get(0).getEndpoint().getEndpointUri(), "direct:EndpointA");
-        
+
         endpointInfo.setAddress("camel://direct:EndpointC");
         endpointInfo.setName(testEndpointQNameB);
         conduit = new CamelConduit(null, bus, endpointInfo);
@@ -110,7 +103,7 @@
         assertTrue("OutputStream should not be null", os != null);
     }
 
-    public void testSendOut() throws Exception {       
+    public void testSendOut() throws Exception {
         endpointInfo.setAddress("camel://direct:Producer");
         CamelConduit conduit = setupCamelConduit(endpointInfo, true, false);
         MockEndpoint endpoint = getMockEndpoint("mock:EndpointA");
@@ -119,9 +112,9 @@
         // set the isOneWay to be true
         sendoutMessage(conduit, message, true, "HelloWorld");
         assertMockEndpointsSatisifed();
-        // verify the endpoint get the response 
+        // verify the endpoint get the response
     }
-    
+
     public void testSendOutRunTrip() throws Exception {
         endpointInfo.setAddress("camel://direct:Producer");
         CamelConduit conduit = setupCamelConduit(endpointInfo, true, false);
@@ -129,8 +122,8 @@
         endpoint.expectedMessageCount(1);
         Message message = new MessageImpl();
         // set the isOneWay to be false
-        sendoutMessage(conduit, message, false, "HelloWorld");        
-        // verify the endpoint get the response 
+        sendoutMessage(conduit, message, false, "HelloWorld");
+        // verify the endpoint get the response
         assertMockEndpointsSatisifed();
         verifyReceivedMessage("HelloWorld");
     }

Modified: activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/transport/CamelDestinationTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/transport/CamelDestinationTest.java?rev=628743&r1=628742&r2=628743&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/transport/CamelDestinationTest.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/transport/CamelDestinationTest.java Mon Feb 18 05:48:41 2008
@@ -16,8 +16,6 @@
  */
 package org.apache.camel.component.cxf.transport;
 
-import com.sun.corba.se.spi.activation.EndPointInfo;
-
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.io.InputStream;
@@ -25,7 +23,6 @@
 import javax.xml.namespace.QName;
 
 import org.apache.camel.CamelContext;
-import org.apache.camel.Processor;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.impl.DefaultCamelContext;
 import org.apache.cxf.Bus;
@@ -40,24 +37,23 @@
 import org.apache.cxf.transport.ConduitInitiator;
 import org.apache.cxf.transport.ConduitInitiatorManager;
 import org.apache.cxf.transport.MessageObserver;
-
 import org.easymock.classextension.EasyMock;
 
 public class CamelDestinationTest extends CamelTestSupport {
     private Message destMessage;
-    
+
     protected RouteBuilder createRouteBuilder() {
         return new RouteBuilder() {
             public void configure() {
-                from("direct:Producer").to("direct:EndpointA");                             
+                from("direct:Producer").to("direct:EndpointA");
             }
         };
     }
-    
+
     protected CamelContext createCamelContext() throws Exception {
         return new DefaultCamelContext();
     }
-  
+
     public void testCamelDestinationConfiguration() throws Exception {
         QName testEndpointQName = new QName("http://activemq.apache.org/camel-test", "port");
         // set up the bus with configure file
@@ -65,23 +61,23 @@
         BusFactory.setDefaultBus(null);
         Bus bus = bf.createBus("/org/apache/camel/component/cxf/transport/CamelDestination.xml");
         BusFactory.setDefaultBus(bus);
-        
+
         endpointInfo.setAddress("camel://direct:EndpointA");
         endpointInfo.setName(testEndpointQName);
         CamelDestination destination = new CamelDestination(null, bus, null, endpointInfo);
-        
+
         System.out.println("get the destination bean name" + destination.getBeanName());
         CamelContext context = destination.getCamelContext();
-        
+
         assertNotNull("The camel context which get from camel destination is not null", context);
         assertEquals("Get the wrong camel context", context.getName(), "dest_context");
         assertEquals("The camel context should has two routers", context.getRoutes().size(), 2);
         assertEquals("The router 0 start endpoint is wrong", context.getRoutes().get(0).getEndpoint().getEndpointUri(), "direct:EndpointA");
         bus.shutdown(false);
     }
-    
+
     public CamelDestination setupCamelDestination(EndpointInfo endpointInfo, boolean send) throws IOException {
-        ConduitInitiator conduitInitiator = EasyMock.createMock(ConduitInitiator.class);        
+        ConduitInitiator conduitInitiator = EasyMock.createMock(ConduitInitiator.class);
         CamelDestination camelDestination = new CamelDestination(context, bus, conduitInitiator, endpointInfo);
         if (send) {
             // setMessageObserver
@@ -97,20 +93,20 @@
         }
         return camelDestination;
     }
-    
+
     public void testGetTransportFactoryFromBus() throws Exception {
     	Bus bus = BusFactory.getDefaultBus();
     	assertNotNull(bus.getExtension(ConduitInitiatorManager.class)
         	.getConduitInitiator(CamelTransportFactory.TRANSPORT_ID));
     }
-    
+
     public void testOneWayDestination() throws Exception {
         destMessage = null;
         inMessage = null;
         EndpointInfo conduitEpInfo = new EndpointInfo();
         conduitEpInfo.setAddress("camel://direct:Producer");
         CamelConduit conduit = setupCamelConduit(conduitEpInfo, true, false);
-        Message outMessage = new MessageImpl();        
+        Message outMessage = new MessageImpl();
         CamelDestination destination = null;
         try {
             endpointInfo.setAddress("camel://direct:EndpointA");
@@ -121,14 +117,14 @@
             e.printStackTrace();
         }
         sendoutMessage(conduit, outMessage, true, "HelloWorld");
-        
+
         // just verify the Destination inMessage
         assertTrue("The destiantion should have got the message ", destMessage != null);
-        verifyReceivedMessage(destMessage, "HelloWorld");        
+        verifyReceivedMessage(destMessage, "HelloWorld");
         destination.shutdown();
     }
 
-    
+
 
     private void verifyReceivedMessage(Message inMessage, String content) {
         ByteArrayInputStream bis = (ByteArrayInputStream)inMessage.getContent(InputStream.class);
@@ -142,7 +138,7 @@
         String reponse = new String(bytes);
         assertEquals("The reponse date should be equals", content, reponse);
     }
-       
+
     public void testRoundTripDestination() throws Exception {
 
         inMessage = null;
@@ -151,8 +147,8 @@
         // set up the conduit send to be true
         CamelConduit conduit = setupCamelConduit(conduitEpInfo, true, false);
         final Message outMessage = new MessageImpl();
-        
-        endpointInfo.setAddress("camel://direct:EndpointA"); 
+
+        endpointInfo.setAddress("camel://direct:EndpointA");
         final CamelDestination destination = setupCamelDestination(endpointInfo, true);
 
         // set up MessageObserver for handlering the conduit message
@@ -168,7 +164,7 @@
                 try {
                     backConduit = destination.getBackChannel(m, null, null);
                     // wait for the message to be got from the conduit
-                    Message replyMessage = new MessageImpl();                    
+                    Message replyMessage = new MessageImpl();
                     sendoutMessage(backConduit, replyMessage, true, "HelloWorld Response");
                 } catch (Exception e) {
                     // TODO Auto-generated catch block
@@ -183,10 +179,10 @@
         sendoutMessage(conduit, outMessage, false, "HelloWorld");
         // wait for the message to be got from the destination,
         // create the thread to handler the Destination incomming message
-        
+
         verifyReceivedMessage(inMessage, "HelloWorld Response");
-       
+
         destination.shutdown();
     }
-  
+
 }

Modified: activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/transport/CamelTestSupport.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/transport/CamelTestSupport.java?rev=628743&r1=628742&r2=628743&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/transport/CamelTestSupport.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/transport/CamelTestSupport.java Mon Feb 18 05:48:41 2008
@@ -18,35 +18,23 @@
 
 import java.io.IOException;
 import java.io.OutputStream;
-import java.net.URL;
-import java.util.List;
 
-import javax.xml.namespace.QName;
-
-import junit.framework.TestCase;
-
-import org.apache.camel.CamelContext;
 import org.apache.camel.ContextTestSupport;
-import org.apache.camel.impl.DefaultCamelContext;
 import org.apache.cxf.Bus;
 import org.apache.cxf.BusFactory;
 import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.ExchangeImpl;
 import org.apache.cxf.message.Message;
-import org.apache.cxf.service.Service;
 import org.apache.cxf.service.model.EndpointInfo;
-import org.apache.cxf.service.model.ServiceInfo;
 import org.apache.cxf.transport.Conduit;
 import org.apache.cxf.transport.ConduitInitiatorManager;
 import org.apache.cxf.transport.DestinationFactoryManager;
 import org.apache.cxf.transport.MessageObserver;
 import org.apache.cxf.ws.addressing.EndpointReferenceType;
-import org.apache.cxf.wsdl11.WSDLServiceFactory;
-
 import org.easymock.classextension.EasyMock;
 
 public abstract class CamelTestSupport extends ContextTestSupport {
-   
+
     protected Bus bus;
     protected EndpointInfo endpointInfo;
     protected EndpointReferenceType target;
@@ -62,39 +50,39 @@
         CamelTransportFactory camelTransportFactory = new CamelTransportFactory();
         //set the context here to the transport factory;
         camelTransportFactory.setCamelContext(context);
-        
+
         ConduitInitiatorManager cim = bus.getExtension(ConduitInitiatorManager.class);
         BusFactory.setDefaultBus(bus);
         endpointInfo = new EndpointInfo();
     }
 
     public void tearDown() throws Exception {
-        bus.shutdown(true);        
+        bus.shutdown(true);
         super.tearDown();
     }
-    
+
     protected CamelConduit setupCamelConduit(EndpointInfo endpointInfo, boolean send, boolean decoupled) {
         if (decoupled) {
             // setup the reference type
         } else {
             target = EasyMock.createMock(EndpointReferenceType.class);
-        }    
-        
+        }
+
         CamelConduit camelConduit = new CamelConduit(context, bus, endpointInfo, target);
-        
+
         if (send) {
             // setMessageObserver
             observer = new MessageObserver() {
-                public void onMessage(Message m) {                    
+                public void onMessage(Message m) {
                     inMessage = m;
                 }
             };
             camelConduit.setMessageObserver(observer);
         }
-        
-        return camelConduit;        
+
+        return camelConduit;
     }
-    
+
     protected void sendoutMessage(Conduit conduit, Message message, Boolean isOneWay, String content) throws IOException {
         Exchange cxfExchange = message.getExchange();
         if (cxfExchange == null) {
@@ -102,18 +90,18 @@
             cxfExchange.setOneWay(isOneWay);
             message.setExchange(cxfExchange);
             cxfExchange.setInMessage(message);
-        }    
+        }
         try {
             conduit.prepare(message);
         } catch (IOException ex) {
             assertFalse("CamelConduit can't perpare to send out message", false);
-            ex.printStackTrace();            
-        }            
+            ex.printStackTrace();
+        }
         OutputStream os = message.getContent(OutputStream.class);
         assertTrue("The OutputStream should not be null ", os != null);
         os.write(content.getBytes());
-        os.close();            
+        os.close();
     }
-    
-    
+
+
 }

Modified: activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/util/CxfEndpointUtilsTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/util/CxfEndpointUtilsTest.java?rev=628743&r1=628742&r2=628743&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/util/CxfEndpointUtilsTest.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/util/CxfEndpointUtilsTest.java Mon Feb 18 05:48:41 2008
@@ -16,45 +16,38 @@
  */
 package org.apache.camel.component.cxf.util;
 
-import java.nio.ByteBuffer;
-import java.nio.CharBuffer;
-import java.nio.charset.CharacterCodingException;
-
 import javax.xml.namespace.QName;
 
+import junit.framework.TestCase;
 import org.apache.camel.CamelContext;
 import org.apache.camel.component.cxf.CxfComponent;
 import org.apache.camel.component.cxf.CxfEndpoint;
 import org.apache.camel.impl.DefaultCamelContext;
-import org.easymock.classextension.EasyMock;
-import sun.nio.cs.ThreadLocalCoders;
-import sun.text.Normalizer;
-import junit.framework.TestCase;
 
 public class CxfEndpointUtilsTest extends TestCase {
     // set up the port name and service name
     private static final QName SERVICE_NAME =
         new QName("http://www.example.com/test", "ServiceName");
-   
+
     static final String CXF_BASE_URI = "cxf://http://www.example.com/testaddress"
         + "?serviceClass=org.apache.camel.component.cxf.HelloService"
-        + "&portName={http://www.example.com/test}PortName" 
+        + "&portName={http://www.example.com/test}PortName"
         + "&serviceName={http://www.example.com/test}ServiceName";
-        
-    
+
+
     CxfEndpoint cxfEndpoint;
-        
+
     protected void createEndpoint(String uri) throws Exception {
         CamelContext context = new DefaultCamelContext();
         cxfEndpoint = (CxfEndpoint)new CxfComponent(context).createEndpoint(uri);
     }
-    
+
     public void testGetQName() throws Exception {
         createEndpoint(CXF_BASE_URI);
         QName service = CxfEndpointUtils.getQName(cxfEndpoint.getServiceName());
-        assertEquals("We should get the right service name", service, SERVICE_NAME);        
+        assertEquals("We should get the right service name", service, SERVICE_NAME);
     }
-    
-   
-      
+
+
+
 }



Mime
View raw message