01: /*
02: * Created on 15.10.2004
03: *
04: * TODO To change the template for this generated file go to
05: * Window - Preferences - Java - Code Style - Code Templates
06: */
07: package org.jzonic.webtester;
08:
09: import java.util.Map;
10:
11: import org.jzonic.webtester.writer.*;
12: import junit.framework.TestCase;
13:
14: /**
15: * @author Mecky
16: *
17: * TODO To change the template for this generated type comment go to
18: * Window - Preferences - Java - Code Style - Code Templates
19: */
20: public class MoreInternalFormWebTest extends TestCase {
21:
22: private SimpleWebServer server;
23:
24: public void setUp() throws Exception {
25: server = new SimpleWebServer();
26: }
27:
28: public void tearDown() {
29: server.shutdown();
30: }
31:
32: public void testForm() {
33: WebTestFileReader reader = new WebTestFileReader();
34: WebTestResult result = reader
35: .parseFile("internal_test/form.test");
36: Map params = server.getParameters();
37: assertTrue(result.isSuccess());
38: assertEquals("My+NAME", (String) params.get("name"));
39: assertEquals("20", (String) params.get("age"));
40: assertEquals("Hello+world", (String) params.get("text"));
41: assertEquals("1", (String) params.get("mode"));
42: assertEquals("yes", (String) params.get("create"));
43: WebTestResultWriter writer = new WebTestResultFileWriter(
44: "huhu.html");
45: writer.generateResult(result);
46: }
47: }
|