You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2008/02/17 06:31:19 UTC
svn commit: r628430 - in /activemq/camel/trunk/components/camel-cxf/src:
main/java/org/apache/camel/component/cxf/
main/java/org/apache/camel/component/cxf/feature/
test/java/org/apache/camel/component/cxf/
Author: ningjiang
Date: Sat Feb 16 21:31:05 2008
New Revision: 628430
URL: http://svn.apache.org/viewvc?rev=628430&view=rev
Log:
Orgnized the java files imports in camel-cxf component
Modified:
activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/AsyncProcessorDecorator.java
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/CxfComponent.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/CxfEndpoint.java
activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfExchange.java
activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfMessageObserver.java
activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java
activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSoapBinding.java
activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSoapComponent.java
activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSoapConsumer.java
activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSoapEndpoint.java
activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSoapProducer.java
activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/MessageInvoker.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/test/java/org/apache/camel/component/cxf/CXFGreeterRouterTest.java
activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfEndpointTest.java
activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfGreeterMessageRouterTest.java
activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfGreeterPayLoadRouterTest.java
activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfProducerRouterTest.java
activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfProducerTest.java
activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfRouterTest.java
activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfSoapBindingTest.java
activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfSoapMessageProviderTest.java
activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfSoapTest.java
activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfSpringRouterTest.java
activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/SoapTargetBean.java
Modified: activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/AsyncProcessorDecorator.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/AsyncProcessorDecorator.java?rev=628430&r1=628429&r2=628430&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/AsyncProcessorDecorator.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/AsyncProcessorDecorator.java Sat Feb 16 21:31:05 2008
@@ -16,12 +16,12 @@
*/
package org.apache.camel.component.cxf;
+import org.apache.camel.AsyncCallback;
import org.apache.camel.AsyncProcessor;
-import org.apache.camel.Processor;
import org.apache.camel.Exchange;
-import org.apache.camel.AsyncCallback;
-import org.apache.camel.util.AsyncProcessorHelper;
+import org.apache.camel.Processor;
import org.apache.camel.impl.converter.AsyncProcessorTypeConverter;
+import org.apache.camel.util.AsyncProcessorHelper;
/**
* A simple class to wrap an existing processor (synchronous or asynchronous)
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=628430&r1=628429&r2=628430&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 Sat Feb 16 21:31:05 2008
@@ -16,10 +16,7 @@
*/
package org.apache.camel.component.cxf;
-import java.io.InputStream;
import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -27,9 +24,6 @@
import java.util.logging.Logger;
import org.apache.camel.ExchangePattern;
-import org.apache.camel.RuntimeCamelException;
-import org.apache.camel.component.cxf.invoker.InvokingContext;
-import org.apache.cxf.endpoint.Client;
import org.apache.cxf.endpoint.Endpoint;
import org.apache.cxf.frontend.MethodDispatcher;
import org.apache.cxf.helpers.CastUtils;
@@ -37,9 +31,7 @@
import org.apache.cxf.message.Exchange;
import org.apache.cxf.message.Message;
import org.apache.cxf.message.MessageContentsList;
-import org.apache.cxf.message.MessageImpl;
import org.apache.cxf.service.Service;
-import org.apache.cxf.service.invoker.AbstractInvoker;
import org.apache.cxf.service.invoker.Invoker;
import org.apache.cxf.service.model.BindingMessageInfo;
import org.apache.cxf.service.model.BindingOperationInfo;
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=628430&r1=628429&r2=628430&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 Sat Feb 16 21:31:05 2008
@@ -16,22 +16,11 @@
*/
package org.apache.camel.component.cxf;
-import org.apache.camel.CamelException;
-import org.apache.camel.RuntimeCamelException;
-import org.apache.cxf.helpers.XMLUtils;
-import org.apache.cxf.message.Message;
-import org.apache.cxf.message.MessageImpl;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import java.util.Set;
-import javax.xml.namespace.QName;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
+import org.apache.cxf.message.Message;
/**
* The binding of how Camel messages get mapped to Apache CXF and back again
Modified: activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfComponent.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfComponent.java?rev=628430&r1=628429&r2=628430&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfComponent.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfComponent.java Sat Feb 16 21:31:05 2008
@@ -16,12 +16,12 @@
*/
package org.apache.camel.component.cxf;
+import java.util.Map;
+
import org.apache.camel.CamelContext;
import org.apache.camel.Endpoint;
import org.apache.camel.impl.DefaultComponent;
-import java.util.Map;
-
/**
* Defines the <a href="http://activemq.apache.org/camel/cxf.html">CXF Component</a>
@@ -29,7 +29,7 @@
* @version $Revision$
*/
public class CxfComponent extends DefaultComponent<CxfExchange> {
-
+
public CxfComponent() {
}
@@ -41,11 +41,11 @@
@Override
protected Endpoint<CxfExchange> createEndpoint(String uri, String remaining, Map parameters) throws Exception {
// now we need to add the address, endpoint name, wsdl url or the SEI to build up a endpoint
- CxfEndpoint result = new CxfEndpoint(uri, remaining, this);
+ CxfEndpoint result = new CxfEndpoint(uri, remaining, this);
setProperties(result, parameters);
// we can check the endpoint integration here
return result;
}
-
+
}
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=628430&r1=628429&r2=628430&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 Sat Feb 16 21:31:05 2008
@@ -16,7 +16,6 @@
*/
package org.apache.camel.component.cxf;
-import java.net.URI;
import java.util.ArrayList;
import java.util.List;
@@ -27,20 +26,14 @@
import org.apache.camel.component.cxf.feature.PayLoadDataFormatFeature;
import org.apache.camel.component.cxf.spring.CxfEndpointBean;
import org.apache.camel.component.cxf.util.CxfEndpointUtils;
-import org.apache.camel.component.cxf.util.UriUtils;
import org.apache.camel.impl.DefaultConsumer;
-import org.apache.camel.spring.SpringCamelContext;
import org.apache.cxf.Bus;
import org.apache.cxf.BusFactory;
import org.apache.cxf.common.classloader.ClassLoaderUtils;
import org.apache.cxf.endpoint.Server;
-import org.apache.cxf.endpoint.ServerImpl;
import org.apache.cxf.feature.AbstractFeature;
import org.apache.cxf.feature.LoggingFeature;
import org.apache.cxf.frontend.ServerFactoryBean;
-import org.apache.cxf.message.Message;
-import org.apache.cxf.transport.Destination;
-import org.apache.cxf.transport.MessageObserver;
/**
* A consumer of exchanges for a service in CXF
Modified: activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java?rev=628430&r1=628429&r2=628430&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java Sat Feb 16 21:31:05 2008
@@ -16,15 +16,10 @@
*/
package org.apache.camel.component.cxf;
-import java.net.URI;
-import java.net.URISyntaxException;
-
-import javax.xml.namespace.QName;
-
import org.apache.camel.Consumer;
+import org.apache.camel.ExchangePattern;
import org.apache.camel.Processor;
import org.apache.camel.Producer;
-import org.apache.camel.ExchangePattern;
import org.apache.camel.component.cxf.spring.CxfEndpointBean;
import org.apache.camel.impl.DefaultEndpoint;
import org.apache.camel.spring.SpringCamelContext;
@@ -34,10 +29,10 @@
/**
* Defines the <a href="http://activemq.apache.org/camel/cxf.html">CXF Endpoint</a>
- *
+ *
* @version $Revision$
*/
-public class CxfEndpoint extends DefaultEndpoint<CxfExchange> {
+public class CxfEndpoint extends DefaultEndpoint<CxfExchange> {
private final CxfComponent component;
private final String address;
private String wsdlURL;
@@ -51,26 +46,26 @@
private boolean inOut = true;
private ConfigurerImpl configurer;
private CxfEndpointBean cxfEndpointBean;
-
+
public CxfEndpoint(String uri, String address, CxfComponent component) {
super(uri, component);
- this.component = component;
+ this.component = component;
this.address = address;
if (address.startsWith(CxfConstants.SPRING_CONTEXT_ENDPOINT)) {
isSpringContextEndpoint = true;
//get the bean from spring context
beanId = address.substring(CxfConstants.SPRING_CONTEXT_ENDPOINT.length());
if (beanId.startsWith("//")) {
- beanId = beanId.substring(2);
+ beanId = beanId.substring(2);
}
SpringCamelContext context = (SpringCamelContext) this.getContext();
- configurer = new ConfigurerImpl(context.getApplicationContext());
+ configurer = new ConfigurerImpl(context.getApplicationContext());
cxfEndpointBean = (CxfEndpointBean) context.getApplicationContext().getBean(beanId);
assert(cxfEndpointBean != null);
}
}
-
+
public Producer<CxfExchange> createProducer() throws Exception {
return new CxfProducer(this);
}
@@ -90,52 +85,52 @@
public CxfExchange createExchange(Message inMessage) {
return new CxfExchange(getContext(), getExchangePattern(), inMessage);
}
-
+
public String getDataFormat() {
return dataFormat;
}
-
+
public void setDataFormat(String format) {
dataFormat = format;
}
-
+
public boolean isSpringContextEndpoint() {
return isSpringContextEndpoint;
}
-
+
public String getAddress() {
return address;
}
-
+
public String getWsdlURL() {
return wsdlURL;
}
-
+
public void setWsdlURL(String url) {
wsdlURL = url;
}
-
+
public String getServiceClass() {
return serviceClass;
-
+
}
-
- public void setServiceClass(String className) {
+
+ public void setServiceClass(String className) {
serviceClass = className;
}
-
+
public void setPortName(String port) {
portName = port;
}
-
+
public void setServiceName(String service) {
serviceName = service;
}
-
+
public String getPortName(){
return portName;
}
-
+
public String getServiceName() {
return serviceName;
}
@@ -159,7 +154,7 @@
this.inOut = inOut;
}
-
+
public CxfComponent getComponent() {
return component;
}
@@ -167,18 +162,18 @@
public boolean isSingleton() {
return true;
}
-
+
public String getBeanId() {
return beanId;
}
-
+
public CxfEndpointBean getCxfEndpointBean() {
return cxfEndpointBean;
}
-
+
public void configure(Object beanInstance) {
configurer.configureBean(beanId, beanInstance);
}
-
+
}
Modified: activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfExchange.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfExchange.java?rev=628430&r1=628429&r2=628430&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfExchange.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfExchange.java Sat Feb 16 21:31:05 2008
@@ -19,7 +19,6 @@
import org.apache.camel.CamelContext;
import org.apache.camel.ExchangePattern;
import org.apache.camel.impl.DefaultExchange;
-import org.apache.camel.impl.DefaultMessage;
import org.apache.cxf.message.Exchange;
import org.apache.cxf.message.Message;
import org.apache.cxf.transport.Conduit;
Modified: activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfMessageObserver.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfMessageObserver.java?rev=628430&r1=628429&r2=628430&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfMessageObserver.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfMessageObserver.java Sat Feb 16 21:31:05 2008
@@ -21,7 +21,6 @@
import org.apache.camel.component.cxf.invoker.InvokingContext;
import org.apache.camel.component.cxf.invoker.InvokingContextFactory;
-
import org.apache.cxf.Bus;
import org.apache.cxf.endpoint.Endpoint;
import org.apache.cxf.endpoint.EndpointImpl;
@@ -36,8 +35,8 @@
private CxfConsumer cxfConsumer;
private DataFormat dataFormat;
private CamelInvoker invoker;
-
-
+
+
public CxfMessageObserver(CxfConsumer consumer, Endpoint endpoint, Bus bus,
DataFormat dataFormat) {
super(endpoint, bus);
@@ -47,14 +46,14 @@
}
protected void setExchangeProperties(Exchange exchange, Message m) {
- super.setExchangeProperties(exchange, m);
+ super.setExchangeProperties(exchange, m);
exchange.put(CxfConsumer.class, cxfConsumer);
exchange.put(Bus.class, bus);
exchange.put(Endpoint.class, endpoint);
exchange.put(InvokingContext.class, InvokingContextFactory.createContext(dataFormat));
exchange.put(CamelInvoker.class, invoker);
}
-
+
public void onMessage(Message m) {
if (LOG.isLoggable(Level.FINER)) {
LOG.fine("Observed Client request at router's endpoint. Request message: " + m);
@@ -67,11 +66,11 @@
exchange.setInMessage(message);
}
setExchangeProperties(exchange, message);
-
+
InvokingContext invokingContext = exchange.get(InvokingContext.class);
assert invokingContext != null;
invokingContext.setEndpointFaultObservers((EndpointImpl)endpoint, bus);
-
+
if (LOG.isLoggable(Level.FINEST)) {
LOG.finest("Build inbound interceptor chain and inject routing interceptor");
}
@@ -80,6 +79,6 @@
message.setInterceptorChain(chain);
chain.setFaultObserver(endpoint.getOutFaultObserver());
- chain.doIntercept(message);
+ chain.doIntercept(message);
}
}
Modified: activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java?rev=628430&r1=628429&r2=628430&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java Sat Feb 16 21:31:05 2008
@@ -19,9 +19,10 @@
import java.util.ArrayList;
import java.util.List;
+import javax.xml.namespace.QName;
+
import org.apache.camel.CamelException;
import org.apache.camel.Exchange;
-import org.apache.camel.ExchangePattern;
import org.apache.camel.RuntimeCamelException;
import org.apache.camel.component.cxf.invoker.CxfClient;
import org.apache.camel.component.cxf.invoker.CxfClientFactoryBean;
@@ -33,9 +34,6 @@
import org.apache.camel.util.ObjectHelper;
import org.apache.cxf.Bus;
import org.apache.cxf.BusFactory;
-import org.apache.cxf.binding.Binding;
-import org.apache.cxf.binding.BindingFactory;
-import org.apache.cxf.binding.BindingFactoryManager;
import org.apache.cxf.common.classloader.ClassLoaderUtils;
import org.apache.cxf.endpoint.Client;
import org.apache.cxf.endpoint.Endpoint;
@@ -44,12 +42,6 @@
import org.apache.cxf.message.Message;
import org.apache.cxf.message.MessageImpl;
import org.apache.cxf.service.model.BindingOperationInfo;
-import org.apache.cxf.transport.Conduit;
-
-import java.io.InputStream;
-import java.net.MalformedURLException;
-
-import javax.xml.namespace.QName;
/**
* Sends messages from Camel into the CXF endpoint
Modified: activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSoapBinding.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSoapBinding.java?rev=628430&r1=628429&r2=628430&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSoapBinding.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSoapBinding.java Sat Feb 16 21:31:05 2008
@@ -16,22 +16,11 @@
*/
package org.apache.camel.component.cxf;
-import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
import java.io.InputStream;
-import java.nio.CharBuffer;
-import java.util.List;
-import java.util.Map;
import javax.xml.transform.Source;
-import org.apache.camel.Exchange;
-import org.apache.cxf.helpers.IOUtils;
-import org.apache.cxf.interceptor.Fault;
-import org.apache.cxf.io.CachedOutputStream;
import org.apache.cxf.message.ExchangeImpl;
-import org.apache.cxf.message.Message;
import org.apache.cxf.message.MessageImpl;
public class CxfSoapBinding {
@@ -55,7 +44,7 @@
exchange.setProperty(CxfConstants.CXF_EXCHANGE, cxfExchange);
}
Object body = message.getBody(InputStream.class);
-
+
if (body == null) {
body = message.getBody();
}
Modified: activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSoapComponent.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSoapComponent.java?rev=628430&r1=628429&r2=628430&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSoapComponent.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSoapComponent.java Sat Feb 16 21:31:05 2008
@@ -16,14 +16,14 @@
*/
package org.apache.camel.component.cxf;
+import java.util.Map;
+
import org.apache.camel.Endpoint;
import org.apache.camel.impl.DefaultComponent;
import org.apache.camel.util.CamelContextHelper;
import org.apache.camel.util.IntrospectionSupport;
import org.apache.camel.util.URISupport;
-import java.util.Map;
-
/**
* Defines the <a href="http://activemq.apache.org/camel/cxf.html">SOAP Component</a>
@@ -44,7 +44,7 @@
soapEndpoint.init();
return soapEndpoint;
}
-
+
@Override
protected boolean useIntrospectionOnEndpoint() {
return false;
Modified: activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSoapConsumer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSoapConsumer.java?rev=628430&r1=628429&r2=628430&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSoapConsumer.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSoapConsumer.java Sat Feb 16 21:31:05 2008
@@ -16,42 +16,25 @@
*/
package org.apache.camel.component.cxf;
-import java.io.InputStream;
import java.io.OutputStream;
-import javax.xml.namespace.QName;
import javax.xml.transform.Source;
-import org.apache.camel.CamelException;
import org.apache.camel.Consumer;
-import org.apache.camel.Processor;
import org.apache.camel.Exchange;
-import org.apache.camel.component.cxf.util.NullConduit;
+import org.apache.camel.Processor;
import org.apache.camel.component.cxf.util.CxfEndpointUtils;
+import org.apache.camel.component.cxf.util.NullConduit;
import org.apache.camel.component.cxf.util.NullDestinationFactory;
-import org.apache.cxf.endpoint.EndpointImpl;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.cxf.Bus;
import org.apache.cxf.endpoint.Server;
-import org.apache.cxf.endpoint.ServerImpl;
import org.apache.cxf.frontend.ServerFactoryBean;
-import org.apache.cxf.transport.Conduit;
-import org.apache.cxf.transport.MessageObserver;
-import org.apache.cxf.transport.ChainInitiationObserver;
-import org.apache.cxf.wsdl11.WSDLServiceFactory;
-import org.apache.cxf.service.Service;
-import org.apache.cxf.service.model.EndpointInfo;
-import org.apache.cxf.Bus;
-import org.apache.cxf.interceptor.AttachmentInInterceptor;
import org.apache.cxf.interceptor.InterceptorChain;
import org.apache.cxf.interceptor.OutgoingChainInterceptor;
-import org.apache.cxf.interceptor.StaxInInterceptor;
import org.apache.cxf.io.CachedOutputStream;
-import org.apache.cxf.message.ExchangeImpl;
-import org.apache.cxf.message.MessageImpl;
-import org.apache.cxf.binding.AbstractBindingFactory;
-import org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor;
-import org.apache.cxf.binding.soap.interceptor.MustUnderstandInterceptor;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.apache.cxf.transport.MessageObserver;
/**
* A CXF based soap consumer.
@@ -63,8 +46,8 @@
private static final Log LOG = LogFactory.getLog(CxfSoapConsumer.class);
private final CxfSoapEndpoint endpoint;
- private final Consumer consumer;
- private MessageObserver inMessageObserver;
+ private final Consumer consumer;
+ private MessageObserver inMessageObserver;
private Server server;
public CxfSoapConsumer(CxfSoapEndpoint endpoint, Processor processor) throws Exception {
@@ -83,7 +66,7 @@
this.consumer = endpoint.getInnerEndpoint().createConsumer(soapProcessor);
Class sei = CxfEndpointUtils.getSEIClass(endpoint.getServiceClass());
ServerFactoryBean sfb = CxfEndpointUtils.getServerFactoryBean(sei);
- sfb.setWsdlURL(endpoint.getWsdl().getURL().toString());
+ sfb.setWsdlURL(endpoint.getWsdl().getURL().toString());
if (endpoint.getServiceName() != null) {
sfb.setServiceName(endpoint.getServiceName());
}
@@ -93,16 +76,16 @@
// we do not need use the destination here
sfb.setDestinationFactory(new NullDestinationFactory());
sfb.setStart(false);
-
+
server = sfb.create();
}
-
-
+
+
public void start() throws Exception {
server.start();
inMessageObserver = server.getDestination().getMessageObserver();
consumer.start();
-
+
}
public void stop() throws Exception {
@@ -115,32 +98,32 @@
}
protected void processSoapConsumerIn(Exchange exchange) throws Exception {
- LOG.info("processSoapConsumerIn: " + exchange);
+ LOG.info("processSoapConsumerIn: " + exchange);
org.apache.cxf.message.Message inMessage = CxfSoapBinding.getCxfInMessage(exchange, false);
org.apache.cxf.message.Exchange cxfExchange = inMessage.getExchange();
cxfExchange.put(org.apache.cxf.endpoint.Endpoint.class, server.getEndpoint());
cxfExchange.put(Bus.class, getBus());
- cxfExchange.setConduit(new NullConduit());
+ cxfExchange.setConduit(new NullConduit());
// get the message input stream, deal with the exchange in message
- inMessageObserver.onMessage(inMessage);
+ inMessageObserver.onMessage(inMessage);
exchange.getIn().setBody(inMessage.getContent(Source.class));
//TODO copy the right header information
exchange.getIn().setHeaders(inMessage);
-
+
}
protected void processSoapConsumerOut(Exchange exchange) throws Exception {
LOG.info("processSoapConsumerOut: " + exchange);
-
+
// TODO check if the message is oneway message
// Get the method name form the soap endpoint
org.apache.cxf.message.Message outMessage = CxfSoapBinding.getCxfOutMessage(exchange, false);
org.apache.cxf.message.Exchange cxfExchange = outMessage.getExchange();
InterceptorChain chain = OutgoingChainInterceptor.getOutInterceptorChain(cxfExchange);
- outMessage.setInterceptorChain(chain);
+ outMessage.setInterceptorChain(chain);
chain.doIntercept(outMessage);
- CachedOutputStream outputStream = (CachedOutputStream)outMessage.getContent(OutputStream.class);
- exchange.getOut().setBody(outputStream.getInputStream());
+ CachedOutputStream outputStream = (CachedOutputStream)outMessage.getContent(OutputStream.class);
+ exchange.getOut().setBody(outputStream.getInputStream());
}
}
Modified: activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSoapEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSoapEndpoint.java?rev=628430&r1=628429&r2=628430&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSoapEndpoint.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSoapEndpoint.java Sat Feb 16 21:31:05 2008
@@ -18,18 +18,25 @@
import java.util.Map;
-import org.apache.camel.*;
+import javax.wsdl.Definition;
+import javax.wsdl.factory.WSDLFactory;
+import javax.wsdl.xml.WSDLReader;
+import javax.xml.namespace.QName;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.Consumer;
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+import org.apache.camel.ExchangePattern;
+import org.apache.camel.PollingConsumer;
+import org.apache.camel.Processor;
+import org.apache.camel.Producer;
import org.apache.cxf.Bus;
import org.apache.cxf.BusFactory;
import org.apache.cxf.helpers.DOMUtils;
import org.springframework.core.io.Resource;
import org.springframework.util.Assert;
-import javax.wsdl.Definition;
-import javax.wsdl.xml.WSDLReader;
-import javax.wsdl.factory.WSDLFactory;
-import javax.xml.namespace.QName;
-
/**
* A CXF based SOAP endpoint which wraps an existing
* endpoint with SOAP processing.
@@ -44,7 +51,7 @@
private QName serviceName;
private QName endpointName;
private Bus bus;
-
+
public CxfSoapEndpoint(Endpoint endpoint) {
this.endpoint = endpoint;
@@ -100,27 +107,27 @@
public void setWsdl(Resource wsdl) {
this.wsdl = wsdl;
}
-
+
public void setServiceClass(String serviceClass) {
this.serviceClass = serviceClass;
}
-
+
public String getServiceClass() {
return serviceClass;
}
-
+
public void setServiceName(String serviceName) {
this.serviceName = QName.valueOf(serviceName);
}
-
+
public void setEndpointName(String endpointName) {
this.endpointName = QName.valueOf(endpointName);
}
-
+
public QName getEndpointName() {
return endpointName;
}
-
+
public void init() throws Exception {
Assert.notNull(wsdl, "soap.wsdl parameter must be set on the uri");
if (serviceName == null) {
@@ -130,7 +137,7 @@
reader.setFeature("javax.wsdl.verbose", false);
definition = reader.readWSDL(wsdl.getURL().toString(), description);
serviceName = (QName) definition.getServices().keySet().iterator().next();
- }
+ }
}
protected Bus getBus() {
Modified: activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSoapProducer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSoapProducer.java?rev=628430&r1=628429&r2=628430&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSoapProducer.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSoapProducer.java Sat Feb 16 21:31:05 2008
@@ -19,9 +19,13 @@
import java.io.OutputStream;
import javax.xml.transform.Source;
-import javax.xml.transform.dom.DOMSource;
-import org.apache.camel.*;
+import org.apache.camel.AsyncCallback;
+import org.apache.camel.AsyncProcessor;
+import org.apache.camel.Exchange;
+import org.apache.camel.ExchangePattern;
+import org.apache.camel.Processor;
+import org.apache.camel.Producer;
import org.apache.camel.component.cxf.util.CxfEndpointUtils;
import org.apache.camel.component.cxf.util.Dummy;
import org.apache.camel.component.cxf.util.NullConduit;
@@ -30,17 +34,13 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.cxf.Bus;
-import org.apache.cxf.endpoint.Client;
import org.apache.cxf.endpoint.ClientImpl;
import org.apache.cxf.frontend.ClientFactoryBean;
-import org.apache.cxf.frontend.ServerFactoryBean;
-import org.apache.cxf.helpers.XMLUtils;
import org.apache.cxf.interceptor.InterceptorChain;
import org.apache.cxf.interceptor.OutgoingChainInterceptor;
import org.apache.cxf.io.CachedOutputStream;
import org.apache.cxf.message.ExchangeImpl;
import org.apache.cxf.message.Message;
-import org.apache.cxf.phase.PhaseInterceptorChain;
/**
* A CXF based soap provider.
@@ -55,7 +55,7 @@
private final Producer producer;
private final AsyncProcessor processor;
private ClientImpl client;
-
+
public CxfSoapProducer(CxfSoapEndpoint endpoint) throws Exception {
this.endpoint = endpoint;
@@ -71,7 +71,7 @@
processSoapProviderOut(exchange);
}
});
-
+
//create the endpoint and setup the intercepters
Class sei = CxfEndpointUtils.getSEIClass(endpoint.getServiceClass());
ClientFactoryBean cfb = CxfEndpointUtils.getClientFactoryBean(sei);
@@ -80,7 +80,7 @@
} else {
cfb.setServiceClass(sei);
}
- cfb.setWsdlURL(endpoint.getWsdl().getURL().toString());
+ cfb.setWsdlURL(endpoint.getWsdl().getURL().toString());
if (endpoint.getServiceName() != null) {
cfb.setServiceName(endpoint.getServiceName());
}
@@ -89,7 +89,7 @@
}
cfb.setConduitSelector(new NullConduitSelector());
client = (ClientImpl) cfb.create();
-
+
}
public org.apache.camel.Endpoint getEndpoint() {
@@ -126,34 +126,34 @@
protected void processSoapProviderOut(Exchange exchange) throws Exception {
LOG.info("processSoapProviderOut: " + exchange);
-
+
org.apache.cxf.message.Message inMessage = CxfSoapBinding.getCxfInMessage(exchange, true);
client.setInInterceptors(client.getEndpoint().getService().getInInterceptors());
client.onMessage(inMessage);
-
+
exchange.getOut().setBody(inMessage.getContent(Source.class));
-
+
exchange.getOut().setHeaders(inMessage);
}
-
+
protected Bus getBus() {
return endpoint.getBus();
}
protected void processSoapProviderIn(Exchange exchange) throws Exception {
LOG.info("processSoapProviderIn: " + exchange);
- org.apache.cxf.endpoint.Endpoint cxfEndpoint = client.getEndpoint();
- org.apache.cxf.message.Exchange cxfExchange = new ExchangeImpl();
+ org.apache.cxf.endpoint.Endpoint cxfEndpoint = client.getEndpoint();
+ org.apache.cxf.message.Exchange cxfExchange = new ExchangeImpl();
cxfExchange.put(org.apache.cxf.endpoint.Endpoint.class, cxfEndpoint);
cxfExchange.put(Bus.class, getBus());
cxfExchange.setConduit(new NullConduit());
- exchange.setProperty(CxfConstants.CXF_EXCHANGE, cxfExchange);
+ exchange.setProperty(CxfConstants.CXF_EXCHANGE, cxfExchange);
org.apache.cxf.message.Message outMessage = CxfSoapBinding.getCxfOutMessage(exchange, true);
outMessage.put(Message.REQUESTOR_ROLE, Boolean.TRUE);
outMessage.put(Message.INBOUND_MESSAGE, Boolean.FALSE);
InterceptorChain chain = OutgoingChainInterceptor.getOutInterceptorChain(cxfExchange);
outMessage.setInterceptorChain(chain);
-
+
chain.doIntercept(outMessage);
CachedOutputStream outputStream = (CachedOutputStream)outMessage.getContent(OutputStream.class);
exchange.getOut().setBody(outputStream.getInputStream());
Modified: activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/MessageInvoker.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/MessageInvoker.java?rev=628430&r1=628429&r2=628430&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/MessageInvoker.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/MessageInvoker.java Sat Feb 16 21:31:05 2008
@@ -18,7 +18,6 @@
package org.apache.camel.component.cxf;
import org.apache.cxf.message.Exchange;
-import org.apache.cxf.message.Message;
/**
* The interface to provide a CXF message invoke method
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=628430&r1=628429&r2=628430&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 Sat Feb 16 21:31:05 2008
@@ -17,7 +17,6 @@
package org.apache.camel.component.cxf.feature;
-import java.util.List;
import java.util.logging.Logger;
import org.apache.camel.component.cxf.interceptors.DOMInInterceptor;
@@ -28,13 +27,7 @@
import org.apache.cxf.common.logging.LogUtils;
import org.apache.cxf.endpoint.Client;
import org.apache.cxf.endpoint.Server;
-import org.apache.cxf.feature.AbstractFeature;
-import org.apache.cxf.interceptor.BareInInterceptor;
-import org.apache.cxf.interceptor.DocLiteralInInterceptor;
-import org.apache.cxf.interceptor.Interceptor;
-import org.apache.cxf.interceptor.WrappedInInterceptor;
import org.apache.cxf.phase.Phase;
-import org.apache.cxf.phase.PhaseInterceptor;
/**
* This feature just setting up the CXF endpoint interceptor for handling the
Modified: activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CXFGreeterRouterTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CXFGreeterRouterTest.java?rev=628430&r1=628429&r2=628430&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CXFGreeterRouterTest.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CXFGreeterRouterTest.java Sat Feb 16 21:31:05 2008
@@ -26,7 +26,6 @@
import org.apache.camel.spring.processor.SpringTestHelper;
import org.apache.hello_world_soap_http.Greeter;
import org.apache.hello_world_soap_http.GreeterImpl;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
public class CXFGreeterRouterTest extends CxfSpringRouterTest {
private final QName serviceName = new QName("http://apache.org/hello_world_soap_http",
Modified: activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfEndpointTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfEndpointTest.java?rev=628430&r1=628429&r2=628430&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfEndpointTest.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfEndpointTest.java Sat Feb 16 21:31:05 2008
@@ -17,26 +17,26 @@
package org.apache.camel.component.cxf;
+import junit.framework.TestCase;
import org.apache.camel.CamelContext;
import org.apache.camel.spring.SpringCamelContext;
import org.apache.cxf.frontend.ServerFactoryBean;
import org.springframework.context.support.ClassPathXmlApplicationContext;
-import junit.framework.TestCase;
public class CxfEndpointTest extends TestCase {
-
+
public void testSpringCxfEndpoint() throws Exception {
- ClassPathXmlApplicationContext ctx =
+ ClassPathXmlApplicationContext ctx =
new ClassPathXmlApplicationContext(new String[]{"org/apache/camel/component/cxf/spring/CxfEndpointBeans.xml"});
CamelContext camelContext = new SpringCamelContext(ctx);
CxfComponent cxfComponent = new CxfComponent(camelContext);
CxfEndpoint endpoint = (CxfEndpoint)cxfComponent.createEndpoint("cxf://bean:serviceEndpoint");
-
+
assertTrue("The endpoint should be the spring context endpoint", endpoint.isSpringContextEndpoint());
ServerFactoryBean svf = new ServerFactoryBean();
endpoint.configure(svf);
assertEquals("Got the wrong endpoint address", svf.getAddress(), "http://localhost:9002/helloworld");
- assertEquals("Got the wrong endpont service class",
+ assertEquals("Got the wrong endpont service class",
svf.getServiceClass().getCanonicalName(),
"org.apache.camel.component.cxf.HelloService");
}
Modified: activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfGreeterMessageRouterTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfGreeterMessageRouterTest.java?rev=628430&r1=628429&r2=628430&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfGreeterMessageRouterTest.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfGreeterMessageRouterTest.java Sat Feb 16 21:31:05 2008
@@ -21,7 +21,6 @@
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.spring.SpringCamelContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
-import junit.framework.TestCase;
/**
* The Greeter test with the MESSAGE date format
Modified: activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfGreeterPayLoadRouterTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfGreeterPayLoadRouterTest.java?rev=628430&r1=628429&r2=628430&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfGreeterPayLoadRouterTest.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfGreeterPayLoadRouterTest.java Sat Feb 16 21:31:05 2008
@@ -20,7 +20,6 @@
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.spring.SpringCamelContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
-import junit.framework.TestCase;
/**
* The Greeter test with the PAYLOAD date format
Modified: activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfProducerRouterTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfProducerRouterTest.java?rev=628430&r1=628429&r2=628430&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfProducerRouterTest.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfProducerRouterTest.java Sat Feb 16 21:31:05 2008
@@ -3,12 +3,9 @@
import java.util.ArrayList;
import java.util.List;
-import javax.xml.ws.Endpoint;
-
import org.apache.camel.ContextTestSupport;
import org.apache.camel.Exchange;
import org.apache.camel.ExchangePattern;
-import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.impl.DefaultExchange;
import org.apache.commons.logging.Log;
@@ -16,7 +13,6 @@
import org.apache.cxf.bus.CXFBusFactory;
import org.apache.cxf.endpoint.ServerImpl;
import org.apache.cxf.frontend.ServerFactoryBean;
-import org.apache.hello_world_soap_http.GreeterImpl;
public class CxfProducerRouterTest extends ContextTestSupport {
private static final transient Log LOG = LogFactory.getLog(CxfProducerRouterTest.class);
Modified: activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfProducerTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfProducerTest.java?rev=628430&r1=628429&r2=628430&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfProducerTest.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfProducerTest.java Sat Feb 16 21:31:05 2008
@@ -22,7 +22,6 @@
import javax.xml.ws.Endpoint;
import junit.framework.TestCase;
-
import org.apache.camel.CamelContext;
import org.apache.camel.CamelTemplate;
import org.apache.camel.Exchange;
@@ -33,7 +32,6 @@
import org.apache.cxf.bus.CXFBusFactory;
import org.apache.cxf.endpoint.ServerImpl;
import org.apache.cxf.frontend.ServerFactoryBean;
-import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
import org.apache.hello_world_soap_http.GreeterImpl;
/**
@@ -64,10 +62,10 @@
simpleServer = (ServerImpl)svrBean.create();
simpleServer.start();
-
+
GreeterImpl greeterImpl = new GreeterImpl();
jaxwsEndpoint = Endpoint.publish(JAXWS_SERVER_ADDRESS, greeterImpl);
-
+
}
@Override
@@ -80,47 +78,47 @@
}
}
- public void testInvokingSimpleServerWithParams() throws Exception {
+ public void testInvokingSimpleServerWithParams() throws Exception {
CxfExchange exchange = (CxfExchange)template.send(getSimpleEndpointUri(), new Processor() {
public void process(final Exchange exchange) {
- final List<String> params = new ArrayList<String>();
+ final List<String> params = new ArrayList<String>();
params.add(TEST_MESSAGE);
exchange.getIn().setBody(params);
exchange.getIn().setHeader(CxfConstants.OPERATION_NAME, ECHO_OPERATION);
}
});
-
+
org.apache.camel.Message out = exchange.getOut();
Object[] output = (Object[])out.getBody();
LOG.info("Received output text: " + output[0]);
assertEquals("reply body on Camel", "echo " + TEST_MESSAGE, output[0]);
}
-
-
+
+
public void testInvokingJawsServerWithParams() throws Exception {
CxfExchange exchange = (CxfExchange)template.send(getJaxwsEndpointUri(), new Processor() {
public void process(final Exchange exchange) {
- final List<String> params = new ArrayList<String>();
+ final List<String> params = new ArrayList<String>();
params.add(TEST_MESSAGE);
exchange.getIn().setBody(params);
exchange.getIn().setHeader(CxfConstants.OPERATION_NAME, GREET_ME_OPERATION);
}
});
-
+
org.apache.camel.Message out = exchange.getOut();
Object[] output = (Object[])out.getBody();
LOG.info("Received output text: " + output[0]);
assertEquals("reply body on Camel", "Hello " + TEST_MESSAGE, output[0]);
}
-
+
private String getSimpleEndpointUri() {
return "cxf://" + SIMPLE_SERVER_ADDRESS
+ "?serviceClass=org.apache.camel.component.cxf.HelloService";
}
-
+
private String getJaxwsEndpointUri() {
return "cxf://" + JAXWS_SERVER_ADDRESS + "?serviceClass=org.apache.hello_world_soap_http.Greeter";
-
+
}
}
Modified: activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfRouterTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfRouterTest.java?rev=628430&r1=628429&r2=628430&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfRouterTest.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfRouterTest.java Sat Feb 16 21:31:05 2008
@@ -26,7 +26,6 @@
import org.apache.cxf.frontend.ClientFactoryBean;
import org.apache.cxf.frontend.ClientProxyFactoryBean;
import org.apache.cxf.frontend.ServerFactoryBean;
-import org.apache.cxf.test.TestUtilities;
public class CxfRouterTest extends ContextTestSupport {
Modified: activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfSoapBindingTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfSoapBindingTest.java?rev=628430&r1=628429&r2=628430&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfSoapBindingTest.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfSoapBindingTest.java Sat Feb 16 21:31:05 2008
@@ -4,18 +4,17 @@
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
-import java.net.URISyntaxException;
import java.net.URL;
import javax.xml.stream.XMLStreamReader;
import javax.xml.transform.dom.DOMSource;
+import junit.framework.TestCase;
import org.apache.camel.impl.DefaultCamelContext;
import org.apache.camel.impl.DefaultExchange;
import org.apache.commons.io.IOUtils;
import org.apache.cxf.io.CachedOutputStream;
import org.apache.cxf.staxutils.StaxUtils;
-import junit.framework.TestCase;
public class CxfSoapBindingTest extends TestCase {
private DefaultCamelContext context = new DefaultCamelContext();
Modified: activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfSoapMessageProviderTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfSoapMessageProviderTest.java?rev=628430&r1=628429&r2=628430&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfSoapMessageProviderTest.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfSoapMessageProviderTest.java Sat Feb 16 21:31:05 2008
@@ -24,7 +24,6 @@
import org.apache.camel.CamelContext;
import org.apache.camel.ContextTestSupport;
import org.apache.camel.spring.processor.SpringTestHelper;
-
import org.apache.hello_world_soap_http.Greeter;
import org.apache.hello_world_soap_http.SOAPService;
Modified: activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfSoapTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfSoapTest.java?rev=628430&r1=628429&r2=628430&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfSoapTest.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfSoapTest.java Sat Feb 16 21:31:05 2008
@@ -16,18 +16,15 @@
*/
package org.apache.camel.component.cxf;
-import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
-import java.net.URI;
import java.net.URL;
import javax.xml.stream.XMLStreamReader;
import javax.xml.transform.Source;
import javax.xml.transform.dom.DOMSource;
-import org.apache.camel.CamelTemplate;
import org.apache.camel.ContextTestSupport;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
@@ -39,8 +36,8 @@
import org.apache.cxf.staxutils.StaxUtils;
public class CxfSoapTest extends ContextTestSupport {
- private static final String SOAP_STRING =
- "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">"
+ private static final String SOAP_STRING =
+ "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">"
+ "<soap:Body><testMethod xmlns=\"http://camel.apache.org/testService\" />"
+ "</soap:Body></soap:Envelope>";
@@ -49,8 +46,8 @@
public void configure() {
//from("soap:direct:consumer?soap.wsdl=classpath:hello/HelloWorld-DOC.wsdl").to("mock:consumer");
from("soap:direct:consumer?soap.wsdl=classpath:hello/HelloWorld-DOC.wsdl").to("mock:consumer").process(new Processor() {
- public void process(Exchange e) {
- Object result = e.getIn().getBody();
+ public void process(Exchange e) {
+ Object result = e.getIn().getBody();
e.getOut().setBody(result);
}
});
@@ -59,39 +56,39 @@
};
}
- public void testSoapConsumer() throws Exception {
+ public void testSoapConsumer() throws Exception {
// send out the request message
URL request = this.getClass().getResource("SoapRequest.xml");
File requestFile = new File(request.toURI());
- FileInputStream inputStream = new FileInputStream(requestFile);
+ FileInputStream inputStream = new FileInputStream(requestFile);
Object result = template.sendBody("direct:consumer", inputStream);
assertFalse("The result should not be changed", inputStream.equals(result));
assertTrue("result should be a inputstream", result instanceof InputStream);
CachedOutputStream bos = new CachedOutputStream();
IOUtils.copy((InputStream) result, bos);
bos.flush();
- ((InputStream)result).close();
- assertEquals("We should find the soap body string here",
+ ((InputStream)result).close();
+ assertEquals("We should find the soap body string here",
SOAP_STRING, bos.getOut().toString());
-
-
+
+
}
-
+
public void testSoapProducer() throws Exception {
// set out the source message
URL request = this.getClass().getResource("RequestBody.xml");
File requestFile = new File(request.toURI());
- FileInputStream inputStream = new FileInputStream(requestFile);
+ FileInputStream inputStream = new FileInputStream(requestFile);
XMLStreamReader xmlReader = StaxUtils.createXMLStreamReader(inputStream);
- DOMSource source = new DOMSource(StaxUtils.read(xmlReader));
+ DOMSource source = new DOMSource(StaxUtils.read(xmlReader));
MockEndpoint endpoint = getMockEndpoint("mock:producer");
endpoint.expectedMessageCount(1);
- Object result = template.sendBody("direct:producer", source);
-
+ Object result = template.sendBody("direct:producer", source);
+
assertMockEndpointsSatisifed();
assertFalse("The result should not be changed", source.equals(result));
assertTrue("The result should be the instance of DOMSource", result instanceof DOMSource);
assertEquals("The DOMSource should be equal", XMLUtils.toString(source), XMLUtils.toString((Source)result));
-
+
}
}
Modified: activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfSpringRouterTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfSpringRouterTest.java?rev=628430&r1=628429&r2=628430&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfSpringRouterTest.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfSpringRouterTest.java Sat Feb 16 21:31:05 2008
@@ -17,15 +17,11 @@
package org.apache.camel.component.cxf;
-import org.springframework.context.support.AbstractXmlApplicationContext;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.apache.camel.CamelContext;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.spring.SpringCamelContext;
-import org.apache.camel.spring.SpringTestSupport;
-import org.apache.cxf.bus.CXFBusFactory;
-import org.apache.cxf.endpoint.ServerImpl;
-import org.apache.cxf.frontend.ServerFactoryBean;
+import org.springframework.context.support.AbstractXmlApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
public class CxfSpringRouterTest extends CxfRouterTest {
protected AbstractXmlApplicationContext applicationContext;
Modified: activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/SoapTargetBean.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/SoapTargetBean.java?rev=628430&r1=628429&r2=628430&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/SoapTargetBean.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/SoapTargetBean.java Sat Feb 16 21:31:05 2008
@@ -20,7 +20,6 @@
import javax.xml.namespace.QName;
import javax.xml.soap.MessageFactory;
-
import javax.xml.soap.SOAPBody;
import javax.xml.soap.SOAPMessage;