1 22 package org.jboss.test.webservice.samples; 23 24 import java.io.BufferedReader ; 25 import java.io.InputStreamReader ; 26 import java.net.URL ; 27 28 import junit.framework.Test; 29 30 import org.jboss.test.webservice.WebserviceTestBase; 31 32 38 public class ClientSideJSETestCase extends WebserviceTestBase 39 { 40 41 public ClientSideJSETestCase(String name) 42 { 43 super(name); 44 } 45 46 47 public static Test suite() throws Exception 48 { 49 return getDeploySetup(ClientSideJSETestCase.class, "ws4ee-samples-server-jse.war, ws4ee-samples-server-ejb.jar, ws4ee-samples-client-web.war"); 50 } 51 52 53 public void testServletClientAccessEJB() throws Exception 54 { 55 URL url = new URL ("http://" + getServerHost() + ":8080/ws4ee-samples-client-web?organization=mafia&endpoint=EJB&method=info"); 56 BufferedReader br = new BufferedReader (new InputStreamReader (url.openStream())); 57 String info = br.readLine(); 58 assertEquals("The 'mafia' boss is currently out of office, please call again.", info); 59 } 60 61 62 public void testServletClientAccessJSESimple() throws Exception 63 { 64 URL url = new URL ("http://" + getServerHost() + ":8080/ws4ee-samples-client-web?organization=mafia&endpoint=JSE&method=info"); 65 BufferedReader br = new BufferedReader (new InputStreamReader (url.openStream())); 66 String info = br.readLine(); 67 assertEquals("The 'mafia' boss is currently out of office, please call again.", info); 68 } 69 } 70 | Popular Tags |