1 22 package org.jboss.test.webservice.samples; 23 24 import junit.framework.Test; 25 import org.jboss.test.JBossTestCase; 26 27 import javax.xml.namespace.QName ; 28 import javax.xml.rpc.Service ; 29 import javax.xml.rpc.ServiceFactory ; 30 import java.net.URL ; 31 32 33 40 public class ServerSideEJBTestCase extends JBossTestCase 41 { 42 public ServerSideEJBTestCase(String name) 43 { 44 super(name); 45 } 46 47 48 public static Test suite() throws Exception  49 { 50 return getDeploySetup(ServerSideEJBTestCase.class, "ws4ee-samples-server-ejb.jar"); 51 } 52 53 public void testEJBEndpointAccess() throws Exception  54 { 55 URL url = new URL ("http://" + getServerHost() + ":8080/ws4ee-samples-server-ejb/Organization?wsdl"); 56 QName qname = new QName ("http://org.jboss.test.webservice/samples", "OrganizationService"); 57 ServiceFactory factory = ServiceFactory.newInstance(); 58 Service service = factory.createService(url, qname); 59 60 Organization endpoint = (Organization)service.getPort(Organization.class); 61 String info = endpoint.getContactInfo("mafia"); 62 assertEquals("The 'mafia' boss is currently out of office, please call again.", info); 63 } 64 } 65 | Popular Tags |