01: package org.apache.velocity.test;
02:
03: /*
04: * Licensed to the Apache Software Foundation (ASF) under one
05: * or more contributor license agreements. See the NOTICE file
06: * distributed with this work for additional information
07: * regarding copyright ownership. The ASF licenses this file
08: * to you under the Apache License, Version 2.0 (the
09: * "License"); you may not use this file except in compliance
10: * with the License. You may obtain a copy of the License at
11: *
12: * http://www.apache.org/licenses/LICENSE-2.0
13: *
14: * Unless required by applicable law or agreed to in writing,
15: * software distributed under the License is distributed on an
16: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17: * KIND, either express or implied. See the License for the
18: * specific language governing permissions and limitations
19: * under the License.
20: */
21:
22: import junit.framework.TestSuite;
23:
24: /**
25: * This is a test case for Texen. Simply executes a simple
26: * generative task and compares the output.
27: *
28: * @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
29: * @version $Id: TexenTestCase.java 463298 2006-10-12 16:10:32Z henning $
30: */
31: public class TexenTestCase extends BaseTestCase {
32: /**
33: * Directory where results are generated.
34: */
35: private static final String RESULTS_DIR = TEST_RESULT_DIR
36: + "/texen";
37:
38: /**
39: * Directory where comparison output is stored.
40: */
41: private static final String COMPARE_DIR = TEST_COMPARE_DIR
42: + "/texen/compare";
43:
44: /**
45: * Creates a new instance.
46: *
47: */
48: public TexenTestCase(String name) {
49: super (name);
50: }
51:
52: public static junit.framework.Test suite() {
53: return new TestSuite(TexenTestCase.class);
54: }
55:
56: /**
57: * Runs the test.
58: */
59: public void testTexenResults() throws Exception {
60: assureResultsDirectoryExists(RESULTS_DIR);
61:
62: if (!isMatch(RESULTS_DIR, COMPARE_DIR, "TurbineWeather",
63: "java", "java")
64: || !isMatch(RESULTS_DIR, COMPARE_DIR,
65: "TurbineWeatherService", "java", "java")
66: || !isMatch(RESULTS_DIR, COMPARE_DIR, "WeatherService",
67: "java", "java")
68: || !isMatch(RESULTS_DIR, COMPARE_DIR, "book", "txt",
69: "txt")
70: || !isMatch(RESULTS_DIR, COMPARE_DIR, "Test", "txt",
71: "txt")) {
72: fail("Output is incorrect!");
73: }
74: }
75: }
|