dlr         01/08/20 20:40:34

  Modified:    src/test/org/apache/torque BaseTestCase.java
  Log:
  Initialization via properties file has been pushed into Torque class.
  
  Revision  Changes    Path
  1.5       +9 -40     
jakarta-turbine-torque/src/test/org/apache/torque/BaseTestCase.java
  
  Index: BaseTestCase.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-torque/src/test/org/apache/torque/BaseTestCase.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -u -r1.4 -r1.5
  --- BaseTestCase.java 2001/08/21 00:48:50     1.4
  +++ BaseTestCase.java 2001/08/21 03:40:34     1.5
  @@ -54,14 +54,6 @@
    * <http://www.apache.org/>.
    */
   
  -import java.io.FileInputStream;
  -import java.util.Properties;
  -
  -import org.apache.commons.collections.ExtendedProperties;
  -
  -import org.apache.log4j.Category;
  -import org.apache.log4j.PropertyConfigurator;
  -
   import junit.framework.TestCase;
   
   /**
  @@ -70,7 +62,7 @@
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Daniel Rall</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Christopher Elkins</a>
  - * @version $Id: BaseTestCase.java,v 1.4 2001/08/21 00:48:50 dlr Exp $
  + * @version $Id: BaseTestCase.java,v 1.5 2001/08/21 03:40:34 dlr Exp $
    */
   public abstract class BaseTestCase extends TestCase
   {
  @@ -102,39 +94,16 @@
               {
                   if (!hasInitialized)
                   {
  -                    initTorque();
  +                    try
  +                    {
  +                        Torque.init(CONFIG_FILE);
  +                    }
  +                    catch (Exception e)
  +                    {
  +                        fail("Couldn't initialize Torque: " + e.getMessage());
  +                    }
                   }
               }
  -        }
  -    }
  -
  -    /**
  -     * Performs Torque initialization activities.
  -     */
  -    private final void initTorque()
  -    {
  -        try
  -        {
  -            ExtendedProperties config = new ExtendedProperties(CONFIG_FILE);
  -            // HELP: What about the database.* properties?
  -            config = config.subset("services.DatabaseService");
  -            if (DEBUG)
  -            {
  -                System.out.println("Using configuration file: " +
  -                                   config.getString(Torque.DATABASE_DEFAULT));
  -            }
  -
  -            Properties p = new Properties();
  -            p.load(new FileInputStream(CONFIG_FILE));
  -            PropertyConfigurator.configure(p);
  -
  -            Torque.setConfiguration(config);
  -            Torque.setCategory(Category.getInstance("ALL"));
  -            Torque.init();
  -        }
  -        catch (Exception e)
  -        {
  -            fail("Couldn't initialize Torque: " + e.getMessage());
           }
       }
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to