1 17 package org.apache.geronimo.itests.naming.war; 18 19 import junit.framework.TestCase; 20 import org.apache.commons.httpclient.HttpClient; 21 import org.apache.commons.httpclient.methods.GetMethod; 22 23 26 public class ServletTest extends TestCase { 27 28 public void testWebService() throws Exception { 29 HttpClient httpClient = new HttpClient(); 30 GetMethod getMethod = new GetMethod("http://localhost:8080/geronimo/itests/naming/NamingTestServlet"); 31 httpClient.executeMethod(getMethod); 32 String response = getMethod.getResponseBodyAsString(); 33 if (response != null && !response.equals("")) { 35 fail("Received output " + response); 36 } 37 } 38 39 } 40 | Popular Tags |