1 17 package org.apache.servicemix.components.xfire; 18 19 import javax.xml.namespace.QName ; 20 21 import org.apache.servicemix.tck.TestSupport; 22 import org.springframework.context.support.AbstractXmlApplicationContext; 23 import org.w3c.dom.Node ; 24 import org.apache.xbean.spring.context.ClassPathXmlApplicationContext; 25 26 public class XFireBindingTest extends TestSupport { 27 28 public void testSendingAndReceivingMessagesUsingSpring() throws Exception { 29 Object answer = requestServiceWithFileRequest(new QName ("http://xfire.components.servicemix.org", "Echo"), 30 "/org/apache/servicemix/components/xfire/echo.xml"); 31 assertTrue("Shoud return a DOM Node: " + answer, answer instanceof Node ); 32 Node node = (Node ) answer; 33 System.out.println(transformer.toString(node)); 34 35 Echo echo = (Echo) context.getBean("xfireReceiverService"); 36 assertEquals(1, echo.getCount()); 37 } 38 39 protected AbstractXmlApplicationContext createBeanFactory() { 40 return new ClassPathXmlApplicationContext(new String [] { 41 "/org/apache/servicemix/components/xfire/xfire-inout.xml", 42 "/org/codehaus/xfire/spring/xfire.xml" 43 }); 44 } 45 } 46 | Popular Tags |