/*
 * Created on Apr 30, 2003
 *
 * To change the template for this generated file go to
 * Window>Preferences>Java>Code Generation>Code and Comments
 */
package org.apache.jmeter.junit;

import java.io.File;

import junit.framework.TestCase;
import org.apache.jmeter.util.JMeterUtils;
import org.apache.jorphan.logging.LoggingManager;
import org.apache.log.Logger;

/**
 * @author ano ano
 *
 * To change the template for this generated type comment go to
 * Window>Preferences>Java>Code Generation>Code and Comments
 */
public abstract class JMeterTestCase extends TestCase
{
    
    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){
    		String file="jmetertest.properties";
			File f = new File(file);
			if (!f.canRead()){
				System.out.println("Can't find "+file+" - trying bin directory");
				file="bin/"+file;// JMeterUtils assumes Unix-style separators
			}
    		JMeterUtils jmu = new JMeterUtils();
    		jmu.initializeProperties(file);
    	}
    }
    
    protected static final Logger testLog = LoggingManager.getLoggerForClass();
}


@@ -571,16 +571,56 @@
 tCase%0A%7B%0A
+%09public JMeterTestCase()%7B%0A%09%09super();%0A%09%7D%0A
     %0A   
@@ -1342,16 +1342,253 @@
 arators%0A
+%09%09%09%09// Also need to set working directory so test files can be found%0A%09%09%09%09System.setProperty(%22user.dir%22,System.getProperty(%22user.dir%22)+File.separatorChar+%22bin%22);%0A%09%09%09%09System.out.println(%22Setting user.dir=%22+System.getProperty(%22user.dir%22));%0A
 %09%09%09%7D%0A   

Set user.dir if necessary; add default constructor