activemq/activemq-jmeter/resource/BeanShellFunction.bshrc

31 lines
795 B
Plaintext

// Sample BeanShell Function initialisation file
//print("Initialisation started");
import org.apache.jmeter.util.JMeterUtils;
i = j = k = 0; // for counters
getprop(p){// get a JMeter property
return JMeterUtils.getPropDefault(p,"");
}
getprop(p,d){// get a JMeter property with default
return JMeterUtils.getPropDefault(p,d);
}
setprop(p,v){// set a JMeter property
JMeterUtils.getJMeterProperties().setProperty(p, v);
}
// Define routines to stop the test or the current thread
stopTest(){// Stop the JMeter test
org.apache.jmeter.engine.StandardJMeterEngine.stopEngine();
}
stopThread(){// Stop current JMeter thread
org.apache.jmeter.engine.StandardJMeterEngine.stopThread(Thread.currentThread().getName());
}
//print("Initialisation complete");