1 17 package org.apache.servicemix.components.saaj; 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 29 public class SaajTest extends TestSupport { 30 31 protected String quote = "SUNW"; 32 33 public void testCurrencyQuotes() throws Exception { 34 QName serviceName = new QName ("http://servicemix.org/cheese/", "stockQuote"); 35 String file = "request.xml"; 36 37 Object answer = requestServiceWithFileRequest(serviceName, file); 38 assertTrue("Shoud return a DOM Node: " + answer, answer instanceof Node ); 39 Node node = (Node ) answer; 40 System.out.println(transformer.toString(node)); 41 42 String text = textValueOfXPath(node, "//Result").trim(); 43 44 System.out.println("Found price: " + text); 45 46 assertTrue("price text should not be empty", text.length() > 0); 47 48 } 49 50 protected AbstractXmlApplicationContext createBeanFactory() { 51 return new ClassPathXmlApplicationContext("org/apache/servicemix/components/saaj/example.xml"); 52 } 53 } 54 | Popular Tags |