1 17 package org.apache.servicemix.components.xslt; 18 19 import org.apache.servicemix.tck.MessageList; 20 import org.apache.servicemix.tck.TestSupport; 21 import org.springframework.context.support.AbstractXmlApplicationContext; 22 import org.apache.xbean.spring.context.ClassPathXmlApplicationContext; 23 24 import javax.xml.namespace.QName ; 25 26 29 public class XsltPublisherTest extends TestSupport { 30 31 public void testUseXsltAsRouter() throws Exception { 32 QName service = new QName ("http://servicemix.org/cheese/", "transformer"); 33 34 sendMessages(service, 20); 35 assertMessagesReceived(20); 36 37 MessageList messageList1 = assertMessagesReceived("service1", 20); 38 MessageList messageList2 = assertMessagesReceived("service2", 20); 39 MessageList messageList3 = assertMessagesReceived("service3", 20); 40 41 assertMessageHeader(messageList1, 0, "foo", "hello world!"); 42 assertMessageHeader(messageList1, 1, "foo", "hello world!"); 43 assertMessageHeader(messageList1, 19, "foo", "hello world!"); 44 45 assertMessageHeader(messageList2, 0, "bar", "1"); 46 assertMessageHeader(messageList2, 1, "bar", "2"); 47 48 assertMessageHeader(messageList3, 0, "bar", "1"); 49 assertMessageHeader(messageList3, 1, "bar", "2"); 50 assertMessageHeader(messageList3, 0, "foo", "hello world!"); 51 assertMessageHeader(messageList3, 1, "foo", "hello world!"); 52 assertMessageHeader(messageList3, 19, "foo", "hello world!"); 53 } 54 55 protected AbstractXmlApplicationContext createBeanFactory() { 56 return new ClassPathXmlApplicationContext("org/apache/servicemix/components/xslt/publish.xml"); 57 } 58 } 59 | Popular Tags |