KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > freemarker > testcase > FreeMarkerTestSuite


1 /*
2  * Copyright (c) 2003 The Visigoth Software Society. All rights
3  * reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * 1. Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * 2. Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in
14  * the documentation and/or other materials provided with the
15  * distribution.
16  *
17  * 3. The end-user documentation included with the redistribution, if
18  * any, must include the following acknowledgement:
19  * "This product includes software developed by the
20  * Visigoth Software Society (http://www.visigoths.org/)."
21  * Alternately, this acknowledgement may appear in the software itself,
22  * if and wherever such third-party acknowledgements normally appear.
23  *
24  * 4. Neither the name "FreeMarker", "Visigoth", nor any of the names of the
25  * project contributors may be used to endorse or promote products derived
26  * from this software without prior written permission. For written
27  * permission, please contact visigoths@visigoths.org.
28  *
29  * 5. Products derived from this software may not be called "FreeMarker" or "Visigoth"
30  * nor may "FreeMarker" or "Visigoth" appear in their names
31  * without prior written permission of the Visigoth Software Society.
32  *
33  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
34  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
35  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
36  * DISCLAIMED. IN NO EVENT SHALL THE VISIGOTH SOFTWARE SOCIETY OR
37  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
38  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
39  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
40  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
41  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
42  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
43  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
44  * SUCH DAMAGE.
45  * ====================================================================
46  *
47  * This software consists of voluntary contributions made by many
48  * individuals on behalf of the Visigoth Software Society. For more
49  * information on the Visigoth Software Society, please see
50  * http://www.visigoths.org/
51  */

52
53 package freemarker.testcase;
54
55 import junit.framework.Test;
56 import junit.framework.TestSuite;
57 import freemarker.ext.dom.NodeModel;
58 import freemarker.testcase.servlets.TestJspTaglibs;
59
60 /**
61  * Test suite for FreeMarker. The suite conforms to interface expected by
62  * <a HREF="http://junit.sourceforge.net/" target="_top">JUnit</a>.
63  *
64  * @version $Id: FreeMarkerTestSuite.java,v 1.85 2004/11/28 12:58:34 ddekany Exp $
65  */

66 public class FreeMarkerTestSuite {
67 /*
68     static {
69         try {
70             freemarker.ext.dom.NodeModel.useJaxenXPathSupport();
71         } catch (Exception e) {
72             e.printStackTrace();
73         }
74     }*/

75
76     public static Test suite() throws Exception JavaDoc {
77         TestSuite suite = new TestSuite();
78 NodeModel.useJaxenXPathSupport();
79         suite.addTest( new TestComment( "commentTest" ));
80         suite.addTest( new TestVariables( "variableTest" ));
81         suite.addTest( new TestBoolean( "booleanTest" ));
82         suite.addTest( new TestMultiModels( "multiModelTest" ));
83         suite.addTest( new TestNoParse( "noParseTest" ));
84         suite.addTest( new TestTransform( "transformTest" ));
85         suite.addTest( new TestCompress( "compressionTest" ));
86         suite.addTest( new TestLastCharacter( "lastCharacterTest" ));
87         suite.addTest( new TestListIterators( "listIteratorTest" ));
88         suite.addTest( new TestListLiteral( "listLiteralTest" ));
89         suite.addTest( new TestHashLiteral( "hashLiteralTest" ));
90         suite.addTest( new TestNumberLiteral( "numberLiteralTest" ));
91         suite.addTest( new TestNewlines1( "newlineTest1" ));
92         suite.addTest( new TestNewlines2( "newlineTest2" ));
93         suite.addTest( new TestComparisons( "comparisonTest" ));
94         suite.addTest( new TestIdentifier( "testIdentifier" ));
95         suite.addTest( new TestPrecedence( "testPrecedence" ));
96         suite.addTest( new TestFunction( "testFunction" ));
97         suite.addTest( new TestSwitchCase( "testSwitchCase" ));
98         suite.addTest( new TestExtendedList( "testExtendedList" ));
99         suite.addTest( new TestBeans( "testBeans" ));
100         suite.addTest( new TestBeanMaps( "testBeanMaps" ));
101         suite.addTest( new TestArithmetic("testArithmetic"));
102         suite.addTest( new TestEncodingBuiltins("encodingBuiltins"));
103         suite.addTest( new TestStringLiteral("stringLiteral"));
104         suite.addTest( new TestXmlModel("xmlModel"));
105         suite.addTest( new TestXmlns("xmlns"));
106         suite.addTest( new TestXmlns2("xmlns2"));
107         suite.addTest( new TestXmlns3("xmlns3"));
108         suite.addTest( new TestXmlns4("xmlns4"));
109         suite.addTest( new TestXmlns5("xmlns5"));
110         suite.addTest( new TestXmlFragment("xmlfragment"));
111         suite.addTest( new TestDefaultXmlns1("defaultXmlns1"));
112         suite.addTest( new TestInterpret("interpret"));
113         suite.addTest( new TestStringBuiltins( "stringBuiltins" ));
114         suite.addTest( new TestStringBuiltins2( "stringBuiltins2" ));
115         suite.addTest( new TestTypeBuiltins( "typeBuiltins" ));
116         suite.addTest( new TestNested1( "nested1" ));
117         suite.addTest( new TestCharsetInHeader( "charsetInHeader" ));
118         suite.addTest( new TestStrictInHeader( "strictInHeader" ));
119         suite.addTest( new TestWsStripInHeader( "wsstripInHeader" ));
120         suite.addTest( new TestImport( "import" ));
121         suite.addTest( new TestRoot( "testRoot" ));
122         suite.addTest( new TestVarLayers("testVarLayers"));
123         suite.addTest( new TestDateFormat( "testDateFormat" ));
124         suite.addTest( new TestJspTaglibs( "testJspTaglibs" ));
125         suite.addTest( new TestEscapes( "testEscapes" ));
126         suite.addTest( new TestLoopvar( "testLoopvar" ));
127         suite.addTest( new TestWsTrim( "testWsTrim" ));
128         suite.addTest( new TestStringBiMethods( "testStringBiMethods" ));
129         suite.addTest( new TestSequenceBuiltins( "sequenceBuiltins" ));
130         suite.addTest( new TestOutputEncoding1( "outputEncoding1" ));
131         suite.addTest( new TestOutputEncoding2( "outputEncoding2" ));
132         suite.addTest( new TestOutputEncoding3( "outputEncoding3" ));
133
134         // This could be problematic, since it assumes a particular ordering
135
// for keysets and values from a hash, which are ultimately
136
// dependent on the implementation of the underlying JVM class library.
137
//suite.addTest( new TestExtendedHash( "testExtendedHash" ));
138

139         // These tests depend on the properties file being set up correctly
140
suite.addTest( new TestLocalization( "testLocale" ));
141         suite.addTest( new TestInclude( "testInclude" ));
142
143 // This test is screwy because the line numbers in the
144
// stack trace are always changing.
145
// suite.addTest( new TestInclude2( "testInclude2" ));
146

147         // These tests are problematic in an automatic suite --
148
// commenting out for now.
149
//suite.addTest( new TestException( "exceptionTest" ));
150
//suite.addTest( new TestExecModel( "execTest" ));
151

152         suite.addTest(new TestRecover("testRecover"));
153
154         return suite;
155     }
156
157     public static void main (String JavaDoc[] args) throws Exception JavaDoc {
158 // junit.textui.TestRunner.run(suite());
159
junit.swingui.TestRunner.run (FreeMarkerTestSuite.class);
160 // junit.awtui.TestRunner.run (FreeMarkerTestSuite.class);
161
}
162 }
163
Popular Tags