sebb        2003/12/06 12:53:47

  Modified:    src/core/org/apache/jmeter/junit JMeterTestCase.java
  Log:
  Initialise JMeter properties if not done already (for testing individual modules)
  
  Revision  Changes    Path
  1.4       +17 -1     
jakarta-jmeter/src/core/org/apache/jmeter/junit/JMeterTestCase.java
  
  Index: JMeterTestCase.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/junit/JMeterTestCase.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- JMeterTestCase.java       19 Oct 2003 22:26:50 -0000      1.3
  +++ JMeterTestCase.java       6 Dec 2003 20:53:47 -0000       1.4
  @@ -7,7 +7,7 @@
   package org.apache.jmeter.junit;
   
   import junit.framework.TestCase;
  -
  +import org.apache.jmeter.util.JMeterUtils;
   import org.apache.jorphan.logging.LoggingManager;
   import org.apache.log.Logger;
   
  @@ -23,6 +23,22 @@
       public JMeterTestCase(String name)
       {
           super(name);
  +    }
  +    
  +    /*
  +     * If not running under AllTests.java, make sure that the properties
  +     * (and log file) are set up correctly.
  +     * 
  +     * N.B. In order for this to work correctly, the JUnit test must be started
  +     * in the bin directory, and all the JMeter jars (plus any others needed at
  +     * run-time) need to be on the classpath.
  +     * 
  +     */
  +    static {
  +     if (JMeterUtils.getJMeterProperties() == null){
  +             JMeterUtils jmu = new JMeterUtils();
  +             jmu.initializeProperties("./jmetertest.properties");
  +     }
       }
       
       protected static final Logger testLog = LoggingManager.getLoggerForClass();
  
  
  

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

Reply via email to