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 Anakia. Right now, it simply will compare
27: * two index.html files together. These are produced as a result of
28: * first running Anakia and then running this test.
29: *
30: * @author <a href="mailto:jon@latchkey.com">Jon S. Stevens</a>
31: * @version $Id: AnakiaTestCase.java 463298 2006-10-12 16:10:32Z henning $
32: */
33: public class AnakiaTestCase extends BaseTestCase {
34: private static final String COMPARE_DIR = TEST_COMPARE_DIR
35: + "/anakia/compare";
36: private static final String RESULTS_DIR = TEST_RESULT_DIR
37: + "/anakia";
38:
39: private static final String CONTEXT_FILE_EXT = "context.html";
40:
41: /**
42: * Creates a new instance.
43: *
44: */
45: public AnakiaTestCase(String name) {
46: super (name);
47: }
48:
49: public static Test suite() {
50: return new TestSuite(AnakiaTestCase.class);
51: }
52:
53: /**
54: * Runs the test. This is empty on purpose because the
55: * code to do the Anakia output is in the .xml file that runs
56: * this test.
57: */
58: public void testAnakiaResults() throws Exception {
59: assureResultsDirectoryExists(RESULTS_DIR);
60:
61: /**
62: if (!isMatch(RESULTS_DIR,COMPARE_DIR,"index",FILE_EXT,FILE_EXT))
63: {
64: fail("Output is incorrect!");
65: }
66: **/
67:
68: if (!isMatch(RESULTS_DIR, COMPARE_DIR, "index",
69: CONTEXT_FILE_EXT, CONTEXT_FILE_EXT)) {
70: fail("Custom Context Output is incorrect");
71: } else {
72: System.out.println("Passed!");
73: }
74: }
75: }
|