KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > xml > xmlc > html > SSITests


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: SSITests.java,v 1.2 2005/01/26 08:29:25 jkjome Exp $
22  */

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

35 public class SSITests extends HtmlTestCaseBase {
36     /** Factory method to create suite of these tests */
37     public static Test suite() {
38         return createSuite(SSITests.class, null);
39     }
40
41     /** Constructor */
42     public SSITests(Method JavaDoc method) {
43         super(method);
44     }
45
46     /*
47      * Test 1: Parse file without processing SSI
48      */

49     public void test1() {
50         HtmlBasicTest test = createTest("ssiTestPage1.html");
51         test.addOptionFile(getInputFile("testPage1.xmlc"));
52         test.basicTest();
53     }
54
55     /*
56      * Test 2: Now process SSI.
57      */

58     public void test2() {
59         HtmlBasicTest test = createTest("ssiTestPage1.html");
60         // Need to copy included file if we are doing a recomp tests
61
if (fParams.getReloading()) {
62             TestFileOps.copyFileToDir(getInputFile("ssiTestIncl1.html"),
63                                       getResultsDir());
64         }
65         test.addFirst(ExecXmlc.OPT_SSI);
66         test.addOptionFile(getInputFile("testPage1.xmlc"));
67         test.basicTest();
68     }
69
70     /*
71      * Test 3: Include with relative path
72      */

73     public void test3() {
74         HtmlBasicTest test = createTest("ssiTestPage2.html");
75         test.addFirst(ExecXmlc.OPT_SSI);
76         test.addOptionFile(getInputFile("testPage1.xmlc"));
77         test.basicTest();
78     }
79
80     /*
81      * Test 4: This test file broke SSI when it had CR/LF EOLNs.
82      * This was not actually a problem with CR/LF, but with SSI's buffer
83      * expansion.
84      */

85     public void test4() {
86         HtmlBasicTest test = createTest("cr-lf/Login.html");
87         test.addFirst(ExecXmlc.OPT_SSI);
88         test.basicTest();
89     }
90 }
91
Popular Tags