1 7 package org.jboss.test.jbossnet.message; 8 9 11 import junit.framework.Test; 12 import org.jboss.axis.utils.DOM2Utils; 13 import org.jboss.test.JBossTestCase; 14 import org.jboss.test.jbossnet.JBossNetTestBase; 15 import org.w3c.dom.Document ; 16 17 import javax.xml.namespace.QName ; 18 import javax.xml.parsers.DocumentBuilder ; 19 import javax.xml.rpc.Call ; 20 import javax.xml.rpc.Service ; 21 import javax.xml.rpc.ServiceFactory ; 22 import java.io.ByteArrayInputStream ; 23 import java.net.URL ; 24 25 31 public class MessageTestCase extends JBossNetTestBase 32 { 33 public static final String xmlstr = "<root><child>Hello</child><child>World</child></root>"; 34 35 public MessageTestCase(String name) 36 { 37 super(name); 38 } 39 40 42 public void testProcessMessage() throws Exception 43 { 44 DocumentBuilder builder = DOM2Utils.getDocumentBuilder(); 45 Document doc = builder.parse(new ByteArrayInputStream (xmlstr.getBytes())); 46 47 String namespaceURI = "http://jboss.net/message"; 48 URL wsdlURL = new URL (SERVICES_LOCATION + "/MessageServer?wsdl"); 49 Service service = createService(wsdlURL, new QName (namespaceURI, "MessageServerService")); 50 Call call = service.createCall(new QName (namespaceURI, "MessageServer"), "processMessage"); 51 52 Object retObj = call.invoke(new Object []{doc}); 53 assertNotNull("Return obj is null", retObj); 54 } 55 56 57 public static Test suite() throws Exception 58 { 59 return getDeploySetup(MessageTestCase.class, "jbossnet-message.wsr"); 60 } 61 62 } 63 | Popular Tags |