You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by ge...@apache.org on 2013/10/18 15:03:01 UTC
svn commit: r1533436 - in /servicemix/components/trunk: ./
engines/servicemix-camel/src/main/java/org/apache/servicemix/camel/
engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/
Author: gertv
Date: Fri Oct 18 13:03:00 2013
New Revision: 1533436
URL: http://svn.apache.org/r1533436
Log:
SMXCOMP-975: Upgrade to Camel 2.12.1
Added:
servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOutCamelJMSFlowExceptionHandledTest.java
- copied, changed from r1523536, servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOutCamelJMSFlowExceptionTest.java
Modified:
servicemix/components/trunk/engines/servicemix-camel/src/main/java/org/apache/servicemix/camel/JbiComponent.java
servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/AsyncJbiMessagingTest.java
servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/CamelConcurrentProducerCreationTest.java
servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/CamelConsumerEndpointTest.java
servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiCamelAttachmentTest.java
servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiCamelExceptionsTest.java
servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiConvertExceptionsTest.java
servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiDlcForCamelRouteTest.java
servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiDynamicRecipientListTest.java
servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiEndpointAvailableInRouteTest.java
servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiEndpointWithMepSpecifiedTest.java
servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiExchangePropertiesPreservationTest.java
servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOnlyAsyncCamelTest.java
servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOnlyCamelErrorHandlingTest.java
servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOnlyPropertiesPipelineTest.java
servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOnlySecuritySubjectTest.java
servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOnlyTest.java
servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOnlyToCamelObjectTest.java
servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOnlyWithErrorHandledTrueSpringDSLTest.java
servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOnlyWithFaultHandledTrueSpringDSLTest.java
servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOptionalOutCamelTest.java
servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOutCamelErrorHandlingTest.java
servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOutCamelJMSFlowExceptionTest.java
servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOutPipelineTest.java
servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOutWithPojoTest.java
servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiNoCheckSerializationTest.java
servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiOperationCamelTest.java
servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiProducerTest.java
servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiSerializableMessageExchangeTest.java
servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiStrangeNamespaceHandlingTest.java
servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiStrictSerializationTest.java
servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiTestSupport.java
servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiToCamelCbrTest.java
servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiToCamelStreamSourceTest.java
servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiTryCatchExceptionTest.java
servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/MinaEndpointSpringDSLTest.java
servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/SendFromCamelToJbiAndBackToCamelTest.java
servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/SendFromCamelToJbiTest.java
servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/SendFromCamelToJbiThenRouteToAnotherJbiComponentTest.java
servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/SpringJbiTestSupport.java
servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/TestCamelRouter.java
servicemix/components/trunk/pom.xml
Modified: servicemix/components/trunk/engines/servicemix-camel/src/main/java/org/apache/servicemix/camel/JbiComponent.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/engines/servicemix-camel/src/main/java/org/apache/servicemix/camel/JbiComponent.java?rev=1533436&r1=1533435&r2=1533436&view=diff
==============================================================================
--- servicemix/components/trunk/engines/servicemix-camel/src/main/java/org/apache/servicemix/camel/JbiComponent.java (original)
+++ servicemix/components/trunk/engines/servicemix-camel/src/main/java/org/apache/servicemix/camel/JbiComponent.java Fri Oct 18 13:03:00 2013
@@ -22,7 +22,8 @@ import javax.xml.namespace.QName;
import org.apache.camel.*;
import org.apache.camel.impl.DefaultComponent;
-import org.apache.camel.processor.UnitOfWorkProcessor;
+import org.apache.camel.processor.UnitOfWorkProducer;
+import org.apache.camel.util.AsyncProcessorConverterHelper;
import org.apache.servicemix.common.util.URIResolver;
import org.apache.servicemix.id.IdGenerator;
@@ -166,7 +167,7 @@ public class JbiComponent extends Defaul
protected AsyncProcessor createCamelProcessor(Endpoint camelEndpoint) {
AsyncProcessor processor = null;
try {
- processor = new UnitOfWorkProcessor(camelEndpoint.createProducer());
+ processor = AsyncProcessorConverterHelper.convert(new UnitOfWorkProducer(camelEndpoint.createProducer()));
} catch (Exception e) {
throw new FailedToCreateProducerException(camelEndpoint, e);
}
Modified: servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/AsyncJbiMessagingTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/AsyncJbiMessagingTest.java?rev=1533436&r1=1533435&r2=1533436&view=diff
==============================================================================
--- servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/AsyncJbiMessagingTest.java (original)
+++ servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/AsyncJbiMessagingTest.java Fri Oct 18 13:03:00 2013
@@ -23,6 +23,7 @@ import org.apache.servicemix.executors.i
import org.apache.servicemix.jbi.container.ActivationSpec;
import org.apache.servicemix.jbi.container.JBIContainer;
import org.apache.servicemix.jbi.jaxp.StringSource;
+import org.junit.Test;
import javax.jbi.messaging.ExchangeStatus;
import javax.jbi.messaging.InOnly;
@@ -37,6 +38,7 @@ public class AsyncJbiMessagingTest exten
private static final String MESSAGE = "<just><a>test</a></just>";
+ @Test
public void testNoSyncMessagingDeadlock() throws Exception {
ServiceMixClient client = new DefaultServiceMixClient(jbiContainer);
InOnly exchange = client.createInOnlyExchange();
@@ -47,6 +49,7 @@ public class AsyncJbiMessagingTest exten
ExchangeStatus.DONE, exchange.getStatus());
}
+ @Test
public void testCallbackExchangesEmptyOnError() throws Exception {
// disable the exchange completed listener as it is unable to detect failed exchanges
disableExchangeCompletedListener();
Modified: servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/CamelConcurrentProducerCreationTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/CamelConcurrentProducerCreationTest.java?rev=1533436&r1=1533435&r2=1533436&view=diff
==============================================================================
--- servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/CamelConcurrentProducerCreationTest.java (original)
+++ servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/CamelConcurrentProducerCreationTest.java Fri Oct 18 13:03:00 2013
@@ -32,6 +32,7 @@ import org.apache.camel.component.mock.M
import org.apache.servicemix.jbi.container.ActivationSpec;
import org.apache.servicemix.jbi.container.JBIContainer;
import org.apache.servicemix.tck.mock.MockMessageExchange;
+import org.junit.Test;
/**
* Test cases to ensure multiple threads can safely create an use the {@link org.apache.camel.Producer}
@@ -41,6 +42,7 @@ public class CamelConcurrentProducerCrea
private static final int COUNT = 1000;
+ @Test
public void testConcurrentlyCreateProducers() throws Exception {
final MockEndpoint mock = getMockEndpoint("mock:test");
mock.setResultWaitTime(60000);
Modified: servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/CamelConsumerEndpointTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/CamelConsumerEndpointTest.java?rev=1533436&r1=1533435&r2=1533436&view=diff
==============================================================================
--- servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/CamelConsumerEndpointTest.java (original)
+++ servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/CamelConsumerEndpointTest.java Fri Oct 18 13:03:00 2013
@@ -22,12 +22,14 @@ import org.apache.camel.builder.RouteBui
import org.apache.servicemix.jbi.container.ActivationSpec;
import org.apache.servicemix.jbi.container.JBIContainer;
import org.apache.servicemix.tck.mock.MockMessageExchange;
+import org.junit.Test;
/**
* Test cases for {@link CamelConsumerEndpoint}
*/
public class CamelConsumerEndpointTest extends JbiTestSupport {
-
+
+ @Test
public void testInvalidMessageExchangeDoesNotThrowException() throws Exception {
// sending a message to start the producers and create the external endpoint
client.sendBody("direct:a", "<hello>world</hello>");
Modified: servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiCamelAttachmentTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiCamelAttachmentTest.java?rev=1533436&r1=1533435&r2=1533436&view=diff
==============================================================================
--- servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiCamelAttachmentTest.java (original)
+++ servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiCamelAttachmentTest.java Fri Oct 18 13:03:00 2013
@@ -32,6 +32,7 @@ import org.apache.camel.component.mock.M
import org.apache.camel.impl.DefaultExchange;
import org.apache.servicemix.jbi.container.ActivationSpec;
import org.apache.servicemix.jbi.jaxp.StringSource;
+import org.junit.Test;
/**
* Tests for attachment handling by servicemix-camel JBI component
@@ -41,6 +42,7 @@ public class JbiCamelAttachmentTest exte
private static final String ATTACHMENT_ID = "attach1";
private static final File TEST_FILE = new File("src/test/resources/attachment.png");
+ @Test
public void testPreserveAttachments() throws Exception {
Exchange exchange = new DefaultExchange(camelContext);
DataHandler attachment = new DataHandler(new FileDataSource(TEST_FILE));
@@ -61,7 +63,8 @@ public class JbiCamelAttachmentTest exte
fail("Expected a FileDataSource, but received a " + received.getIn().getAttachment(ATTACHMENT_ID).getDataSource().getClass());
}
}
-
+
+ @Test
public void testGetAttachmentsFromCamelProcessor() throws Exception {
InOut inout = getServicemixClient().createInOutExchange();
inout.setService(new QName("urn:test", "inout-service"));
Modified: servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiCamelExceptionsTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiCamelExceptionsTest.java?rev=1533436&r1=1533435&r2=1533436&view=diff
==============================================================================
--- servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiCamelExceptionsTest.java (original)
+++ servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiCamelExceptionsTest.java Fri Oct 18 13:03:00 2013
@@ -25,12 +25,14 @@ import org.apache.camel.builder.RouteBui
import org.apache.camel.StringSource;
import org.apache.servicemix.client.DefaultServiceMixClient;
import org.apache.servicemix.client.ServiceMixClient;
+import org.junit.Test;
/**
* Tests on conveying a simple exception thrown by a bean in the camel route
*/
public class JbiCamelExceptionsTest extends JbiCamelErrorHandlingTestSupport {
+ @Test
public void testInOnlyConveysException() throws Exception {
ServiceMixClient client = new DefaultServiceMixClient(jbiContainer);
InOnly exchange = client.createInOnlyExchange();
@@ -42,6 +44,7 @@ public class JbiCamelExceptionsTest exte
assertTrue("A NullPointerException was expected", exchange.getError() instanceof NullPointerException);
}
+ @Test
public void testInOutHandlingBusinessException() throws Exception {
ServiceMixClient client = new DefaultServiceMixClient(jbiContainer);
InOut exchange = client.createInOutExchange();
Modified: servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiConvertExceptionsTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiConvertExceptionsTest.java?rev=1533436&r1=1533435&r2=1533436&view=diff
==============================================================================
--- servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiConvertExceptionsTest.java (original)
+++ servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiConvertExceptionsTest.java Fri Oct 18 13:03:00 2013
@@ -27,6 +27,7 @@ import org.apache.camel.StringSource;
import org.apache.servicemix.client.DefaultServiceMixClient;
import org.apache.servicemix.client.ServiceMixClient;
import org.apache.servicemix.jbi.exception.FaultException;
+import org.junit.Test;
/**
* Test the convertExceptions=true flag (converts all exceptions to JBI FaultExceptions)
@@ -35,6 +36,7 @@ public class JbiConvertExceptionsTest ex
private static final String EXCEPTION = "This has completely gone wrong at runtime!";
+ @Test
public void testInOnlyConvertExceptions() throws Exception {
ServiceMixClient client = new DefaultServiceMixClient(jbiContainer);
InOut exchange = client.createInOutExchange();
Modified: servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiDlcForCamelRouteTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiDlcForCamelRouteTest.java?rev=1533436&r1=1533435&r2=1533436&view=diff
==============================================================================
--- servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiDlcForCamelRouteTest.java (original)
+++ servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiDlcForCamelRouteTest.java Fri Oct 18 13:03:00 2013
@@ -29,6 +29,7 @@ import org.apache.camel.builder.RouteBui
import org.apache.camel.StringSource;
import org.apache.servicemix.jbi.container.ActivationSpec;
import org.apache.servicemix.tck.ReceiverComponent;
+import org.junit.Test;
/**
* Tests on a JBI DLC endpoint handling an error in the Camel route
@@ -37,6 +38,7 @@ public class JbiDlcForCamelRouteTest ext
private static final String MESSAGE = "<just><a>test</a></just>";
+ @Test
public void testErrorHandlingByJbiEndpointInCamelRoute() throws Exception {
InOnly exchange = getServicemixClient().createInOnlyExchange();
exchange.setService(new QName("urn:test", "exception"));
Modified: servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiDynamicRecipientListTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiDynamicRecipientListTest.java?rev=1533436&r1=1533435&r2=1533436&view=diff
==============================================================================
--- servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiDynamicRecipientListTest.java (original)
+++ servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiDynamicRecipientListTest.java Fri Oct 18 13:03:00 2013
@@ -30,12 +30,14 @@ import org.apache.camel.impl.JndiRegistr
import org.apache.camel.util.jndi.JndiContext;
import org.apache.servicemix.client.DefaultServiceMixClient;
import org.apache.servicemix.client.ServiceMixClient;
+import org.junit.Test;
/**
* Tests on using the Dynamic Recipient List pattern inside servicemix-camel
*/
public class JbiDynamicRecipientListTest extends JbiCamelErrorHandlingTestSupport {
+ @Test
public void testInOnlyDynamicRecipientListException() throws Exception {
MockEndpoint a = getMockEndpoint("mock:a");
a.expectedMessageCount(1);
Modified: servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiEndpointAvailableInRouteTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiEndpointAvailableInRouteTest.java?rev=1533436&r1=1533435&r2=1533436&view=diff
==============================================================================
--- servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiEndpointAvailableInRouteTest.java (original)
+++ servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiEndpointAvailableInRouteTest.java Fri Oct 18 13:03:00 2013
@@ -26,12 +26,14 @@ import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
import org.apache.servicemix.jbi.container.ActivationSpec;
import org.apache.servicemix.jbi.jaxp.StringSource;
+import org.junit.Test;
/**
* Tests to ensure that the Exchange.getFromEndpoint() call returns the originating Camel endpoint
*/
public class JbiEndpointAvailableInRouteTest extends JbiTestSupport {
+ @Test
public void testSendExchange() throws Exception {
InOnly exchange = getServicemixClient().createInOnlyExchange();
exchange.setService(new QName("urn:test", "service"));
Modified: servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiEndpointWithMepSpecifiedTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiEndpointWithMepSpecifiedTest.java?rev=1533436&r1=1533435&r2=1533436&view=diff
==============================================================================
--- servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiEndpointWithMepSpecifiedTest.java (original)
+++ servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiEndpointWithMepSpecifiedTest.java Fri Oct 18 13:03:00 2013
@@ -28,6 +28,7 @@ import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
import org.apache.servicemix.jbi.container.ActivationSpec;
import org.apache.servicemix.tck.ReceiverComponent;
+import org.junit.Test;
/**
* Tests to check correct handling of the ?mep=xxx setting on a Camel JBI endpoint
@@ -37,11 +38,12 @@ public class JbiEndpointWithMepSpecified
private MyReceiverComponent component;
@Override
- protected void setUp() throws Exception {
+ public void setUp() throws Exception {
component = new MyReceiverComponent();
super.setUp();
}
-
+
+ @Test
public void testCamelInOutSendJbiInOnly() throws Exception {
client.request("direct:a", new Processor() {
Modified: servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiExchangePropertiesPreservationTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiExchangePropertiesPreservationTest.java?rev=1533436&r1=1533435&r2=1533436&view=diff
==============================================================================
--- servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiExchangePropertiesPreservationTest.java (original)
+++ servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiExchangePropertiesPreservationTest.java Fri Oct 18 13:03:00 2013
@@ -25,6 +25,7 @@ import org.apache.servicemix.client.Defa
import org.apache.servicemix.client.ServiceMixClient;
import org.apache.servicemix.jbi.container.ActivationSpec;
import org.apache.servicemix.jbi.jaxp.StringSource;
+import org.junit.Test;
import javax.jbi.JBIException;
import javax.jbi.messaging.InOnly;
@@ -42,6 +43,7 @@ public class JbiExchangePropertiesPreser
private static final Object NEW_VALUE = "newvalue";
private static final String MESSAGE = "<just><a>test</a></just>";
+ @Test
public void testPropertyPreservation() throws JBIException, InterruptedException {
MockEndpoint output = getMockEndpoint("mock:output");
output.expectedMessageCount(1);
Modified: servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOnlyAsyncCamelTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOnlyAsyncCamelTest.java?rev=1533436&r1=1533435&r2=1533436&view=diff
==============================================================================
--- servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOnlyAsyncCamelTest.java (original)
+++ servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOnlyAsyncCamelTest.java Fri Oct 18 13:03:00 2013
@@ -28,6 +28,7 @@ import org.apache.camel.StringSource;
import org.apache.servicemix.client.DefaultServiceMixClient;
import org.apache.servicemix.client.ServiceMixClient;
import org.apache.servicemix.jbi.container.ActivationSpec;
+import org.junit.Test;
/**
* Tests on handling JBI InOnly exchanges by Camel
@@ -36,6 +37,7 @@ public class JbiInOnlyAsyncCamelTest ext
private static final String MESSAGE = "<just><a>test</a></just>";
+ @Test
public void testInOnlyExchangeThroughAsyncRoute() throws Exception {
// first remove the ExchangeListener -- it will not be notified of the undeliverable MessageExchange
jbiContainer.removeListener(exchangeCompletedListener);
Modified: servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOnlyCamelErrorHandlingTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOnlyCamelErrorHandlingTest.java?rev=1533436&r1=1533435&r2=1533436&view=diff
==============================================================================
--- servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOnlyCamelErrorHandlingTest.java (original)
+++ servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOnlyCamelErrorHandlingTest.java Fri Oct 18 13:03:00 2013
@@ -29,6 +29,7 @@ import org.apache.camel.StringSource;
import org.apache.servicemix.client.DefaultServiceMixClient;
import org.apache.servicemix.client.ServiceMixClient;
import org.apache.servicemix.jbi.exception.FaultException;
+import org.junit.Test;
/**
* Tests on handling fault messages with the Camel Exception handler
@@ -36,7 +37,8 @@ import org.apache.servicemix.jbi.excepti
public class JbiInOnlyCamelErrorHandlingTest extends JbiCamelErrorHandlingTestSupport {
private static final String MESSAGE = "<just><a>test</a></just>";
-
+
+ @Test
public void testInOnlyWithNoHandleFault() throws Exception {
MockEndpoint errors = getMockEndpoint("mock:errors");
errors.expectedMessageCount(1);
@@ -56,6 +58,7 @@ public class JbiInOnlyCamelErrorHandling
errors.assertIsSatisfied();
}
+ @Test
public void testRobustInOnlyWithNoHandleFault() throws Exception {
MockEndpoint errors = getMockEndpoint("mock:errors");
errors.expectedMessageCount(0);
@@ -173,8 +176,8 @@ public class JbiInOnlyCamelErrorHandling
public void configure() throws Exception {
onException(IllegalStateException.class).handled(false).to("jbi:service:urn:test:receiver-service");
onException(NullPointerException.class).handled(true).to("jbi:service:urn:test:receiver-service");
- onException().handled(false);
- errorHandler(deadLetterChannel("mock:errors").maximumRedeliveries(1).maximumRedeliveryDelay(300));
+ onException().to("mock:errors").handled(false);
+ //errorHandler(deadLetterChannel("mock:errors").maximumRedeliveries(1).maximumRedeliveryDelay(300));
from("jbi:service:urn:test:no-handle-fault").to("jbi:service:urn:test:faulty-service");
from("jbi:service:urn:test:handle-fault").handleFault().to("jbi:service:urn:test:faulty-service");
from("jbi:service:urn:test:error-not-handled").to("jbi:service:urn:test:iae-error-service");
Modified: servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOnlyPropertiesPipelineTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOnlyPropertiesPipelineTest.java?rev=1533436&r1=1533435&r2=1533436&view=diff
==============================================================================
--- servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOnlyPropertiesPipelineTest.java (original)
+++ servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOnlyPropertiesPipelineTest.java Fri Oct 18 13:03:00 2013
@@ -31,6 +31,7 @@ import org.apache.servicemix.client.Defa
import org.apache.servicemix.client.ServiceMixClient;
import org.apache.servicemix.jbi.container.ActivationSpec;
import org.apache.servicemix.jbi.jaxp.StringSource;
+import org.junit.Test;
/**
* Test to make sure that a Camel Pipeline is capable of preserving JBI headers
@@ -40,8 +41,9 @@ public class JbiInOnlyPropertiesPipeline
private static final String MESSAGE = "<just><a>test</a></just>";
private static final String HEADER_ORIGINAL = "original";
- private static final String HEADER_TRANSFORMER = "transformer";
+ private static final String HEADER_TRANSFORMER = "transformer";
+ @Test
public void testPipelinePreservesMessageHeaders() throws Exception {
MockEndpoint output = getMockEndpoint("mock:output");
output.expectedBodiesReceived(MESSAGE);
Modified: servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOnlySecuritySubjectTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOnlySecuritySubjectTest.java?rev=1533436&r1=1533435&r2=1533436&view=diff
==============================================================================
--- servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOnlySecuritySubjectTest.java (original)
+++ servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOnlySecuritySubjectTest.java Fri Oct 18 13:03:00 2013
@@ -32,6 +32,7 @@ import org.apache.servicemix.client.Defa
import org.apache.servicemix.client.ServiceMixClient;
import org.apache.servicemix.jbi.container.ActivationSpec;
import org.apache.servicemix.tck.ReceiverComponent;
+import org.junit.Test;
/**
* Tests on handling JBI InOnly exchanges by Camel
@@ -40,6 +41,7 @@ public class JbiInOnlySecuritySubjectTes
private static final String MESSAGE = "<just><a>test</a></just>";
+ @Test
public void testSecuritySubjectConveyedThroughCamelRoute() throws Exception {
MockEndpoint done = getMockEndpoint("mock:done");
done.expectedMessageCount(1);
Modified: servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOnlyTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOnlyTest.java?rev=1533436&r1=1533435&r2=1533436&view=diff
==============================================================================
--- servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOnlyTest.java (original)
+++ servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOnlyTest.java Fri Oct 18 13:03:00 2013
@@ -32,6 +32,7 @@ import org.apache.servicemix.client.Defa
import org.apache.servicemix.client.ServiceMixClient;
import org.apache.servicemix.jbi.container.ActivationSpec;
import org.apache.servicemix.jbi.jaxp.StringSource;
+import org.junit.Test;
/**
* Tests on handling JBI InOnly exchanges by Camel
@@ -41,6 +42,7 @@ public class JbiInOnlyTest extends JbiTe
private static final String MESSAGE = "<just><a>test</a></just>";
private static final int COUNT = 50;
+ @Test
public void testInOnlyExchangeConvertBody() throws Exception {
MockEndpoint done = getMockEndpoint("mock:done");
done.expectedBodiesReceived(MESSAGE);
@@ -54,7 +56,8 @@ public class JbiInOnlyTest extends JbiTe
assertEquals(ExchangeStatus.DONE, exchange.getStatus());
done.assertIsSatisfied();
}
-
+
+ @Test
public void testInOnlyExchangeForwardAndConvertBody() throws Exception {
MockEndpoint done = getMockEndpoint("mock:done");
done.expectedBodiesReceived(MESSAGE);
@@ -68,6 +71,7 @@ public class JbiInOnlyTest extends JbiTe
done.assertIsSatisfied();
}
+ @Test
public void testInOnlyWithException() throws Exception {
ServiceMixClient client = new DefaultServiceMixClient(jbiContainer);
InOnly exchange = client.createInOnlyExchange();
@@ -77,6 +81,7 @@ public class JbiInOnlyTest extends JbiTe
assertEquals(ExchangeStatus.ERROR, exchange.getStatus());
}
+ @Test
public void testInOutWithException() throws Exception {
ServiceMixClient client = new DefaultServiceMixClient(jbiContainer);
InOut exchange = client.createInOutExchange();
@@ -85,7 +90,8 @@ public class JbiInOnlyTest extends JbiTe
client.sendSync(exchange);
assertEquals(ExchangeStatus.ERROR, exchange.getStatus());
}
-
+
+ @Test
public void testInOnlyToAggregator() throws Exception {
ServiceMixClient smxClient = getServicemixClient();
getMockEndpoint("mock:aggregated").expectedMessageCount(1);
Modified: servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOnlyToCamelObjectTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOnlyToCamelObjectTest.java?rev=1533436&r1=1533435&r2=1533436&view=diff
==============================================================================
--- servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOnlyToCamelObjectTest.java (original)
+++ servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOnlyToCamelObjectTest.java Fri Oct 18 13:03:00 2013
@@ -29,6 +29,7 @@ import org.apache.camel.StringSource;
import org.apache.servicemix.client.DefaultServiceMixClient;
import org.apache.servicemix.client.ServiceMixClient;
import org.apache.servicemix.jbi.container.ActivationSpec;
+import org.junit.Test;
/**
* Tests on handling JBI InOnly exchanges by Camel
@@ -38,6 +39,7 @@ public class JbiInOnlyToCamelObjectTest
private static final String MESSAGE = "<just><a>test</a></just>";
+ @Test
public void testInOnlyExchangeConvertBody() throws Exception {
MockEndpoint done = getMockEndpoint("mock:done");
done.expectedBodiesReceived(new MessageContainer(MESSAGE));
Modified: servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOnlyWithErrorHandledTrueSpringDSLTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOnlyWithErrorHandledTrueSpringDSLTest.java?rev=1533436&r1=1533435&r2=1533436&view=diff
==============================================================================
--- servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOnlyWithErrorHandledTrueSpringDSLTest.java (original)
+++ servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOnlyWithErrorHandledTrueSpringDSLTest.java Fri Oct 18 13:03:00 2013
@@ -37,6 +37,7 @@ import org.apache.servicemix.jbi.contain
import org.apache.servicemix.jbi.helper.MessageUtil;
import org.apache.servicemix.jbi.jaxp.SourceTransformer;
import org.apache.servicemix.tck.ReceiverComponent;
+import org.junit.Test;
import org.springframework.util.Assert;
/**
@@ -52,7 +53,7 @@ public class JbiInOnlyWithErrorHandledTr
private ReceiverComponent deadLetter;
@Override
- protected void setUp() throws Exception {
+ public void setUp() throws Exception {
receiver = new ReceiverComponent() {
public void onMessageExchange(MessageExchange exchange) throws MessagingException {
NormalizedMessage inMessage = getInMessage(exchange);
@@ -77,13 +78,14 @@ public class JbiInOnlyWithErrorHandledTr
}
@Override
- protected void tearDown() throws Exception {
+ public void tearDown() throws Exception {
super.tearDown();
// restore the original log level
Logger.getLogger("org.apache.servicemix").setLevel(LOG_LEVEL);
}
-
+
+ @Test
public void testErrorHandledByExceptionClause() throws Exception {
ServiceMixClient smxClient = getServicemixClient();
MessageExchange[] exchanges = new MessageExchange[] {smxClient.createInOnlyExchange(), smxClient.createRobustInOnlyExchange()};
Modified: servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOnlyWithFaultHandledTrueSpringDSLTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOnlyWithFaultHandledTrueSpringDSLTest.java?rev=1533436&r1=1533435&r2=1533436&view=diff
==============================================================================
--- servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOnlyWithFaultHandledTrueSpringDSLTest.java (original)
+++ servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOnlyWithFaultHandledTrueSpringDSLTest.java Fri Oct 18 13:03:00 2013
@@ -40,6 +40,7 @@ import org.apache.servicemix.jbi.contain
import org.apache.servicemix.jbi.helper.MessageUtil;
import org.apache.servicemix.jbi.jaxp.SourceTransformer;
import org.apache.servicemix.tck.ReceiverComponent;
+import org.junit.Test;
import org.springframework.util.Assert;
/**
@@ -55,7 +56,7 @@ public class JbiInOnlyWithFaultHandledTr
private ReceiverComponent deadLetter;
@Override
- protected void setUp() throws Exception {
+ public void setUp() throws Exception {
receiver = new ReceiverComponent() {
public void onMessageExchange(MessageExchange exchange) throws MessagingException {
NormalizedMessage inMessage = getInMessage(exchange);
@@ -80,13 +81,14 @@ public class JbiInOnlyWithFaultHandledTr
}
@Override
- protected void tearDown() throws Exception {
+ public void tearDown() throws Exception {
super.tearDown();
// restore the original log level
Logger.getLogger("org.apache.servicemix").setLevel(LOG_LEVEL);
}
-
+
+ @Test
public void testInOnlyWithFaultHandledByExceptionClause() throws Exception {
ServiceMixClient smxClient = getServicemixClient();
InOnly exchange = smxClient.createInOnlyExchange();
@@ -104,6 +106,7 @@ public class JbiInOnlyWithFaultHandledTr
receiver.getMessageList().assertMessagesReceived(1);
}
+ @Test
public void testRobustInOnlyWithFaultHandledByExceptionClause() throws Exception {
ServiceMixClient smxClient = getServicemixClient();
RobustInOnly exchange = smxClient.createRobustInOnlyExchange();
Modified: servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOptionalOutCamelTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOptionalOutCamelTest.java?rev=1533436&r1=1533435&r2=1533436&view=diff
==============================================================================
--- servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOptionalOutCamelTest.java (original)
+++ servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOptionalOutCamelTest.java Fri Oct 18 13:03:00 2013
@@ -26,12 +26,14 @@ import org.apache.camel.builder.RouteBui
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.StringSource;
import org.apache.servicemix.jbi.container.ActivationSpec;
+import org.junit.Test;
/**
* Tests on handling JBI InOnly exchanges by Camel
*/
public class JbiInOptionalOutCamelTest extends JbiTestSupport {
-
+
+ @Test
public void testInOptionalOutFromCamelEndpoint() throws Exception {
MockEndpoint inonly = getMockEndpoint("mock:in-optional-out");
inonly.expectedMessageCount(1);
@@ -42,7 +44,8 @@ public class JbiInOptionalOutCamelTest e
// let's wait for a moment to ensure that all pending Exchanges are handled
Thread.sleep(500);
}
-
+
+ @Test
public void testInOptionalOutFromJbiWithDone() throws Exception {
MockEndpoint inonly = getMockEndpoint("mock:in-optional-out");
inonly.expectedMessageCount(1);
@@ -58,7 +61,8 @@ public class JbiInOptionalOutCamelTest e
getServicemixClient().done(exchange);
Thread.sleep(500);
}
-
+
+ @Test
public void testInOptionalOutFromJbiWithFault() throws Exception {
MockEndpoint inonly = getMockEndpoint("mock:in-optional-out");
inonly.expectedMessageCount(1);
@@ -76,7 +80,8 @@ public class JbiInOptionalOutCamelTest e
getServicemixClient().sendSync(exchange);
assertEquals(ExchangeStatus.DONE, exchange.getStatus());
}
-
+
+ @Test
public void testInOptionalOutFromJbiWithError() throws Exception {
MockEndpoint inonly = getMockEndpoint("mock:in-optional-out");
inonly.expectedMessageCount(1);
Modified: servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOutCamelErrorHandlingTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOutCamelErrorHandlingTest.java?rev=1533436&r1=1533435&r2=1533436&view=diff
==============================================================================
--- servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOutCamelErrorHandlingTest.java (original)
+++ servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOutCamelErrorHandlingTest.java Fri Oct 18 13:03:00 2013
@@ -29,6 +29,7 @@ import org.apache.servicemix.client.Defa
import org.apache.servicemix.client.ServiceMixClient;
import org.apache.servicemix.jbi.container.ActivationSpec;
import org.apache.servicemix.jbi.exception.FaultException;
+import org.junit.Test;
/**
* Tests on handling fault messages with the Camel Exception handler
@@ -37,6 +38,7 @@ public class JbiInOutCamelErrorHandlingT
private static final String MESSAGE = "<just><a>test</a></just>";
+ @Test
public void testInOutWithNoHandleFault() throws Exception {
MockEndpoint errors = getMockEndpoint("mock:errors");
errors.expectedMessageCount(0);
@@ -56,6 +58,7 @@ public class JbiInOutCamelErrorHandlingT
Thread.sleep(500);
}
+ @Test
public void testInOutWithHandleFault() throws Exception {
MockEndpoint errors = getMockEndpoint("mock:errors");
errors.expectedMessageCount(0);
Copied: servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOutCamelJMSFlowExceptionHandledTest.java (from r1523536, servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOutCamelJMSFlowExceptionTest.java)
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOutCamelJMSFlowExceptionHandledTest.java?p2=servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOutCamelJMSFlowExceptionHandledTest.java&p1=servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOutCamelJMSFlowExceptionTest.java&r1=1523536&r2=1533436&rev=1533436&view=diff
==============================================================================
--- servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOutCamelJMSFlowExceptionTest.java (original)
+++ servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOutCamelJMSFlowExceptionHandledTest.java Fri Oct 18 13:03:00 2013
@@ -16,52 +16,35 @@
*/
package org.apache.servicemix.camel;
-import javax.jbi.messaging.ExchangeStatus;
-import javax.jbi.messaging.InOut;
-import javax.xml.namespace.QName;
-
import org.apache.camel.CamelException;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
+import org.apache.camel.StringSource;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.StringSource;
import org.apache.servicemix.client.DefaultServiceMixClient;
import org.apache.servicemix.client.ServiceMixClient;
import org.apache.servicemix.jbi.exception.FaultException;
+import org.junit.Test;
+
+import javax.jbi.messaging.ExchangeStatus;
+import javax.jbi.messaging.InOut;
+import javax.xml.namespace.QName;
/**
* Test to ensure possibility of conveying exceptions over the JMS/JCA flow with convertException=true
*/
-public class JbiInOutCamelJMSFlowExceptionTest extends JbiCamelErrorHandlingTestSupport {
-
+public class JbiInOutCamelJMSFlowExceptionHandledTest extends JbiCamelErrorHandlingTestSupport {
+
@Override
- protected void setUp() throws Exception {
+ public void setUp() throws Exception {
super.setUp();
// make sure all exchanges in the ESB are serializable (e.g. for use with JMS/JCA flow)
enableCheckForSerializableExchanges();
}
-
- public void testInOutWithConvertExceptionsEnabled() throws Exception {
- MockEndpoint errors = getMockEndpoint("mock:errors");
- errors.expectedMessageCount(1);
-
- ServiceMixClient client = new DefaultServiceMixClient(jbiContainer);
- InOut exchange = client.createInOutExchange();
- exchange.setService(new QName("urn:test", "error-not-handled"));
- exchange.getInMessage().setContent(new StringSource(MESSAGE));
- client.sendSync(exchange);
- assertEquals(ExchangeStatus.ERROR, exchange.getStatus());
- assertTrue("Exception should have been converted to a JBI FaultException",
- exchange.getError() instanceof FaultException);
- assertTrue("Original validation message should have been preserved",
- exchange.getError().getMessage().contains("Validation"));
-
- errors.assertIsSatisfied();
- }
-
+ @Test
public void testInOutWithErrorHandledTrue() throws Exception {
MockEndpoint errors = getMockEndpoint("mock:errors");
errors.expectedMessageCount(1);
@@ -73,9 +56,9 @@ public class JbiInOutCamelJMSFlowExcepti
client.sendSync(exchange);
assertEquals(ExchangeStatus.ACTIVE, exchange.getStatus());
client.done(exchange);
-
+
errors.assertIsSatisfied();
-
+
// let's wait a moment to make sure that the last DONE MessageExchange is handled
Thread.sleep(500);
}
@@ -85,11 +68,8 @@ public class JbiInOutCamelJMSFlowExcepti
return new RouteBuilder() {
@Override
public void configure() throws Exception {
- onException(org.apache.camel.processor.validation.SchemaValidationException.class).handled(false);
- onException(org.apache.camel.CamelException.class).handled(true);
- errorHandler(deadLetterChannel("mock:errors").maximumRedeliveries(1).maximumRedeliveryDelay(300));
- from("jbi:service:urn:test:error-not-handled?convertExceptions=true")
- .to("validator:org/apache/servicemix/camel/simple.xsd");
+ onException(CamelException.class).handled(true).to("mock:errors");
+
from("jbi:service:urn:test:error-handled-true")
.process(new Processor() {
public void process(Exchange exchange) throws Exception {
Modified: servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOutCamelJMSFlowExceptionTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOutCamelJMSFlowExceptionTest.java?rev=1533436&r1=1533435&r2=1533436&view=diff
==============================================================================
--- servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOutCamelJMSFlowExceptionTest.java (original)
+++ servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOutCamelJMSFlowExceptionTest.java Fri Oct 18 13:03:00 2013
@@ -29,6 +29,8 @@ import org.apache.camel.StringSource;
import org.apache.servicemix.client.DefaultServiceMixClient;
import org.apache.servicemix.client.ServiceMixClient;
import org.apache.servicemix.jbi.exception.FaultException;
+import org.junit.Ignore;
+import org.junit.Test;
/**
* Test to ensure possibility of conveying exceptions over the JMS/JCA flow with convertException=true
@@ -36,13 +38,14 @@ import org.apache.servicemix.jbi.excepti
public class JbiInOutCamelJMSFlowExceptionTest extends JbiCamelErrorHandlingTestSupport {
@Override
- protected void setUp() throws Exception {
+ public void setUp() throws Exception {
super.setUp();
// make sure all exchanges in the ESB are serializable (e.g. for use with JMS/JCA flow)
enableCheckForSerializableExchanges();
}
-
+
+ @Test
public void testInOutWithConvertExceptionsEnabled() throws Exception {
MockEndpoint errors = getMockEndpoint("mock:errors");
errors.expectedMessageCount(1);
@@ -61,42 +64,16 @@ public class JbiInOutCamelJMSFlowExcepti
errors.assertIsSatisfied();
}
-
- public void testInOutWithErrorHandledTrue() throws Exception {
- MockEndpoint errors = getMockEndpoint("mock:errors");
- errors.expectedMessageCount(1);
-
- ServiceMixClient client = new DefaultServiceMixClient(jbiContainer);
- InOut exchange = client.createInOutExchange();
- exchange.setService(new QName("urn:test", "error-handled-true"));
- exchange.getInMessage().setContent(new StringSource(MESSAGE));
- client.sendSync(exchange);
- assertEquals(ExchangeStatus.ACTIVE, exchange.getStatus());
- client.done(exchange);
-
- errors.assertIsSatisfied();
-
- // let's wait a moment to make sure that the last DONE MessageExchange is handled
- Thread.sleep(500);
- }
@Override
protected RouteBuilder createRoutes() {
return new RouteBuilder() {
@Override
public void configure() throws Exception {
- onException(org.apache.camel.processor.validation.SchemaValidationException.class).handled(false);
- onException(org.apache.camel.CamelException.class).handled(true);
- errorHandler(deadLetterChannel("mock:errors").maximumRedeliveries(1).maximumRedeliveryDelay(300));
+ onException(org.apache.camel.processor.validation.SchemaValidationException.class).to("mock:errors").handled(false);
+
from("jbi:service:urn:test:error-not-handled?convertExceptions=true")
.to("validator:org/apache/servicemix/camel/simple.xsd");
- from("jbi:service:urn:test:error-handled-true")
- .process(new Processor() {
- public void process(Exchange exchange) throws Exception {
- throw new CamelException();
- }
- })
- .setBody(constant("<msg>Done</msg>"));
}
};
}
Modified: servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOutPipelineTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOutPipelineTest.java?rev=1533436&r1=1533435&r2=1533436&view=diff
==============================================================================
--- servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOutPipelineTest.java (original)
+++ servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOutPipelineTest.java Fri Oct 18 13:03:00 2013
@@ -37,6 +37,7 @@ import org.apache.servicemix.client.Defa
import org.apache.servicemix.client.ServiceMixClient;
import org.apache.servicemix.jbi.container.ActivationSpec;
import org.apache.servicemix.jbi.jaxp.StringSource;
+import org.junit.Test;
/**
@@ -50,6 +51,7 @@ public class JbiInOutPipelineTest extend
private MyHeaderFilterStrategy myFilterStrategy = new MyHeaderFilterStrategy();
+ @Test
public void testPipelineWithMessageHeadersAndAttachements() throws Exception {
ServiceMixClient client = new DefaultServiceMixClient(jbiContainer);
InOut exchange = client.createInOutExchange();
@@ -72,6 +74,7 @@ public class JbiInOutPipelineTest extend
Thread.sleep(1000);
}
+ @Test
public void testPipelineWithMessageProviderHeaderFiltering() throws Exception {
ServiceMixClient client = new DefaultServiceMixClient(jbiContainer);
InOut exchange = client.createInOutExchange();
@@ -89,6 +92,7 @@ public class JbiInOutPipelineTest extend
Thread.sleep(1000);
}
+ @Test
public void testPipelineWithMessageConsumerHeaderFiltering() throws Exception {
ServiceMixClient client = new DefaultServiceMixClient(jbiContainer);
Modified: servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOutWithPojoTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOutWithPojoTest.java?rev=1533436&r1=1533435&r2=1533436&view=diff
==============================================================================
--- servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOutWithPojoTest.java (original)
+++ servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOutWithPojoTest.java Fri Oct 18 13:03:00 2013
@@ -27,6 +27,7 @@ import org.apache.servicemix.client.Defa
import org.apache.servicemix.client.ServiceMixClient;
import org.apache.servicemix.jbi.container.ActivationSpec;
import org.apache.servicemix.jbi.jaxp.StringSource;
+import org.junit.Test;
/**
* Tests on handling JBI InOut exchanges by Camel when they return a non-Source payload
@@ -34,7 +35,8 @@ import org.apache.servicemix.jbi.jaxp.St
public class JbiInOutWithPojoTest extends JbiTestSupport {
private static final String MESSAGE = "<just><a>test</a></just>";
-
+
+ @Test
public void testInOutWithCamelReturningPojoPayload() throws Exception {
ServiceMixClient client = new DefaultServiceMixClient(jbiContainer);
InOut exchange = client.createInOutExchange();
Modified: servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiNoCheckSerializationTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiNoCheckSerializationTest.java?rev=1533436&r1=1533435&r2=1533436&view=diff
==============================================================================
--- servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiNoCheckSerializationTest.java (original)
+++ servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiNoCheckSerializationTest.java Fri Oct 18 13:03:00 2013
@@ -31,6 +31,7 @@ import org.apache.servicemix.camel.test.
import org.apache.servicemix.client.DefaultServiceMixClient;
import org.apache.servicemix.client.ServiceMixClient;
import org.apache.servicemix.jbi.jaxp.StringSource;
+import org.junit.Test;
/**
* <p>
@@ -45,7 +46,8 @@ public class JbiNoCheckSerializationTest
private static final String SERIALIZABLE_KEY = "serializable";
private static final String INVALID_SERIALIZABLE_KEY = "invalid.serializable";
private static final String NON_SERIALIZABLE_KEY = "non.serializable";
-
+
+ @Test
public void testInOutWithNoCheckSerialization() throws Exception {
MockEndpoint errors = getMockEndpoint("mock:errors");
errors.expectedMessageCount(1);
Modified: servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiOperationCamelTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiOperationCamelTest.java?rev=1533436&r1=1533435&r2=1533436&view=diff
==============================================================================
--- servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiOperationCamelTest.java (original)
+++ servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiOperationCamelTest.java Fri Oct 18 13:03:00 2013
@@ -27,6 +27,7 @@ import org.apache.camel.builder.RouteBui
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.StringSource;
import org.apache.servicemix.jbi.container.ActivationSpec;
+import org.junit.Test;
/**
* Tests on handling JBI InOnly exchanges by Camel
@@ -34,7 +35,8 @@ import org.apache.servicemix.jbi.contain
public class JbiOperationCamelTest extends JbiTestSupport {
private static final QName OPERATION = new QName("urn:test", "doit");
-
+
+ @Test
public void testInOnlySetOperationOnCamelEndpoint() throws Exception {
MockEndpoint inonly = getMockEndpoint("mock:in-only");
inonly.expectedMessageCount(1);
@@ -48,7 +50,8 @@ public class JbiOperationCamelTest exten
String str2 = URLDecoder.decode(JbiBinding.getOperation(exchange).toString(), "UTF-8");
assertEquals(str1, str2);
}
-
+
+ @Test
public void testInOnlySetOperationOnCamelExchange() throws Exception {
MockEndpoint inonly = getMockEndpoint("mock:in-only");
inonly.expectedMessageCount(1);
Modified: servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiProducerTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiProducerTest.java?rev=1533436&r1=1533435&r2=1533436&view=diff
==============================================================================
--- servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiProducerTest.java (original)
+++ servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiProducerTest.java Fri Oct 18 13:03:00 2013
@@ -22,6 +22,7 @@ import javax.jbi.management.DeploymentEx
import org.apache.camel.builder.RouteBuilder;
import org.apache.servicemix.jbi.container.ActivationSpec;
+import org.junit.Test;
/**
* Test for {@link JbiEndpoint.JbiProducer}
@@ -31,6 +32,7 @@ public class JbiProducerTest extends Jbi
/*
* Ensure that no exceptions get thrown when shutting down the routes
*/
+ @Test
public void testShutdown() throws Exception {
client.stop();
try {
@@ -41,7 +43,7 @@ public class JbiProducerTest extends Jbi
}
@Override
- protected void tearDown() throws Exception {
+ public void tearDown() throws Exception {
// testing shutdown, so will do this manually
}
Modified: servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiSerializableMessageExchangeTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiSerializableMessageExchangeTest.java?rev=1533436&r1=1533435&r2=1533436&view=diff
==============================================================================
--- servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiSerializableMessageExchangeTest.java (original)
+++ servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiSerializableMessageExchangeTest.java Fri Oct 18 13:03:00 2013
@@ -29,6 +29,7 @@ import org.apache.camel.builder.RouteBui
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.servicemix.jbi.container.ActivationSpec;
import org.apache.servicemix.tck.ReceiverComponent;
+import org.junit.Test;
/**
* Tests on handling JBI InOnly exchanges by Camel
@@ -37,6 +38,7 @@ public class JbiSerializableMessageExcha
private static final String MESSAGE = "<just><a>test</a></just>";
+ @Test
public void testInOnlyExchangeConvertBody() throws Exception {
MockEndpoint done = getMockEndpoint("mock:done");
done.expectedBodiesReceived(MESSAGE);
Modified: servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiStrangeNamespaceHandlingTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiStrangeNamespaceHandlingTest.java?rev=1533436&r1=1533435&r2=1533436&view=diff
==============================================================================
--- servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiStrangeNamespaceHandlingTest.java (original)
+++ servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiStrangeNamespaceHandlingTest.java Fri Oct 18 13:03:00 2013
@@ -29,6 +29,7 @@ import org.apache.servicemix.components.
import org.apache.servicemix.jbi.container.ActivationSpec;
import org.apache.servicemix.jbi.jaxp.StringSource;
import org.apache.servicemix.tck.ReceiverComponent;
+import org.junit.Test;
/**
* Tests on sending JBI InOut and InOnly exchanges from within a Camel route to
@@ -38,6 +39,7 @@ public class JbiStrangeNamespaceHandling
private static final String MESSAGE = "<just><a>test</a></just>";
+ @Test
public void testInOutWithStrangeNamespace() throws Exception {
MockEndpoint inout = getMockEndpoint("mock:in-out");
inout.expectedMessageCount(1);
@@ -56,7 +58,8 @@ public class JbiStrangeNamespaceHandling
// let's wait a moment to make sure that the last DONE MessageExchange is handled
Thread.sleep(1000);
}
-
+
+ @Test
public void testInOnlyWithStrangeNamespace() throws Exception {
MockEndpoint inonly = getMockEndpoint("mock:in-only");
inonly.expectedMessageCount(1);
Modified: servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiStrictSerializationTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiStrictSerializationTest.java?rev=1533436&r1=1533435&r2=1533436&view=diff
==============================================================================
--- servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiStrictSerializationTest.java (original)
+++ servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiStrictSerializationTest.java Fri Oct 18 13:03:00 2013
@@ -30,6 +30,7 @@ import org.apache.camel.StringSource;
import org.apache.servicemix.camel.test.InvalidSerializableObject;
import org.apache.servicemix.client.DefaultServiceMixClient;
import org.apache.servicemix.client.ServiceMixClient;
+import org.junit.Test;
/**
* Testcase for strictSerialization=true (removes all non-serializable headers, even those that incorrectly
@@ -41,6 +42,7 @@ public class JbiStrictSerializationTest
private static final String INVALID_SERIALIZABLE_KEY = "invalid.serializable";
private static final String NON_SERIALIZABLE_KEY = "non.serializable";
+ @Test
public void testInOutWithStrictSerialization() throws Exception {
MockEndpoint errors = getMockEndpoint("mock:errors");
errors.expectedMessageCount(1);
Modified: servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiTestSupport.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiTestSupport.java?rev=1533436&r1=1533435&r2=1533436&view=diff
==============================================================================
--- servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiTestSupport.java (original)
+++ servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiTestSupport.java Fri Oct 18 13:03:00 2013
@@ -22,6 +22,7 @@ import java.io.NotSerializableException;
import java.io.ObjectOutputStream;
import java.lang.reflect.Field;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@@ -39,6 +40,7 @@ import org.apache.camel.component.mock.M
import org.apache.camel.impl.DefaultCamelContext;
import org.apache.camel.spi.Synchronization;
import org.apache.camel.test.TestSupport;
+import org.apache.camel.test.junit4.CamelTestSupport;
import org.apache.servicemix.client.DefaultServiceMixClient;
import org.apache.servicemix.client.ServiceMixClient;
import org.apache.servicemix.common.Registry;
@@ -52,7 +54,7 @@ import org.apache.servicemix.tck.Exchang
/**
* @version $Revision: 563665 $
*/
-public abstract class JbiTestSupport extends TestSupport {
+public abstract class JbiTestSupport extends CamelTestSupport {
protected Exchange receivedExchange;
@@ -127,7 +129,7 @@ public abstract class JbiTestSupport ext
}
@Override
- protected void setUp() throws Exception {
+ public void setUp() throws Exception {
if (camelContext == null) {
camelContext = createCamelContext();
client = camelContext.createProducerTemplate();
@@ -195,7 +197,7 @@ public abstract class JbiTestSupport ext
}
@Override
- protected void tearDown() throws Exception {
+ public void tearDown() throws Exception {
exchangeCompletedListener.assertExchangeCompleted();
getServicemixClient().close();
@@ -259,7 +261,8 @@ public abstract class JbiTestSupport ext
// little hack to access the endpoints map in the registry directly
Field field = Registry.class.getDeclaredField("endpoints");
field.setAccessible(true);
- Map<String, org.apache.servicemix.common.Endpoint> endpoints = (Map) field.get(component.getRegistry());
+ Map<String, org.apache.servicemix.common.Endpoint> endpoints = new HashMap();
+ endpoints.putAll((Map) field.get(component.getRegistry()));
for (org.apache.servicemix.common.Endpoint endpoint : endpoints.values()) {
if (type.isAssignableFrom(endpoint.getClass())) {
Modified: servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiToCamelCbrTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiToCamelCbrTest.java?rev=1533436&r1=1533435&r2=1533436&view=diff
==============================================================================
--- servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiToCamelCbrTest.java (original)
+++ servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiToCamelCbrTest.java Fri Oct 18 13:03:00 2013
@@ -33,6 +33,7 @@ import org.apache.servicemix.client.Defa
import org.apache.servicemix.client.ServiceMixClient;
import org.apache.servicemix.jbi.container.ActivationSpec;
import org.apache.servicemix.jbi.jaxp.SourceTransformer;
+import org.junit.Test;
/**
* Tests on correct handling of several XML Source implementations being sent by ServiceMix to Camel
@@ -45,7 +46,7 @@ public class JbiToCamelCbrTest extends J
private Level level;
@Override
- protected void setUp() throws Exception {
+ public void setUp() throws Exception {
super.setUp();
// let's disable DEBUG logging for ServiceMix or all message content will be DOMSource anyway
if (level == null) {
@@ -55,7 +56,7 @@ public class JbiToCamelCbrTest extends J
}
@Override
- protected void tearDown() throws Exception {
+ public void tearDown() throws Exception {
super.tearDown();
// restore the original log level
if (level != null) {
@@ -64,16 +65,19 @@ public class JbiToCamelCbrTest extends J
}
}
+ @Test
public void testCbrWithStringSource() throws Exception {
doTestCbr(new StringSource(MESSAGE_IN_FRENCH),
new StringSource(MESSAGE_IN_ENGLISH));
}
-
+
+ @Test
public void testCbrWithStreamSource() throws Exception {
doTestCbr(new StreamSource(new StringReader(MESSAGE_IN_FRENCH)),
new StreamSource(new StringReader(MESSAGE_IN_ENGLISH)));
}
-
+
+ @Test
public void testCbrWithDomSource() throws Exception {
doTestCbr(transformer.toDOMSource(new StringSource(MESSAGE_IN_FRENCH)),
transformer.toDOMSource(new StringSource(MESSAGE_IN_ENGLISH)));
Modified: servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiToCamelStreamSourceTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiToCamelStreamSourceTest.java?rev=1533436&r1=1533435&r2=1533436&view=diff
==============================================================================
--- servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiToCamelStreamSourceTest.java (original)
+++ servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiToCamelStreamSourceTest.java Fri Oct 18 13:03:00 2013
@@ -33,6 +33,7 @@ import org.apache.log4j.Logger;
import org.apache.servicemix.components.util.TransformComponentSupport;
import org.apache.servicemix.jbi.api.ServiceMixClient;
import org.apache.servicemix.jbi.container.ActivationSpec;
+import org.junit.Test;
/**
* Tests for handling StreamSource sent by JBI to Camel
@@ -44,7 +45,7 @@ public class JbiToCamelStreamSourceTest
private static final Level LOG_LEVEL = Logger.getLogger("org.apache.servicemix").getEffectiveLevel();
@Override
- protected void setUp() throws Exception {
+ public void setUp() throws Exception {
super.setUp();
// change the log level to avoid the conversion to DOMSource
@@ -52,13 +53,14 @@ public class JbiToCamelStreamSourceTest
}
@Override
- protected void tearDown() throws Exception {
+ public void tearDown() throws Exception {
super.tearDown();
// restore the original log level
Logger.getLogger("org.apache.servicemix").setLevel(LOG_LEVEL);
}
-
+
+ @Test
public void testSendingStreamSource() throws Exception {
MockEndpoint result = getMockEndpoint("mock:result");
result.expectedBodiesReceived(MESSAGE);
Modified: servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiTryCatchExceptionTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiTryCatchExceptionTest.java?rev=1533436&r1=1533435&r2=1533436&view=diff
==============================================================================
--- servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiTryCatchExceptionTest.java (original)
+++ servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiTryCatchExceptionTest.java Fri Oct 18 13:03:00 2013
@@ -19,6 +19,7 @@ package org.apache.servicemix.camel;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.servicemix.jbi.container.ActivationSpec;
+import org.junit.Test;
import java.util.List;
@@ -29,6 +30,7 @@ public class JbiTryCatchExceptionTest ex
private static final String MESSAGE = "<just><a>test</a></just>";
+ @Test
public void testInOnlyExchangeConvertBody() throws Exception {
MockEndpoint caught = getMockEndpoint("mock:caught");
caught.expectedMessageCount(1);
Modified: servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/MinaEndpointSpringDSLTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/MinaEndpointSpringDSLTest.java?rev=1533436&r1=1533435&r2=1533436&view=diff
==============================================================================
--- servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/MinaEndpointSpringDSLTest.java (original)
+++ servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/MinaEndpointSpringDSLTest.java Fri Oct 18 13:03:00 2013
@@ -19,16 +19,18 @@ package org.apache.servicemix.camel;
import java.util.List;
import junit.framework.Assert;
import org.apache.servicemix.jbi.container.ActivationSpec;
+import org.junit.Test;
/**
* This tests whether camel-mina can be deployed in ServiceMix (see CAMEL-1146)
*/
public class MinaEndpointSpringDSLTest extends SpringJbiTestSupport {
- protected void setUp() throws Exception {
+ public void setUp() throws Exception {
super.setUp();
}
+ @Test
public void test() throws Exception {
Assert.assertTrue(true);
}
Modified: servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/SendFromCamelToJbiAndBackToCamelTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/SendFromCamelToJbiAndBackToCamelTest.java?rev=1533436&r1=1533435&r2=1533436&view=diff
==============================================================================
--- servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/SendFromCamelToJbiAndBackToCamelTest.java (original)
+++ servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/SendFromCamelToJbiAndBackToCamelTest.java Fri Oct 18 13:03:00 2013
@@ -28,6 +28,7 @@ import org.apache.camel.component.seda.S
import org.apache.servicemix.jbi.container.ActivationSpec;
import org.apache.servicemix.jbi.resolver.URIResolver;
import org.apache.servicemix.tck.SenderComponent;
+import org.junit.Test;
/**
* @version $Revision: 563665 $
@@ -35,6 +36,7 @@ import org.apache.servicemix.tck.SenderC
public class SendFromCamelToJbiAndBackToCamelTest extends JbiTestSupport {
protected SenderComponent senderComponent = new SenderComponent();
+ @Test
public void testCamelInvokingJbi() throws Exception {
senderComponent.sendMessages(1);
@@ -87,7 +89,7 @@ public class SendFromCamelToJbiAndBackTo
}
@Override
- protected void tearDown() throws Exception {
+ public void tearDown() throws Exception {
camelContext.stop();
}
}
Modified: servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/SendFromCamelToJbiTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/SendFromCamelToJbiTest.java?rev=1533436&r1=1533435&r2=1533436&view=diff
==============================================================================
--- servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/SendFromCamelToJbiTest.java (original)
+++ servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/SendFromCamelToJbiTest.java Fri Oct 18 13:03:00 2013
@@ -25,6 +25,7 @@ import org.apache.camel.builder.RouteBui
import org.apache.servicemix.jbi.container.ActivationSpec;
import org.apache.servicemix.tck.MessageList;
import org.apache.servicemix.tck.ReceiverComponent;
+import org.junit.Test;
/**
* @version $Revision: 563665 $
@@ -33,6 +34,7 @@ public class SendFromCamelToJbiTest exte
private ReceiverComponent receiverComponent = new ReceiverComponent();
+ @Test
public void testCamelInvokingJbi() throws Exception {
sendExchangeAsync("<foo bar='123'/>");
MessageList list = receiverComponent.getMessageList();
@@ -69,7 +71,7 @@ public class SendFromCamelToJbiTest exte
}
@Override
- protected void tearDown() throws Exception {
+ public void tearDown() throws Exception {
camelContext.stop();
}
}
Modified: servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/SendFromCamelToJbiThenRouteToAnotherJbiComponentTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/SendFromCamelToJbiThenRouteToAnotherJbiComponentTest.java?rev=1533436&r1=1533435&r2=1533436&view=diff
==============================================================================
--- servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/SendFromCamelToJbiThenRouteToAnotherJbiComponentTest.java (original)
+++ servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/SendFromCamelToJbiThenRouteToAnotherJbiComponentTest.java Fri Oct 18 13:03:00 2013
@@ -25,6 +25,7 @@ import org.apache.camel.builder.RouteBui
import org.apache.servicemix.jbi.container.ActivationSpec;
import org.apache.servicemix.tck.MessageList;
import org.apache.servicemix.tck.ReceiverComponent;
+import org.junit.Test;
/**
* @version $Revision: 563665 $
@@ -33,6 +34,7 @@ public class SendFromCamelToJbiThenRoute
JbiTestSupport {
private ReceiverComponent receiverComponent = new ReceiverComponent();
+ @Test
public void testCamelInvokingJbi() throws Exception {
sendExchange("<foo bar='123'/>");
MessageList list = receiverComponent.getMessageList();
@@ -70,7 +72,7 @@ public class SendFromCamelToJbiThenRoute
}
@Override
- protected void tearDown() throws Exception {
+ public void tearDown() throws Exception {
camelContext.stop();
}
}
Modified: servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/SpringJbiTestSupport.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/SpringJbiTestSupport.java?rev=1533436&r1=1533435&r2=1533436&view=diff
==============================================================================
--- servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/SpringJbiTestSupport.java (original)
+++ servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/SpringJbiTestSupport.java Fri Oct 18 13:03:00 2013
@@ -69,7 +69,7 @@ public abstract class SpringJbiTestSuppo
}
@Override
- protected void tearDown() throws Exception {
+ public void tearDown() throws Exception {
super.tearDown();
jbiContainer.stop();
jbiContainer.shutDown();
Modified: servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/TestCamelRouter.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/TestCamelRouter.java?rev=1533436&r1=1533435&r2=1533436&view=diff
==============================================================================
--- servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/TestCamelRouter.java (original)
+++ servicemix/components/trunk/engines/servicemix-camel/src/test/java/org/apache/servicemix/camel/TestCamelRouter.java Fri Oct 18 13:03:00 2013
@@ -20,7 +20,7 @@ import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.CamelTestSupport;
+import org.apache.camel.test.junit4.CamelTestSupport;
/**
* @version $Revision: 563665 $
@@ -64,7 +64,7 @@ public class TestCamelRouter extends Cam
}
@Override
- protected void setUp() throws Exception {
+ public void setUp() throws Exception {
super.setUp();
a = resolveMandatoryEndpoint("mock:a", MockEndpoint.class);
b = resolveMandatoryEndpoint("mock:b", MockEndpoint.class);
Modified: servicemix/components/trunk/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/pom.xml?rev=1533436&r1=1533435&r2=1533436&view=diff
==============================================================================
--- servicemix/components/trunk/pom.xml (original)
+++ servicemix/components/trunk/pom.xml Fri Oct 18 13:03:00 2013
@@ -69,6 +69,7 @@
<servicemix.legal.version>1.0</servicemix.legal.version>
<servicemix.specs.version>2.2.0</servicemix.specs.version>
<servicemix-utils.version>1.6.0</servicemix-utils.version>
+
<servicemix.version>3.3.2</servicemix.version>
<!-- OSGi properties used by maven-bundle-plugin -->
@@ -85,7 +86,7 @@
<activemq.version>5.7.0</activemq.version>
<!-- Camel -->
- <camel.version>2.10.3</camel.version>
+ <camel.version>2.12.1</camel.version>
<!-- CXF -->
<cxf.version>2.6.4</cxf.version>