Have you tried to define the transformerFactory (how to do that see
http://camel.apache.org/xslt.html at the end of the page)? I'm not sure
if this is the problem, but it can be. Your code looks fine.
Best regards - Claus
Am Mittwoch, den 22.06.2011, 03:41 +0200 schrieb pcroser
<patrick.ro...@gmail.com>:
Running on Linux with maven setup
I am getting an error when tyring to run the testXMLCoversion method
No getConsumers() available on Producer[direct:start] which leads to
testXMLConversion(com.itt.ips.casex.cybervisor.cameljmsmailcomponent.XMLInputTest):
mock:finish Received message count. Expected: <1> but was: <0>
Not sure what I have missed but I followed tutorial steps I believe
correctly.
I have double checked classpaths and test files are in the correct
locaiton.
The Test method is being run but fails.
I am using the spring context file as shown XMLInputTest-context.xml
<beans
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://activemq.apache.org/camel/schema/spring
http://activemq.apache.org/camel/schema/spring/camel-spring-1.4.0.xsd">
<camelContext id="camel">
<route>
<from uri="direct:start"/>
<to uri="xslt:XMLConverter.xsl"/>
<to uri="mock:finish"/>
</route>
</camelContext>
</beans>
and XMLInputTest.java
import java.io.InputStream;
import org.apache.camel.CamelContext;
import org.apache.camel.Exchange;
import org.apache.camel.ProducerTemplate;
import org.apache.camel.component.mock.MockEndpoint;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import
org.springframework.test.context.junit38.AbstractJUnit38SpringContextTests;
@ContextConfiguration(locations="classpath:/XMLInputTest-context.xml")
public class XMLInputTest extends AbstractJUnit38SpringContextTests {
@Autowired
protected CamelContext camelContext;
protected ProducerTemplate<Exchange> template;
public XMLInputTest(String testName) {
super(testName);
}
@Override
protected void tearDown() throws Exception {
super.tearDown();
}
protected void setUp() throws Exception {
super.setUp();
template = camelContext.createProducerTemplate();
}
// TODO add test methods here. The name must begin with 'test'. For
example:
public void testNothing() {
System.out.println("Test CASE is being run");
}
public void testXMLConversion() throws InterruptedException {
MockEndpoint finish = MockEndpoint.resolve(camelContext,
"mock:finish");
finish.setExpectedMessageCount(1);
InputStream in =
XMLInputTest.class.getResourceAsStream("/input-customer1.xml");
assertNotNull( in );
template.sendBody("direct:start", in );
System.out.println(" Cannot get testXMLConversion to work
commented
out");
MockEndpoint.assertIsSatisfied(camelContext);
System.err.println(finish.getExchanges().get(0).getIn().getBody()
);
}
}
Thanks for any help in advance.
--
View this message in context:
http://camel.465427.n5.nabble.com/Tutorial-Business-Partners-Test-Failing-tp4513605p4513605.html
Sent from the Camel - Users mailing list archive at Nabble.com.