1   /*
2       Copyright (C) 2004 PjEr
3   
4       This program is free software; you can redistribute it and/or modify
5       it under the terms of the GNU General Public License as published by
6       the Free Software Foundation; either version 2 of the License, or
7       (at your option) any later version.
8   
9       This program is distributed in the hope that it will be useful,
10      but WITHOUT ANY WARRANTY; without even the implied warranty of
11      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12      GNU General Public License for more details.
13  
14      You should have received a copy of the GNU General Public License
15      along with this program; if not, write to the Free Software
16      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17  */
18  package ca.pjer.cm.module.metadata.defaultimpl;
19  
20  import junit.framework.TestCase;
21  
22  import java.io.File;
23  
24  /***
25   * 
26   * <br />
27   * $Id: AbstractTestCase.java,v 1.1 2004/05/19 01:24:56 pjer Exp $<br />
28   * <br />
29   * $RCSfile: AbstractTestCase.java,v $<br />
30   * $Revision: 1.1 $<br />
31   * $Author: pjer $<br />
32   * $Date: 2004/05/19 01:24:56 $<br />
33   *
34   * TODO: comment me.<br />
35   */
36  public abstract class AbstractTestCase extends TestCase {
37  
38      /***
39       * Basedir for all file I/O. Important when running tests from
40       * the reactor.
41       */
42      public String basedir = System.getProperty("basedir");
43  
44      /***
45       * Constructor.
46       */
47      public AbstractTestCase(String testName) {
48          super(testName);
49      }
50  
51      /***
52       * Get test input file.
53       *
54       * @param path Path to test input file.
55       */
56      public String getTestFile(String path) {
57          return new File(basedir, path).getAbsolutePath();
58      }
59  }
60