/*
 * 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(){
		super();
	}
    
    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
				// Also need to set working directory so test files can be found
				System.setProperty("user.dir",System.getProperty("user.dir")+File.separatorChar+"bin");
				System.out.println("Setting user.dir="+System.getProperty("user.dir"));
			}
    		JMeterUtils jmu = new JMeterUtils();
    		jmu.initializeProperties(file);
    	}
    }
    
    protected static final Logger testLog = LoggingManager.getLoggerForClass();
}


@@ -571,16 +571,58 @@
 tCase%0A%7B%0A
+%09private static final String filePrefix; %0A
 %09public 
@@ -1621,16 +1621,70 @@
 dir%22));%0A
+%09%09%09%09filePrefix=%22bin/%22;%0A%09%09%09%7D else %7B%0A%09%09%09%09filePrefix=%22%22;%0A
 %09%09%09%7D%0A   
@@ -1767,27 +1767,297 @@
 ;%0A    %09%7D
-%0A    %7D%0A    
+ else %7B%0A    %09%09filePrefix=%22%22;%0A    %09%7D%0A    %7D%0A    %0A%09// Helper method to find a file%0A%09protected static File findTestFile(String file)%0A%09%7B%0A%09%09File f= new File(file);%0A%09%09if (filePrefix.length() %3E 0 && !f.isAbsolute())%0A%09%09%7B%0A%09%09%09f= new File(filePrefix+file);// Add the offset%0A%09%09%7D%0A%09%09return f;%0A%09%7D%0A
 %0A    pro

Add helper mehtod to find test files