Package org.servicemix.components.xfire

Source Code of org.servicemix.components.xfire.XFireBindingTest

package org.servicemix.components.xfire;

import javax.xml.namespace.QName;
import javax.xml.transform.Source;

import org.servicemix.TestSupport;
import org.springframework.context.support.AbstractXmlApplicationContext;
import org.xbean.spring.context.ClassPathXmlApplicationContext;
import org.w3c.dom.Node;

public class XFireBindingTest extends TestSupport {

    public void testSendingAndReceivingMessagesUsingSpring() throws Exception {
        Object answer = requestServiceWithFileRequest(new QName("http://xfire.components.servicemix.org", "Echo"),
                "/org/servicemix/components/xfire/echo.xml");
        assertTrue("Shoud return a DOM Node: " + answer, answer instanceof Node);
        Node node = (Node) answer;
        System.out.println(transformer.toString(node));
       
        Echo echo = (Echo) context.getBean("xfireReceiverService");
        assertEquals(1, echo.getCount());
    }

    protected AbstractXmlApplicationContext createBeanFactory() {
        return new ClassPathXmlApplicationContext(new String[] {
                "/org/servicemix/components/xfire/xfire-inout.xml",
                "/org/codehaus/xfire/spring/xfire.xml"
        });
    }
}
TOP

Related Classes of org.servicemix.components.xfire.XFireBindingTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.