1 22 package org.jboss.test.webservice.jbws165; 23 24 import javax.naming.InitialContext ; 25 import javax.xml.namespace.QName ; 26 import javax.xml.rpc.Service ; 27 28 import junit.framework.Test; 29 30 import org.jboss.test.webservice.WebserviceTestBase; 31 32 38 public class JBWS165TestCase extends WebserviceTestBase 39 { 40 43 public JBWS165TestCase(String name) 44 { 45 super(name); 46 } 47 48 49 public static Test suite() throws Exception 50 { 51 return getDeploySetup(JBWS165TestCase.class, "ws4ee-jbws165.ear"); 52 } 53 54 public void testNone() throws Exception 55 { 56 InitialContext iniCtx = getClientContext(); 57 Service service = (Service ) iniCtx.lookup("java:comp/env/service/HelloNone"); 58 Hello port = (Hello) service.getPort(Hello.class); 59 String retObj = port.hello(getName()); 60 assertEquals(getName(), retObj); 61 } 62 63 public void testPortComponentURIOne() throws Exception 64 { 65 InitialContext iniCtx = getClientContext(); 66 Service service = (Service ) iniCtx.lookup("java:comp/env/service/HelloPCOne"); 67 QName portName = new QName ("http://org.jboss.test.webservice/jbws165", "HelloPortOne"); 68 Hello port = (Hello) service.getPort(portName, Hello.class); 69 String retObj = port.hello(getName()); 70 assertEquals(getName(), retObj); 71 } 72 73 public void testPortComponentURITwo() throws Exception 74 { 75 InitialContext iniCtx = getClientContext(); 76 Service service = (Service ) iniCtx.lookup("java:comp/env/service/HelloPCTwo"); 77 QName portName = new QName ("http://org.jboss.test.webservice/jbws165", "HelloPortTwo"); 78 Hello port = (Hello) service.getPort(portName, Hello.class); 79 String retObj = port.hello(getName()); 80 assertEquals(getName(), retObj); 81 } 82 83 public void testContextRoot() throws Exception 84 { 85 InitialContext iniCtx = getClientContext(); 86 Service service = (Service ) iniCtx.lookup("java:comp/env/service/HelloContextRoot"); 87 Hello port = (Hello) service.getPort(Hello.class); 88 String retObj = port.hello(getName()); 89 assertEquals(getName(), retObj); 90 } 91 92 public void testBoth() throws Exception 93 { 94 InitialContext iniCtx = getClientContext(); 95 Service service = (Service ) iniCtx.lookup("java:comp/env/service/HelloBoth"); 96 Hello port = (Hello) service.getPort(Hello.class); 97 String retObj = port.hello(getName()); 98 assertEquals(getName(), retObj); 99 } 100 } 101 | Popular Tags |