KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > velocity > test > AnakiaTestCase


1 package org.apache.velocity.test;
2
3 /*
4  * Copyright 2001,2004 The Apache Software Foundation.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18
19 /**
20  * This is a test case for Anakia. Right now, it simply will compare
21  * two index.html files together. These are produced as a result of
22  * first running Anakia and then running this test.
23  *
24  * @author <a HREF="mailto:jon@latchkey.com">Jon S. Stevens</a>
25  * @version $Id: AnakiaTestCase.java,v 1.6.4.1 2004/03/03 23:23:04 geirm Exp $
26  */

27 public class AnakiaTestCase extends BaseTestCase
28 {
29     private static final String JavaDoc COMPARE_DIR = "../test/anakia/compare";
30     private static final String JavaDoc RESULTS_DIR = "../test/anakia/results";
31     private static final String JavaDoc FILE_EXT = ".html";
32
33     /**
34      * Creates a new instance.
35      *
36      */

37     public AnakiaTestCase()
38     {
39         super("AnakiaTestCase");
40     }
41
42     public static junit.framework.Test suite()
43     {
44         return new AnakiaTestCase();
45     }
46
47     /**
48      * Runs the test. This is empty on purpose because the
49      * code to do the Anakia output is in the .xml file that runs
50      * this test.
51      */

52     public void runTest ()
53     {
54         try
55         {
56             assureResultsDirectoryExists(RESULTS_DIR);
57             
58             if (!isMatch(RESULTS_DIR,COMPARE_DIR,"index",FILE_EXT,FILE_EXT))
59             {
60                 fail("Output is incorrect!");
61             }
62             else
63             {
64                 System.out.println ("Passed!");
65             }
66         }
67         catch(Exception JavaDoc e)
68         {
69             /*
70              * do nothing.
71              */

72         }
73     }
74 }
75
Popular Tags