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 org.jzonic.webtester.writer.WebTestResultConsoleWriter;
10:
11: import junit.framework.TestCase;
12:
13: /**
14: * @author Mecky
15: *
16: */
17: public class WebTestFileReaderTest extends TestCase {
18:
19: public void testReadFile() {
20: WebTestFileReader reader = new WebTestFileReader();
21: WebTestResult result = reader
22: .parseFile("testcases/google.test");
23: assertTrue(result.isSuccess());
24: WebTestResultConsoleWriter writer = new WebTestResultConsoleWriter();
25: writer.generateResult(result);
26: }
27:
28: public void testReadFileNotFound() {
29: WebTestFileReader reader = new WebTestFileReader();
30: WebTestResult result = reader
31: .parseFile("testcases/google_test.txt");
32: assertTrue(!result.isSuccess());
33: WebTestResultConsoleWriter writer = new WebTestResultConsoleWriter();
34: writer.generateResult(result);
35: }
36:
37: public void testIncludeTasks() {
38: WebTestFileReader reader = new WebTestFileReader();
39: WebTestResult result = reader
40: .parseFile("testcases/include.test");
41: assertTrue(result.isSuccess());
42: WebTestResultConsoleWriter writer = new WebTestResultConsoleWriter();
43: writer.generateResult(result);
44: }
45:
46: public void testReversIncludeTasks() {
47: WebTestFileReader reader = new WebTestFileReader();
48: WebTestResult result = reader
49: .parseFile("testcases/rev_include2.test");
50: assertTrue(!result.isSuccess());
51: WebTestResultConsoleWriter writer = new WebTestResultConsoleWriter();
52: writer.generateResult(result);
53: }
54: }
|