1 22 package org.jboss.test.webservice.jbws251; 23 24 import javax.naming.InitialContext ; 25 import javax.xml.rpc.Service ; 26 27 import junit.framework.Test; 28 29 import org.jboss.test.webservice.WebserviceTestBase; 30 31 39 public class JBWS251TestCase extends WebserviceTestBase 40 { 41 private static Hello hello; 42 43 public JBWS251TestCase(String name) 44 { 45 super(name); 46 } 47 48 49 public static Test suite() throws Exception 50 { 51 return getDeploySetup(JBWS251TestCase.class, "ws4ee-jbws251.war, ws4ee-jbws251-client.jar"); 52 } 53 54 public void setUp() throws Exception 55 { 56 super.setUp(); 57 if (hello == null) 58 { 59 InitialContext iniCtx = getClientContext(); 60 Service service = (Service )iniCtx.lookup("java:comp/env/service/HelloService"); 61 hello = (Hello)service.getPort(Hello.class); 62 } 63 } 64 65 public void testNoException() throws Exception 66 { 67 String inStr = "Kermit"; 68 String retStr = hello.hello(inStr); 69 assertEquals(inStr, retStr); 70 } 71 72 public void testUserExceptionOne() throws Exception 73 { 74 try 75 { 76 hello.hello("UserExceptionOne"); 77 fail("UserExceptionOne expected"); 78 } 79 catch (UserExceptionOne ex) 80 { 81 } 83 } 84 85 public void testUserExceptionTwo() throws Exception 86 { 87 try 88 { 89 hello.hello("UserExceptionTwo"); 90 fail("UserExceptionTwo expected"); 91 } 92 catch (UserExceptionTwo ex) 93 { 94 } 96 } 97 } 98 | Popular Tags |