KickJava   Java API By Example, From Geeks To Geeks.

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


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

23
24 package org.enhydra.xml.xmlc.html;
25
26 import java.io.File JavaDoc;
27 import java.lang.reflect.Method JavaDoc;
28
29 import org.enhydra.xml.xmlc.driver.ExecXmlc;
30 import org.enhydra.xml.xmlc.driver.XmlcTestCaseBase;
31 import org.enhydra.xml.xmlc.driver.XmlcTestParams;
32
33 /**
34  * Base class for all XMLC HTML test cases. Contains methods to
35  * assist in setting up individual tests.
36  */

37 public class HtmlTestCaseBase extends XmlcTestCaseBase {
38     /** HTML encoding to use */
39     private String JavaDoc fHtmlEncoding;
40
41     /** Construct specifying */
42     protected HtmlTestCaseBase(Method JavaDoc method) {
43         super(method, XmlcTestParams.getParams(false));
44     }
45
46     /** Create a new test object */
47     protected HtmlBasicTest createTest(String JavaDoc inputDoc) {
48         return new HtmlBasicTest(this, getInputFile(inputDoc));
49     }
50
51     /** Create a new test object */
52     protected HtmlBasicTest createTest(File JavaDoc inputDoc) {
53         return new HtmlBasicTest(this, inputDoc);
54     }
55
56     /** Create a new test object with the lutris-index.html file */
57     protected HtmlBasicTest createLutrisIndexTest() {
58         HtmlBasicTest test = createTest("lutris-index.html");
59         test.addCyberStudioTags();
60         return test;
61     }
62
63
64     /** Set the HTML encoding to use. */
65     public void setHtmlEncoding(String JavaDoc encoding) {
66         fHtmlEncoding = encoding;
67     }
68
69     /**
70      * Build a ExecXmlc object with argument required for the initial compile
71      * and the recompile/dump
72      */

73     public void addStdOpts(ExecXmlc execXmlc) {
74         if (fHtmlEncoding != null) {
75             execXmlc.addOpt(ExecXmlc.OPT_HTML_ENCODING, fHtmlEncoding);
76         }
77     }
78 }
79
Popular Tags