KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > xml > xmlc > xml > XmlBasicTest


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

23
24 package org.enhydra.xml.xmlc.xml;
25
26 import java.io.File JavaDoc;
27
28 import org.enhydra.xml.xmlc.driver.ExecXmlc;
29 import org.enhydra.xml.xmlc.driver.XmlcBasicTest;
30 import org.enhydra.xml.xmlc.driver.XmlcTestCaseBase;
31
32 /**
33  * Class to run a basic set of XMLC tests on XML files given a set of
34  * parameters. This is extended to implement specific test cases.
35  */

36 public class XmlBasicTest extends XmlcBasicTest {
37     /**
38      * Constructor.
39      * @param dtdEntity DTD to copy to the directory contain the
40      * document on recompile. Null if none.
41      */

42     public XmlBasicTest(XmlTestCaseBase testCase,
43                         File JavaDoc inputDoc,
44                         File JavaDoc dtdEntity) {
45         super(testCase, "xml", inputDoc);
46         if (dtdEntity != null) {
47             addExtraSrcFile(dtdEntity);
48         }
49     }
50
51     /**
52      * Build a ExecXmlc object with argument required for the initial compile
53      * and the recompile/dump
54      */

55     protected void addStdOpts(ExecXmlc execXmlc) {
56     }
57
58     /**
59      * Disable validation
60      */

61     public void noValidation() {
62         addBoth(ExecXmlc.OPT_VALIDATE, ExecXmlc.NO);
63     }
64
65     /**
66      * Add entities used by the input/xml-examples files to tests.
67      */

68     public void addXmlExampleCopyEntities() {
69         XmlcTestCaseBase test = getTestCase();
70         addExtraSrcFile(test.getInputFile("xml-examples/address.dtd"));
71         addExtraSrcFile(test.getInputFile("xml-examples/body.dtd"));
72         addExtraSrcFile(test.getInputFile("xml-examples/body.xml"));
73         addExtraSrcFile(test.getInputFile("xml-examples/document.dtd"));
74         addExtraSrcFile(test.getInputFile("xml-examples/family.dtd"));
75         addExtraSrcFile(test.getInputFile("xml-examples/footer.dtd"));
76         addExtraSrcFile(test.getInputFile("xml-examples/footer.xml"));
77         addExtraSrcFile(test.getInputFile("xml-examples/header.dtd"));
78         addExtraSrcFile(test.getInputFile("xml-examples/header.xml"));
79         addExtraSrcFile(test.getInputFile("xml-examples/person.dtd"));
80         addExtraSrcFile(test.getInputFile("xml-examples/publisher.dtd"));
81     }
82 }
83
Popular Tags