1 package org.apache.velocity.test;
2
3 /*
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "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
26 /**
27 * This is a test case for Texen. Simply executes a simple
28 * generative task and compares the output.
29 *
30 * @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
31 * @version $Id: TexenTestCase.java 463298 2006-10-12 16:10:32Z henning $
32 */
33 public class TexenTestCase extends BaseTestCase
34 {
35 /**
36 * Directory where results are generated.
37 */
38 private static final String RESULTS_DIR = TEST_RESULT_DIR + "/texen";
39
40 /**
41 * Directory where comparison output is stored.
42 */
43 private static final String COMPARE_DIR = TEST_COMPARE_DIR + "/texen/compare";
44
45 /**
46 * Creates a new instance.
47 *
48 */
49 public TexenTestCase(String name)
50 {
51 super(name);
52 }
53
54 public static junit.framework.Test suite()
55 {
56 return new TestSuite(TexenTestCase.class);
57 }
58
59 /**
60 * Runs the test.
61 */
62 public void testTexenResults ()
63 throws Exception
64 {
65 assureResultsDirectoryExists(RESULTS_DIR);
66
67 if (!isMatch(RESULTS_DIR,COMPARE_DIR,"TurbineWeather","java","java") ||
68 !isMatch(RESULTS_DIR,COMPARE_DIR,"TurbineWeatherService","java","java") ||
69 !isMatch(RESULTS_DIR,COMPARE_DIR,"WeatherService","java","java") ||
70 !isMatch(RESULTS_DIR,COMPARE_DIR,"book","txt","txt") ||
71 !isMatch(RESULTS_DIR,COMPARE_DIR,"Test","txt","txt"))
72 {
73 fail("Output is incorrect!");
74 }
75 }
76 }