1 package org.apache.turbine.test;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.io.File;
23 import java.io.FileInputStream;
24 import java.io.FileNotFoundException;
25 import java.util.Properties;
26
27 import junit.framework.TestCase;
28
29 import org.apache.log4j.PropertyConfigurator;
30
31 import org.apache.turbine.Turbine;
32
33 /***
34 * Base functionality to be extended by all Apache Turbine test cases. Test
35 * case implementations are used to automate testing via JUnit.
36 *
37 * @author <a href="mailto:celkins@scardini.com">Christopher Elkins</a>
38 * @author <a href="mailto:hps@intermeta.de">Henning P. Schmiedehausen</a>
39 * @version $Id: BaseTestCase.java 534527 2007-05-02 16:10:59Z tv $
40 */
41 public abstract class BaseTestCase
42 extends TestCase
43 {
44 private static File log4jFile = new File("conf/test/Log4j.properties");
45
46 public BaseTestCase(String name)
47 throws Exception
48 {
49 super(name);
50
51 try
52 {
53 Properties p = new Properties();
54 p.load(new FileInputStream(log4jFile));
55 p.setProperty(Turbine.APPLICATION_ROOT_KEY, new File(".").getAbsolutePath());
56 PropertyConfigurator.configure(p);
57 }
58 catch (FileNotFoundException fnf)
59 {
60 System.err.println("Could not open Log4J configuration file "
61 + log4jFile);
62 }
63 }
64 }
65