1 22 package org.jboss.test.web.test; 23 24 import java.net.URL ; 25 26 import junit.framework.Test; 27 28 import org.apache.commons.httpclient.Header; 29 import org.apache.commons.httpclient.HttpMethodBase; 30 import org.jboss.test.JBossTestCase; 31 import org.jboss.test.util.web.HttpUtils; 32 33 38 public class AltDDUnitTestCase extends JBossTestCase 39 { 40 private String baseURL = HttpUtils.getBaseURL(); 41 42 public static Test suite() throws Exception 43 { 44 return getDeploySetup(AltDDUnitTestCase.class, "altdd-web.ear"); 45 } 46 47 public AltDDUnitTestCase(String name) 48 { 49 super(name); 50 } 51 52 55 public void testAltRequestInfoServlet() 56 throws Exception 57 { 58 URL url = new URL (baseURL+"altdd-test/AltRequestInfoServlet"); 59 HttpMethodBase request = HttpUtils.accessURL(url); 60 Header errors = request.getResponseHeader("X-Exception"); 61 log.info("X-Exception: "+errors); 62 assertTrue("X-Exception("+errors+") is null", errors == null); 63 } 64 65 68 public void testAltRequestInfoServlet2() 69 throws Exception 70 { 71 URL url = new URL (baseURL+"altdd-test/AltRequestInfoServlet2"); 72 HttpMethodBase request = HttpUtils.accessURL(url); 73 Header errors = request.getResponseHeader("X-Exception"); 74 log.info("X-Exception: "+errors); 75 assertTrue("X-Exception("+errors+") is null", errors == null); 76 } 77 } 78 | Popular Tags |