1 22 package org.jboss.test.webservice.jbws381; 23 24 import junit.framework.Test; 25 import org.jboss.test.webservice.WebserviceTestBase; 26 27 import javax.naming.InitialContext ; 28 import javax.xml.rpc.Service ; 29 30 39 public class JBWS381TestCase extends WebserviceTestBase 40 { 41 private WeatherForecastSoap port; 42 43 45 public JBWS381TestCase(String name) 46 { 47 super(name); 48 } 49 50 51 public static Test suite() throws Exception  52 { 53 return getDeploySetup(JBWS381TestCase.class, "ws4ee-jbws381.war, ws4ee-jbws381-client.jar"); 54 } 55 56 protected void setUp() throws Exception  57 { 58 super.setUp(); 59 if (port == null) 60 { 61 InitialContext iniCtx = getClientContext(); 62 Service service = (Service )iniCtx.lookup("java:comp/env/service/TestService"); 63 port = (WeatherForecastSoap)service.getPort(WeatherForecastSoap.class); 64 } 65 } 66 67 public void testWeatherByPlaceName() throws Exception  68 { 69 GetWeatherByPlaceNameResponse retObj = port.getWeatherByPlaceName(new GetWeatherByPlaceName("Munich")); 70 assertNotNull("Expected not null", retObj.getWeatherByPlaceNameResult); 71 } 72 73 public void testWeatherByZipCode() throws Exception  74 { 75 GetWeatherByZipCodeResponse retObj = port.getWeatherByZipCode(new GetWeatherByZipCode("80634")); 76 assertNotNull("Expected not null", retObj); 77 } 78 } 79 | Popular Tags |