KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tonbeller > wcf > web > HttpUnitTestCase


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 JavaDoc servletUrl;
13
14   public HttpUnitTestCase(String JavaDoc arg0) {
15     super(arg0);
16   }
17
18   protected void setUp() throws Exception JavaDoc {
19     super.setUp();
20     servletUrl = System.getProperty("httpunit.url");
21     if (servletUrl == null)
22       throw new RuntimeException JavaDoc("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