My route unit tests fail when my routes contain SoapJaxbDataFormat elements. 

Unit tests complete successfully if I comment out the couple of steps where
SoapJaxbDataFormat is used. 

My route uses jaxb data format like such:

        from(someRouteName)
                .routeId(someId)
                .log(LoggingLevel.INFO, "klhkljh")
                .process(fooProcessor)
                .marshal(soapJaxbDataFormat) // (1)
                .log(LoggingLevel.DEBUG, "contents: ${body}")

and soapJaxbDataFormat is defined in test-camel-context.xml like:

    <bean id="soapJaxbDataFormat"
class="org.apache.camel.model.dataformat.SoapJaxbDataFormat">
        <property name="contextPath" value="mypackage.xsd._1" />
    </bean>

mypackage.xsd._1 is package which has JAXB beans generated from schema/wsdl.
It is in folder target/generated-sources/cxf/mypackage/...

Depending on whether line (1) is commented out or not, test either works or
fails.

When my test fails, it first tries to wait for some jaxb-related
dependencies:

[         Blueprint Extender: 3] BlueprintContainerImpl         INFO  Bundle
FooRoutesTest is waiting for dependencies
[(&(dataformat=soapjaxb)(objectClass=org.apache.camel.spi.DataFormatResolver))]

and after timeout, it fails with 

java.lang.RuntimeException: Gave up waiting for service
(objectClass=org.apache.camel.CamelContext)
        at
org.apache.camel.test.blueprint.CamelBlueprintHelper.getOsgiService(CamelBlueprintHelper.java:209)
        at
org.apache.camel.test.blueprint.CamelBlueprintHelper.getOsgiService(CamelBlueprintHelper.java:171)
        at
org.apache.camel.test.blueprint.CamelBlueprintTestSupport.createCamelContext(CamelBlueprintTestSupport.java:221)
        at
org.apache.camel.test.junit4.CamelTestSupport.doSetUp(CamelTestSupport.java:248)
        at
org.apache.camel.test.junit4.CamelTestSupport.setUp(CamelTestSupport.java:218)
        at
org.apache.camel.test.blueprint.CamelBlueprintTestSupport.setUp(CamelBlueprintTestSupport.java:123)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

What is the problem? What is the container waiting for? 



--
View this message in context: 
http://servicemix.396122.n5.nabble.com/CamelBlueprintTestSupport-fails-when-I-use-SoapJaxbDataFormat-tp5718828.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to