KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > xml > xmlc > ssi > BasicTests


1 /*
2  * Enhydra Java Application Server Project
3  *
4  * The contents of this file are subject to the Enhydra Public License
5  * Version 1.1 (the "License"); you may not use this file except in
6  * compliance with the License. You may obtain a copy of the License on
7  * the Enhydra web site ( http://www.enhydra.org/ ).
8  *
9  * Software distributed under the License is distributed on an "AS IS"
10  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
11  * the License for the specific terms governing rights and limitations
12  * under the License.
13  *
14  * The Initial Developer of the Enhydra Application Server is Lutris
15  * Technologies, Inc. The Enhydra Application Server and portions created
16  * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
17  * All Rights Reserved.
18  *
19  * Contributor(s):
20  *
21  * $Id: BasicTests.java,v 1.2 2005/01/26 08:29:25 jkjome Exp $
22  */

23
24 package org.enhydra.xml.xmlc.ssi;
25
26 import java.lang.reflect.Method JavaDoc;
27
28 import junit.framework.Test;
29
30 import org.enhydra.xml.driver.TestCaseBase;
31
32 /**
33  * Test of SSI parsing.
34  */

35 public class BasicTests extends TestCaseBase {
36     /** Factory method to create suite of these tests */
37     public static Test suite() {
38         return createSuite(BasicTests.class, null);
39     }
40     
41     /** Required Constructor */
42     public BasicTests(Method JavaDoc method) {
43         super(method);
44     }
45     
46     /**
47      * Test 1: readsize 13
48      */

49     public void test1() {
50         SSIRead test = new SSIRead(this, 13);
51     test.runOkTest("basic-top.html");
52     }
53
54     /**
55      * Test 2: readsize 36
56      */

57     public void test2() {
58         SSIRead test = new SSIRead(this, 36);
59     test.runOkTest("basic-top.html");
60     }
61
62     /**
63      * Test 3: readsize 1300
64      */

65     public void test3() {
66         SSIRead test = new SSIRead(this, 1300);
67     test.runOkTest("basic-top.html");
68     }
69
70     /**
71      * Test 4: readsize 8
72      */

73     public void test4() {
74         SSIRead test = new SSIRead(this, 8);
75     test.runOkTest("basic-top.html");
76     }
77
78     /**
79      * Test 5: single character read
80      */

81     public void test5() {
82         SSIRead test = new SSIRead(this, 1);
83     test.runOkTest("basic-top.html");
84     }
85
86     /**
87      * Test 6: nested includes
88      */

89     public void test6() {
90         SSIRead test = new SSIRead(this);
91     test.runOkTest("corner-1.html");
92     }
93
94     /**
95      * Test 7: Corner case on file content
96      */

97     public void test7() {
98         SSIRead test = new SSIRead(this);
99     test.runOkTest("corner-2.html");
100     }
101
102     /**
103      * Test 8: Corner case on file content
104      */

105     public void test8() {
106         SSIRead test = new SSIRead(this);
107     test.runOkTest("corner-3.html");
108     }
109
110     /**
111      * Test 9: Corner case on file content
112      */

113     public void test9() {
114         SSIRead test = new SSIRead(this);
115     test.runOkTest("corner-4.html");
116     }
117
118     /**
119      * Test 10: Corner case on file content
120      */

121     public void test10() {
122         SSIRead test = new SSIRead(this);
123     test.runOkTest("corner-5.html");
124     }
125
126     /**
127      * Test 11: Corner case on file content
128      */

129     public void test11() {
130         SSIRead test = new SSIRead(this);
131     test.runOkTest("large1-top.html");
132     }
133
134     /**
135      * Test 12: Corner case on SSI directive
136      */

137     public void test12() {
138         SSIRead test = new SSIRead(this);
139     test.runOkTest("legal-ssi-1.html");
140     }
141
142     /**
143      * Test 13: Corner case on SSI directive
144      */

145     public void test13() {
146         SSIRead test = new SSIRead(this);
147     test.runOkTest("legal-ssi-2.html");
148     }
149
150     /**
151      * Test 14: Corner case on SSI directive
152      */

153     public void test14() {
154         SSIRead test = new SSIRead(this);
155     test.runOkTest("legal-ssi-3.html");
156     }
157
158     /**
159      * Test 15: Corner case on SSI directive
160      */

161     public void test15() {
162         SSIRead test = new SSIRead(this);
163     test.runOkTest("legal-ssi-4.html");
164     }
165
166     /**
167      * Test 16: Relative include
168      */

169     public void test16() {
170         SSIRead test = new SSIRead(this);
171     test.runOkTest("one/two/rel-1.html");
172     }
173
174     /**
175      * Test 17: Relative include
176      */

177     public void test17() {
178         SSIRead test = new SSIRead(this);
179     test.runOkTest("rel-2.html");
180     }
181
182     /**
183      * Test 18: Multiple includes in the same directive
184      */

185     public void test18() {
186         SSIRead test = new SSIRead(this);
187     test.runOkTest("multiple-1.html");
188     }
189
190     /**
191      * Test 19: Multiple includes in the same directive
192      */

193     public void test19() {
194         SSIRead test = new SSIRead(this);
195     test.runOkTest("multiple-2.html");
196     }
197
198     /**
199      * Test 20: Multiple includes in the same directive
200      */

201     public void test20() {
202         SSIRead test = new SSIRead(this);
203     test.runOkTest("multiple-3.html");
204     }
205
206     /**
207      * Test 21: Another failure due to SSI alignment
208      */

209     public void test21() {
210         SSIRead test = new SSIRead(this);
211     test.runOkTest("seetheerror.html");
212     }
213 }
214
Popular Tags