1 22 package org.jboss.test.webservice.jbws358; 23 24 import java.rmi.RemoteException ; 25 26 import javax.naming.InitialContext ; 27 import javax.xml.rpc.Service ; 28 29 import junit.framework.Test; 30 31 import org.jboss.test.webservice.WebserviceTestBase; 32 33 41 public class JBWS358TestCase extends WebserviceTestBase 42 { 43 public JBWS358TestCase(String name) 44 { 45 super(name); 46 } 47 48 public void testClientAccess() throws Exception 49 { 50 Hello endpoint = null; 51 try 52 { 53 deploy("ws4ee-jbws358.ear"); 54 55 InitialContext iniCtx = getClientContext(); 56 Service service = (Service )iniCtx.lookup("java:comp/env/service/HelloService"); 57 endpoint = (Hello)service.getPort(Hello.class); 58 59 String retStr = endpoint.hello("Hello Server"); 60 assertEquals("Hello Server", retStr); 61 } 62 finally 63 { 64 undeploy("ws4ee-jbws358.ear"); 65 } 66 67 try 68 { 69 endpoint.hello("Hello Server"); 70 fail("Endpoint should not be available"); 71 } 72 catch (RemoteException ex) 73 { 74 } 76 } 77 78 } 79 | Popular Tags |