Author: ningjiang
Date: Wed Sep 23 04:46:49 2009
New Revision: 817961
URL: http://svn.apache.org/viewvc?rev=817961&view=rev
Log:
Polished the comments on CamelJBIClientProxyTest, also fixed a CS error of
camel-jpa
Modified:
camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/transport/CamelJBIClientProxyTest.java
camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/transport/JbiServiceProcessor.java
camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaIdempotentConsumerTest.java
Modified:
camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/transport/CamelJBIClientProxyTest.java
URL:
http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/transport/CamelJBIClientProxyTest.java?rev=817961&r1=817960&r2=817961&view=diff
==============================================================================
---
camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/transport/CamelJBIClientProxyTest.java
(original)
+++
camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/transport/CamelJBIClientProxyTest.java
Wed Sep 23 04:46:49 2009
@@ -40,8 +40,10 @@
assertNotNull("The proxy should not be null.", proxy);
}
+
@Test
public void testCallFromProxy() {
+ // The echo parameter will be ignore, since the service has the fix
response
String response = proxy.echo("Hello World!");
assertEquals("Get a wrong response ", "echo Hello World!", response);
}
@@ -51,7 +53,8 @@
// get camel context
CamelContext context = (CamelContext)
applicationContext.getBean("conduit_context");
ProducerTemplate producer = context.createProducerTemplate();
- String response = producer.requestBody("direct://jbiStart", "Hello",
String.class);
+ // The echo parameter will be ignore, since the service has the fix
response
+ String response = producer.requestBody("direct://jbiStart", "Hello
World!", String.class);
assertEquals("Get a wrong response ", "echo Hello World!", response);
}
Modified:
camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/transport/JbiServiceProcessor.java
URL:
http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/transport/JbiServiceProcessor.java?rev=817961&r1=817960&r2=817961&view=diff
==============================================================================
---
camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/transport/JbiServiceProcessor.java
(original)
+++
camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/transport/JbiServiceProcessor.java
Wed Sep 23 04:46:49 2009
@@ -17,6 +17,7 @@
package org.apache.camel.component.cxf.transport;
+import org.apache.camel.CamelException;
import org.apache.camel.Exchange;
import org.apache.camel.Message;
import org.apache.camel.Processor;
@@ -31,12 +32,16 @@
+ " xmlns:msg=\"http://cxf.component.camel.apache.org\"
type=\"msg:echoResponse\"><jbi:part>"
+ "<ns1:return
xmlns:ns1=\"http://cxf.component.camel.apache.org\">echo Hello
World!</ns1:return>"
+ "</jbi:part></jbi:message>";
+ private static final String JBI_WRAPPER = "<jbi:message
xmlns:jbi=\"http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper";
public void process(Exchange exchange) throws Exception {
Message in = exchange.getIn();
- LOG.info("Get the request " + in.getBody(String.class));
-
+ String request = in.getBody(String.class);
+ LOG.info("Get the request " + request);
+ if (!request.startsWith(JBI_WRAPPER)) {
+ throw new CamelException("Get a wrong request");
+ }
exchange.getOut().setBody(ECHO_RESPONSE);
}
Modified:
camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaIdempotentConsumerTest.java
URL:
http://svn.apache.org/viewvc/camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaIdempotentConsumerTest.java?rev=817961&r1=817960&r2=817961&view=diff
==============================================================================
---
camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaIdempotentConsumerTest.java
(original)
+++
camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaIdempotentConsumerTest.java
Wed Sep 23 04:46:49 2009
@@ -16,9 +16,9 @@
*/
package org.apache.camel.processor.jpa;
+import java.util.HashSet;
import java.util.List;
import java.util.Set;
-import java.util.HashSet;
import org.apache.camel.CamelContext;
import org.apache.camel.Endpoint;
@@ -32,7 +32,6 @@
import org.apache.camel.test.junit4.CamelTestSupport;
import org.junit.Before;
import org.junit.Test;
-
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.orm.jpa.JpaTemplate;