rollback
This commit is contained in:
parent
940631faa3
commit
f90b870c3f
|
@ -7,7 +7,6 @@ import io.metersphere.base.domain.FileMetadata;
|
||||||
import io.metersphere.base.domain.LoadTestWithBLOBs;
|
import io.metersphere.base.domain.LoadTestWithBLOBs;
|
||||||
import io.metersphere.commons.constants.EngineType;
|
import io.metersphere.commons.constants.EngineType;
|
||||||
import io.metersphere.commons.exception.MSException;
|
import io.metersphere.commons.exception.MSException;
|
||||||
import io.metersphere.commons.utils.CommonBeanFactory;
|
|
||||||
import io.metersphere.engine.docker.DockerTestEngine;
|
import io.metersphere.engine.docker.DockerTestEngine;
|
||||||
import io.metersphere.engine.kubernetes.KubernetesTestEngine;
|
import io.metersphere.engine.kubernetes.KubernetesTestEngine;
|
||||||
import io.metersphere.parse.EngineSourceParser;
|
import io.metersphere.parse.EngineSourceParser;
|
||||||
|
@ -22,9 +21,9 @@ public class EngineFactory {
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case DOCKER:
|
case DOCKER:
|
||||||
return CommonBeanFactory.getBean(DockerTestEngine.class);
|
return new DockerTestEngine();
|
||||||
case KUBERNETES:
|
case KUBERNETES:
|
||||||
return CommonBeanFactory.getBean(KubernetesTestEngine.class);
|
return new KubernetesTestEngine();
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,9 +2,7 @@ package io.metersphere.engine.docker;
|
||||||
|
|
||||||
import io.metersphere.engine.Engine;
|
import io.metersphere.engine.Engine;
|
||||||
import io.metersphere.engine.EngineContext;
|
import io.metersphere.engine.EngineContext;
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
public class DockerTestEngine implements Engine {
|
public class DockerTestEngine implements Engine {
|
||||||
private EngineContext context;
|
private EngineContext context;
|
||||||
|
|
||||||
|
|
|
@ -11,11 +11,9 @@ import io.metersphere.engine.kubernetes.crds.jmeter.Jmeter;
|
||||||
import io.metersphere.engine.kubernetes.crds.jmeter.JmeterSpec;
|
import io.metersphere.engine.kubernetes.crds.jmeter.JmeterSpec;
|
||||||
import io.metersphere.engine.kubernetes.provider.ClientCredential;
|
import io.metersphere.engine.kubernetes.provider.ClientCredential;
|
||||||
import io.metersphere.engine.kubernetes.provider.KubernetesProvider;
|
import io.metersphere.engine.kubernetes.provider.KubernetesProvider;
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
@Service
|
|
||||||
public class KubernetesTestEngine implements Engine {
|
public class KubernetesTestEngine implements Engine {
|
||||||
private EngineContext context;
|
private EngineContext context;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package io.metersphere.parse;
|
package io.metersphere.parse;
|
||||||
|
|
||||||
import io.metersphere.commons.constants.FileType;
|
import io.metersphere.commons.constants.FileType;
|
||||||
import io.metersphere.commons.utils.CommonBeanFactory;
|
|
||||||
import io.metersphere.parse.xml.XmlEngineSourceParse;
|
import io.metersphere.parse.xml.XmlEngineSourceParse;
|
||||||
|
|
||||||
public class EngineSourceParserFactory {
|
public class EngineSourceParserFactory {
|
||||||
|
@ -9,7 +8,7 @@ public class EngineSourceParserFactory {
|
||||||
final FileType engineType = FileType.valueOf(type);
|
final FileType engineType = FileType.valueOf(type);
|
||||||
|
|
||||||
if (FileType.JMX.equals(engineType)) {
|
if (FileType.JMX.equals(engineType)) {
|
||||||
return CommonBeanFactory.getBean(XmlEngineSourceParse.class);
|
return new XmlEngineSourceParse();
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -4,7 +4,6 @@ import io.metersphere.engine.EngineContext;
|
||||||
import io.metersphere.parse.EngineSourceParser;
|
import io.metersphere.parse.EngineSourceParser;
|
||||||
import io.metersphere.parse.xml.reader.DocumentParser;
|
import io.metersphere.parse.xml.reader.DocumentParser;
|
||||||
import io.metersphere.parse.xml.reader.DocumentParserFactory;
|
import io.metersphere.parse.xml.reader.DocumentParserFactory;
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import org.w3c.dom.Document;
|
import org.w3c.dom.Document;
|
||||||
import org.xml.sax.InputSource;
|
import org.xml.sax.InputSource;
|
||||||
|
|
||||||
|
@ -12,7 +11,6 @@ import javax.xml.parsers.DocumentBuilder;
|
||||||
import javax.xml.parsers.DocumentBuilderFactory;
|
import javax.xml.parsers.DocumentBuilderFactory;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
|
||||||
@Service
|
|
||||||
public class XmlEngineSourceParse implements EngineSourceParser {
|
public class XmlEngineSourceParse implements EngineSourceParser {
|
||||||
@Override
|
@Override
|
||||||
public String parse(EngineContext context, InputStream source) throws Exception {
|
public String parse(EngineContext context, InputStream source) throws Exception {
|
||||||
|
|
|
@ -161,7 +161,7 @@ public class LoadTestService {
|
||||||
LogUtil.info("Load test started " + loadTest.getName());
|
LogUtil.info("Load test started " + loadTest.getName());
|
||||||
// engine type (DOCKER|KUBERNETES)
|
// engine type (DOCKER|KUBERNETES)
|
||||||
// todo set type
|
// todo set type
|
||||||
Engine engine = EngineFactory.createEngine(fileMetadata.getEngine());
|
final Engine engine = EngineFactory.createEngine(fileMetadata.getEngine());
|
||||||
if (engine == null) {
|
if (engine == null) {
|
||||||
MSException.throwException(String.format("Test cannot be run,test ID:%s,file type:%s",
|
MSException.throwException(String.format("Test cannot be run,test ID:%s,file type:%s",
|
||||||
request.getId(),
|
request.getId(),
|
||||||
|
|
Loading…
Reference in New Issue