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.Test;
23: import junit.framework.TestSuite;
24:
25: /**
26: * This is a test case for Texen. Simply executes a simple
27: * generative task and compares the output.
28: *
29: * @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
30: * @version $Id: TexenClasspathTestCase.java 463298 2006-10-12 16:10:32Z henning $
31: */
32: public class TexenClasspathTestCase extends BaseTestCase {
33: /**
34: * Directory where results are generated.
35: */
36: private static final String RESULTS_DIR = TEST_RESULT_DIR
37: + "/texen-classpath";
38:
39: /**
40: * Directory where comparison output is stored.
41: */
42: private static final String COMPARE_DIR = TEST_COMPARE_DIR
43: + "/texen-classpath/compare";
44:
45: /**
46: * Creates a new instance.
47: *
48: */
49: public TexenClasspathTestCase(String name) {
50: super (name);
51: }
52:
53: public static Test suite() {
54: return new TestSuite(TexenClasspathTestCase.class);
55: }
56:
57: /**
58: * Runs the test.
59: */
60: public void testTexenClasspath() throws Exception {
61: assureResultsDirectoryExists(RESULTS_DIR);
62:
63: if (!isMatch(RESULTS_DIR, COMPARE_DIR, "TurbineWeather",
64: "java", "java")
65: || !isMatch(RESULTS_DIR, COMPARE_DIR,
66: "TurbineWeatherService", "java", "java")
67: || !isMatch(RESULTS_DIR, COMPARE_DIR, "WeatherService",
68: "java", "java")
69: || !isMatch(RESULTS_DIR, COMPARE_DIR, "book", "txt",
70: "txt")
71: || !isMatch(RESULTS_DIR, COMPARE_DIR, "Test", "txt",
72: "txt")) {
73: fail("Output is incorrect!");
74: }
75: }
76: }
|