| 1 package com.tonbeller.wcf.web; 2 3 import junit.framework.TestCase; 4 5 import com.meterware.httpunit.WebConversation; 6 import com.tonbeller.tbutils.httpunit.HttpUnitUtils; 7 8 public abstract class HttpUnitTestCase extends TestCase { 9 10 protected HttpUnitUtils utils; 11 protected WebConversation wc; 12 protected String servletUrl; 13 14 public HttpUnitTestCase(String arg0) { 15 super(arg0); 16 } 17 18 protected void setUp() throws Exception { 19 super.setUp(); 20 servletUrl = System.getProperty("httpunit.url"); 21 if (servletUrl == null) 22 throw new RuntimeException ("missing JVM Parameter httpunit.url, e.g. -Dhttpunit.url=http://localhost:8080/appname"); 23 wc = new WebConversation(); 24 wc.setHeaderField("accept-language", "en-US"); 25 26 utils = new HttpUnitUtils(wc); 27 } 28 29 } 30 | Popular Tags |