1 22 package org.jboss.test.webservice.jbws464; 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 JBWS464TestCase extends WebserviceTestBase 42 { 43 private static Hello hello; 44 45 public JBWS464TestCase(String name) 46 { 47 super(name); 48 } 49 50 public static Test suite() throws Exception 51 { 52 return getDeploySetup(JBWS464TestCase.class, "ws4ee-jbws464.war, ws4ee-jbws464-client.jar"); 53 } 54 55 public void setUp() throws Exception 56 { 57 super.setUp(); 58 if (hello == null) 59 { 60 InitialContext iniCtx = getClientContext(); 61 Service service = (Service )iniCtx.lookup("java:comp/env/service/HelloService"); 62 hello = (Hello)service.getPort(Hello.class); 63 } 64 } 65 66 public void testValidAccess() throws Exception 67 { 68 String retObj = hello.hello("Hello Server"); 69 assertEquals("Hello Server", retObj); 70 } 71 72 73 public void testInvalidAccess() throws Exception 75 { 76 try 77 { 78 hello.hello(null); 79 fail("Test should have thrown an exception"); 80 }catch(RemoteException e) 81 { 82 } 84 } 85 } 86 | Popular Tags |