This commit is contained in:
parent
7854c999c9
commit
615ecbed49
|
@ -7,16 +7,22 @@ import io.metersphere.i18n.Translator;
|
||||||
import org.apache.jmeter.save.SaveService;
|
import org.apache.jmeter.save.SaveService;
|
||||||
import org.apache.jmeter.util.JMeterUtils;
|
import org.apache.jmeter.util.JMeterUtils;
|
||||||
import org.apache.jorphan.collections.HashTree;
|
import org.apache.jorphan.collections.HashTree;
|
||||||
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class JMeterService {
|
public class JMeterService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private JmeterProperties jmeterProperties;
|
||||||
|
|
||||||
public void run(InputStream is) {
|
public void run(InputStream is) {
|
||||||
String JMETER_HOME = CommonBeanFactory.getBean(JmeterProperties.class).getHome();
|
String JMETER_HOME = jmeterProperties.getHome();
|
||||||
String JMETER_PROPERTIES = JMETER_HOME + "/bin/jmeter.properties";
|
String JMETER_PROPERTIES = JMETER_HOME + "/bin/jmeter.properties";
|
||||||
JMeterUtils.loadJMeterProperties(JMETER_PROPERTIES);
|
JMeterUtils.loadJMeterProperties(JMETER_PROPERTIES);
|
||||||
JMeterUtils.setJMeterHome(JMETER_HOME);
|
JMeterUtils.setJMeterHome(JMETER_HOME);
|
||||||
|
|
Loading…
Reference in New Issue