This commit is contained in:
q4speed 2020-05-09 16:10:57 +08:00
parent 7854c999c9
commit 615ecbed49
1 changed files with 7 additions and 1 deletions

View File

@ -7,16 +7,22 @@ import io.metersphere.i18n.Translator;
import org.apache.jmeter.save.SaveService;
import org.apache.jmeter.util.JMeterUtils;
import org.apache.jorphan.collections.HashTree;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Service;
import java.io.InputStream;
import java.lang.reflect.Field;
import javax.annotation.Resource;
@Service
public class JMeterService {
@Resource
private JmeterProperties jmeterProperties;
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";
JMeterUtils.loadJMeterProperties(JMETER_PROPERTIES);
JMeterUtils.setJMeterHome(JMETER_HOME);