1 package org.apache.turbine.test; 2 3 18 19 import java.io.File ; 20 import java.io.FileInputStream ; 21 import java.io.FileNotFoundException ; 22 import java.util.Properties ; 23 24 import junit.framework.TestCase; 25 26 import org.apache.log4j.PropertyConfigurator; 27 28 import org.apache.turbine.Turbine; 29 30 38 public abstract class BaseTestCase 39 extends TestCase 40 { 41 private static File log4jFile = new File ("conf/test/Log4j.properties"); 42 43 public BaseTestCase(String name) 44 throws Exception 45 { 46 super(name); 47 48 try 49 { 50 Properties p = new Properties (); 51 p.load(new FileInputStream (log4jFile)); 52 p.setProperty(Turbine.APPLICATION_ROOT_KEY, new File (".").getAbsolutePath()); 53 PropertyConfigurator.configure(p); 54 } 55 catch (FileNotFoundException fnf) 56 { 57 System.err.println("Could not open Log4J configuration file " 58 + log4jFile); 59 } 60 } 61 } 62 63 | Popular Tags |