build: 模块化
This commit is contained in:
parent
1354069117
commit
ef3a4bb66f
|
@ -1,10 +0,0 @@
|
|||
[submodule "backend/src/main/java/io/metersphere/xpack"]
|
||||
path = backend/src/main/java/io/metersphere/xpack
|
||||
url = git@github.com:metersphere/xpack-backend.git
|
||||
branch = dev
|
||||
ignore = all
|
||||
[submodule "frontend/src/business/components/xpack"]
|
||||
path = frontend/src/business/components/xpack
|
||||
url = git@github.com:metersphere/xpack-frontend.git
|
||||
branch = dev
|
||||
ignore = all
|
35
Dockerfile
35
Dockerfile
|
@ -1,35 +0,0 @@
|
|||
FROM registry.cn-qingdao.aliyuncs.com/metersphere/alpine-openjdk11-jre
|
||||
|
||||
LABEL maintainer="FIT2CLOUD <support@fit2cloud.com>"
|
||||
|
||||
ARG MS_VERSION=dev
|
||||
ARG DEPENDENCY=backend/target/dependency
|
||||
|
||||
COPY ${DEPENDENCY}/BOOT-INF/lib /app/lib
|
||||
COPY ${DEPENDENCY}/META-INF /app/META-INF
|
||||
COPY ${DEPENDENCY}/BOOT-INF/classes /app
|
||||
|
||||
# html 文件
|
||||
COPY frontend/dist/*.html /app/public/
|
||||
|
||||
# 静态文件
|
||||
COPY frontend/dist/favicon.ico /app/static/favicon.ico
|
||||
COPY frontend/dist/fonts /app/static/fonts
|
||||
COPY frontend/dist/img /app/static/img
|
||||
COPY frontend/dist/js /app/static/js
|
||||
COPY frontend/dist/css /app/static/css
|
||||
COPY frontend/dist/*.worker.js /app/static/
|
||||
COPY frontend/src/assets/theme/index.css /app/static/css/index.css
|
||||
|
||||
|
||||
RUN mv /app/lib/ms-jmeter-core-*.jar /app/lib/ms-jmeter-core.jar
|
||||
RUN mv /app/jmeter /opt/
|
||||
|
||||
ENV JAVA_CLASSPATH=/app:/app/lib/ms-jmeter-core.jar:/opt/jmeter/lib/ext/*:/app/lib/*
|
||||
ENV JAVA_MAIN_CLASS=io.metersphere.Application
|
||||
ENV AB_OFF=true
|
||||
ENV MS_VERSION=${MS_VERSION}
|
||||
ENV JAVA_OPTIONS="-Dfile.encoding=utf-8 -Djava.awt.headless=true --add-opens java.base/jdk.internal.loader=ALL-UNNAMED"
|
||||
|
||||
|
||||
CMD ["/deployments/run-java.sh"]
|
|
@ -1,12 +1,3 @@
|
|||
properties([ [ $class: 'ThrottleJobProperty',
|
||||
categories: ['metersphere'],
|
||||
limitOneJobWithMatchingParams: false,
|
||||
maxConcurrentPerNode: 1,
|
||||
maxConcurrentTotal: 1,
|
||||
paramsToUseForLimit: '',
|
||||
throttleEnabled: true,
|
||||
throttleOption: 'category' ] ])
|
||||
|
||||
pipeline {
|
||||
agent {
|
||||
node {
|
||||
|
@ -14,46 +5,126 @@ pipeline {
|
|||
}
|
||||
}
|
||||
triggers {
|
||||
pollSCM('0 22 * * *')
|
||||
pollSCM('0 3 * * *')
|
||||
}
|
||||
environment {
|
||||
IMAGE_NAME = 'metersphere'
|
||||
environment {
|
||||
IMAGE_PREFIX = 'registry.cn-qingdao.aliyuncs.com/metersphere'
|
||||
JAVA_HOME = '/opt/jdk-11'
|
||||
}
|
||||
stages {
|
||||
stage('Preparation') {
|
||||
steps {
|
||||
script {
|
||||
REVISION = ""
|
||||
BUILD_SDK = false
|
||||
BUILD_PARENT = false
|
||||
if (env.BRANCH_NAME.startsWith("v") ) {
|
||||
REVISION = env.BRANCH_NAME.substring(1)
|
||||
} else {
|
||||
REVISION = env.BRANCH_NAME
|
||||
}
|
||||
if (params.buildSdk) {
|
||||
BUILD_SDK = true
|
||||
}
|
||||
if (params.buildParent) {
|
||||
BUILD_PARENT = true
|
||||
}
|
||||
env.REVISION = "${REVISION}"
|
||||
echo "REVISION=${REVISION}"
|
||||
env.BUILD_SDK = "${BUILD_SDK}"
|
||||
env.BUILD_PARENT = "${BUILD_PARENT}"
|
||||
echo "REVISION=${REVISION}, BUILD_SDK=${BUILD_SDK}, BUILD_PARENT=${BUILD_PARENT}"
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('POM') {
|
||||
when { environment name: 'BUILD_PARENT', value: 'true' }
|
||||
steps {
|
||||
configFileProvider([configFile(fileId: 'metersphere-maven', targetLocation: 'settings.xml')]) {
|
||||
sh '''#!/bin/bash -xe
|
||||
export JAVA_HOME=/opt/jdk-11
|
||||
export CLASSPATH=$JAVA_HOME/lib:$CLASSPATH
|
||||
export PATH=$JAVA_HOME/bin:$PATH
|
||||
java -version
|
||||
./mvnw install -N -Drevision=${REVISION} --settings ./settings.xml
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('SDK') {
|
||||
when { environment name: 'BUILD_SDK', value: 'true' }
|
||||
steps {
|
||||
configFileProvider([configFile(fileId: 'metersphere-maven', targetLocation: 'settings.xml')]) {
|
||||
sh '''#!/bin/bash -xe
|
||||
export JAVA_HOME=/opt/jdk-11
|
||||
export CLASSPATH=$JAVA_HOME/lib:$CLASSPATH
|
||||
export PATH=$JAVA_HOME/bin:$PATH
|
||||
java -version
|
||||
./mvnw install -N -Drevision=${REVISION} --settings ./settings.xml
|
||||
./mvnw clean install -Drevision=${REVISION} -pl framework,framework/sdk-parent,framework/sdk-parent/domain,framework/sdk-parent/sdk,framework/sdk-parent/xpack-interface --settings ./settings.xml
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Build/Test') {
|
||||
when {
|
||||
allOf {
|
||||
environment name: 'BUILD_SDK', value: 'false';
|
||||
environment name: 'BUILD_PARENT', value: 'false'
|
||||
}
|
||||
}
|
||||
steps {
|
||||
configFileProvider([configFile(fileId: 'metersphere-maven', targetLocation: 'settings.xml')]) {
|
||||
sh '''
|
||||
sh '''#!/bin/bash -xe
|
||||
export JAVA_HOME=/opt/jdk-11
|
||||
export CLASSPATH=$JAVA_HOME/lib:$CLASSPATH
|
||||
export PATH=$JAVA_HOME/bin:/opt/mvnd/bin:$PATH
|
||||
export PATH=$JAVA_HOME/bin:$PATH
|
||||
java -version
|
||||
mvnd clean package -Drevision=${REVISION} -DskipAntRunForJenkins --settings ./settings.xml
|
||||
mkdir -p backend/target/dependency && (cd backend/target/dependency; jar -xf ../*.jar)
|
||||
./mvnw clean package package -Drevision=${REVISION} --settings ./settings.xml
|
||||
|
||||
frameworks=('framework/eureka' 'framework/gateway')
|
||||
for library in "${frameworks[@]}";
|
||||
do
|
||||
mkdir -p $library/target/dependency && (cd $library/target/dependency; jar -xf ../*.jar)
|
||||
done
|
||||
|
||||
LOCAL_REPOSITORY=$(./mvnw help:evaluate -Dexpression=settings.localRepository --settings ./settings.xml -q -DforceStdout)
|
||||
|
||||
libraries=('api-test' 'performance-test' 'project-management' 'system-setting' 'test-track' 'report-stat')
|
||||
for library in "${libraries[@]}";
|
||||
do
|
||||
mkdir -p $library/backend/target/dependency && (cd $library/backend/target/dependency; jar -xf ../*.jar; cp $LOCAL_REPOSITORY/io/metersphere/metersphere-xpack/${REVISION}/metersphere-xpack-${REVISION}.jar ./BOOT-INF/lib/)
|
||||
done
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Docker build & push') {
|
||||
when {
|
||||
allOf {
|
||||
environment name: 'BUILD_SDK', value: 'false';
|
||||
environment name: 'BUILD_PARENT', value: 'false'
|
||||
}
|
||||
}
|
||||
steps {
|
||||
sh '''
|
||||
su - metersphere -c "cd ${WORKSPACE} && docker buildx create --use && docker buildx build --build-arg MS_VERSION=\${TAG_NAME:-\$BRANCH_NAME}-\${GIT_COMMIT:0:8} -t ${IMAGE_PREFIX}/${IMAGE_NAME}:\${TAG_NAME:-\$BRANCH_NAME} --platform linux/amd64,linux/arm64 . --push"
|
||||
'''
|
||||
script {
|
||||
for (int i=0; i<10; i++) {
|
||||
try {
|
||||
sh '''#!/bin/bash -xe
|
||||
cd ${WORKSPACE}
|
||||
libraries=('framework/eureka' 'framework/gateway' 'api-test' 'performance-test' 'project-management' 'report-stat' 'system-setting' 'test-track')
|
||||
for library in "${libraries[@]}";
|
||||
do
|
||||
IMAGE_NAME=${library#*/}
|
||||
docker --config /home/metersphere/.docker buildx build --build-arg MS_VERSION=\${TAG_NAME:-\$BRANCH_NAME}-\${GIT_COMMIT:0:8} -t ${IMAGE_PREFIX}/${IMAGE_NAME}:\${TAG_NAME:-\$BRANCH_NAME} --platform linux/amd64,linux/arm64 ./$library --push
|
||||
done
|
||||
'''
|
||||
break
|
||||
} catch (Exception e) {
|
||||
sleep 10
|
||||
continue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -63,7 +134,6 @@ pipeline {
|
|||
withCredentials([string(credentialsId: 'wechat-bot-webhook', variable: 'WEBHOOK')]) {
|
||||
qyWechatNotification failNotify: true, mentionedId: '', mentionedMobile: '', webhookUrl: "$WEBHOOK"
|
||||
}
|
||||
sh "./mvnw clean"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
FROM registry.cn-qingdao.aliyuncs.com/metersphere/alpine-openjdk11-jre
|
||||
|
||||
LABEL maintainer="FIT2CLOUD <support@fit2cloud.com>"
|
||||
|
||||
ARG MS_VERSION=dev
|
||||
ARG DEPENDENCY=backend/target/dependency
|
||||
|
||||
COPY ${DEPENDENCY}/BOOT-INF/lib /app/lib
|
||||
COPY ${DEPENDENCY}/META-INF /app/META-INF
|
||||
COPY ${DEPENDENCY}/BOOT-INF/classes /app
|
||||
|
||||
# html 文件
|
||||
COPY backend/src/main/resources/public /app/public
|
||||
|
||||
# 静态文件
|
||||
COPY backend/src/main/resources/static /app/static
|
||||
|
||||
RUN mv /app/lib/ms-jmeter-core-*.jar /app/lib/ms-jmeter-core.jar
|
||||
RUN mv /app/jmeter /opt/
|
||||
|
||||
ENV JAVA_CLASSPATH=/app:/app/lib/ms-jmeter-core.jar:/opt/jmeter/lib/ext/*:/app/lib/*
|
||||
ENV JAVA_MAIN_CLASS=io.metersphere.ApiApplication
|
||||
ENV AB_OFF=true
|
||||
ENV MS_VERSION=${MS_VERSION}
|
||||
ENV JAVA_OPTIONS="-Dfile.encoding=utf-8 -Djava.awt.headless=true --add-opens java.base/jdk.internal.loader=ALL-UNNAMED"
|
||||
|
||||
|
||||
CMD ["/deployments/run-java.sh"]
|
|
@ -0,0 +1,36 @@
|
|||
# Created by .ignore support plugin (hsz.mobi)
|
||||
.DS_Store
|
||||
node_modules
|
||||
node/
|
||||
/dist
|
||||
|
||||
# local env files
|
||||
.env.local
|
||||
.env.*.local
|
||||
|
||||
# Log files
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# Editor directories and files
|
||||
.idea
|
||||
*.iml
|
||||
.vscode
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
|
||||
|
||||
src/main/resources/static
|
||||
src/main/resources/public
|
||||
|
||||
src/test/
|
||||
target
|
||||
.settings
|
||||
.project
|
||||
.classpath
|
||||
.factorypath
|
||||
src/main/resources/jmeter/lib/ext
|
|
@ -0,0 +1,170 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>io.metersphere</groupId>
|
||||
<artifactId>api-test-parent</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>api-test</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.metersphere</groupId>
|
||||
<artifactId>sdk</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.metersphere</groupId>
|
||||
<artifactId>xpack-interface</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/java</directory>
|
||||
<includes>
|
||||
<include>**/*.properties</include>
|
||||
<include>**/*.xml</include>
|
||||
<include>**/*.json</include>
|
||||
<include>**/*.tpl</include>
|
||||
<include>**/*.js</include>
|
||||
</includes>
|
||||
<filtering>false</filtering>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<includes>
|
||||
<include>**/*</include>
|
||||
</includes>
|
||||
<filtering>false</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<excludes>
|
||||
<exclude>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-clean-plugin</artifactId>
|
||||
<configuration>
|
||||
<filesets>
|
||||
<fileset>
|
||||
<directory>src/main/resources/static</directory>
|
||||
<includes>
|
||||
<include>**</include>
|
||||
</includes>
|
||||
<followSymlinks>false</followSymlinks>
|
||||
</fileset>
|
||||
<fileset>
|
||||
<directory>src/main/resources/public</directory>
|
||||
<includes>
|
||||
<include>**</include>
|
||||
</includes>
|
||||
<followSymlinks>false</followSymlinks>
|
||||
</fileset>
|
||||
</filesets>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>main-class-placement</id>
|
||||
<phase>generate-resources</phase>
|
||||
<configuration>
|
||||
<skip>${skipAntRunForJenkins}</skip>
|
||||
<target>
|
||||
<copy todir="src/main/resources/static">
|
||||
<fileset dir="../frontend/dist">
|
||||
<exclude name="*.html"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy todir="src/main/resources/public">
|
||||
<fileset dir="../frontend/dist">
|
||||
<include name="*.html"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy todir="src/main/resources/static/assets">
|
||||
<fileset dir="../../framework/sdk-parent/frontend/src/assets"/>
|
||||
</copy>
|
||||
</target>
|
||||
</configuration>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<release>${java.version}</release>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy</id>
|
||||
<phase>generate-resources</phase>
|
||||
<goals>
|
||||
<goal>copy</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<artifactItems>
|
||||
<artifactItem>
|
||||
<groupId>org.apache.jmeter</groupId>
|
||||
<artifactId>ApacheJMeter_functions</artifactId>
|
||||
<version>${jmeter.version}</version>
|
||||
<type>jar</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>src/main/resources/jmeter/lib/ext</outputDirectory>
|
||||
<destFileName>ApacheJMeter_functions.jar</destFileName>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>io.metersphere</groupId>
|
||||
<artifactId>metersphere-jmeter-functions</artifactId>
|
||||
<version>${metersphere-jmeter-functions.version}</version>
|
||||
<type>jar</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>src/main/resources/jmeter/lib/ext</outputDirectory>
|
||||
<destFileName>metersphere-jmeter-functions.jar</destFileName>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.python</groupId>
|
||||
<artifactId>jython-standalone</artifactId>
|
||||
<version>${jython.version}</version>
|
||||
<type>jar</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>src/main/resources/jmeter/lib/ext</outputDirectory>
|
||||
<destFileName>jython-standalone.jar</destFileName>
|
||||
</artifactItem>
|
||||
</artifactItems>
|
||||
<outputDirectory>${project.build.directory}/wars</outputDirectory>
|
||||
<overWriteReleases>false</overWriteReleases>
|
||||
<overWriteSnapshots>true</overWriteSnapshots>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
|
@ -0,0 +1,34 @@
|
|||
package io.metersphere;
|
||||
|
||||
import io.metersphere.config.JmeterProperties;
|
||||
import io.metersphere.config.KafkaProperties;
|
||||
import io.metersphere.config.MinioProperties;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.ldap.LdapAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.neo4j.Neo4jAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.quartz.QuartzAutoConfiguration;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.boot.web.servlet.ServletComponentScan;
|
||||
import org.springframework.context.annotation.PropertySource;
|
||||
|
||||
@SpringBootApplication(exclude = {
|
||||
QuartzAutoConfiguration.class,
|
||||
LdapAutoConfiguration.class,
|
||||
Neo4jAutoConfiguration.class
|
||||
})
|
||||
@PropertySource(value = {
|
||||
"classpath:commons.properties",
|
||||
"file:/opt/metersphere/conf/metersphere.properties",
|
||||
}, encoding = "UTF-8", ignoreResourceNotFound = true)
|
||||
@ServletComponentScan
|
||||
@EnableConfigurationProperties({
|
||||
KafkaProperties.class,
|
||||
MinioProperties.class,
|
||||
JmeterProperties.class
|
||||
})
|
||||
public class ApiApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(ApiApplication.class, args);
|
||||
}
|
||||
}
|
|
@ -2,7 +2,7 @@ package io.metersphere.api.dto;
|
|||
|
||||
import io.metersphere.api.dto.definition.ApiTestCaseRequest;
|
||||
import io.metersphere.base.domain.ApiTestCaseWithBLOBs;
|
||||
import io.metersphere.controller.request.OrderRequest;
|
||||
import io.metersphere.request.OrderRequest;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package io.metersphere.track.request.testcase;
|
||||
package io.metersphere.api.dto;
|
||||
|
||||
import io.metersphere.api.dto.automation.ApiScenarioRequest;
|
||||
import lombok.Getter;
|
||||
|
@ -44,4 +44,6 @@ public class ApiCaseRelevanceRequest {
|
|||
private List<String> ids;
|
||||
|
||||
private ApiScenarioRequest condition;
|
||||
|
||||
private Boolean allowedRepeatCase = false;
|
||||
}
|
|
@ -2,8 +2,8 @@ package io.metersphere.api.dto;
|
|||
|
||||
import io.metersphere.api.dto.definition.ApiTestCaseRequest;
|
||||
import io.metersphere.base.domain.ApiDefinitionExecResultWithBLOBs;
|
||||
import io.metersphere.controller.request.OrderRequest;
|
||||
import io.metersphere.dto.RunModeConfigDTO;
|
||||
import io.metersphere.request.OrderRequest;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package io.metersphere.api.dto;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class ApiCountChartResult {
|
||||
private String groupName;
|
||||
private long countNum;
|
||||
|
||||
public String getCountNumStr() {
|
||||
return String.valueOf(countNum);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,80 @@
|
|||
package io.metersphere.api.dto;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class ApiCountRequest {
|
||||
//x轴字段
|
||||
private String xaxis;
|
||||
//y轴字段
|
||||
private List<String> yaxis;
|
||||
|
||||
//搜索条件
|
||||
private String projectId;
|
||||
private String timeType;
|
||||
private TimeFilter timeFilter;
|
||||
private List<Long> times;
|
||||
private String order;
|
||||
|
||||
//起始时间
|
||||
private long startTime = 0;
|
||||
//结束时间
|
||||
private long endTime = 0;
|
||||
|
||||
//其余条件
|
||||
private String filterType;
|
||||
private List<Map<String, Object>> filters;
|
||||
|
||||
/**
|
||||
* 功能用例、接口用例、场景用例、性能用例的分组字段
|
||||
*/
|
||||
private String testCaseGroupColumn;
|
||||
private String apiCaseGroupColumn;
|
||||
private String scenarioCaseGroupColumn;
|
||||
private String loadCaseGroupColumn;
|
||||
|
||||
/**
|
||||
* filter整理后的查询数据
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private Map<String, List<String>> filterSearchList;
|
||||
private Map<String, List<String>> apiFilterSearchList;
|
||||
private Map<String, List<String>> loadFilterSearchList;
|
||||
|
||||
public int getTimeRange() {
|
||||
if (timeFilter != null) {
|
||||
return timeFilter.getTimeRange();
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public String getTimeRangeUnit() {
|
||||
if (timeFilter != null) {
|
||||
return timeFilter.getTimeRangeUnit();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public void setFilterSearchList(String key, List<String> values) {
|
||||
if (this.filterSearchList == null) {
|
||||
this.filterSearchList = new HashMap<>();
|
||||
}
|
||||
filterSearchList.put(key, values);
|
||||
}
|
||||
}
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
class TimeFilter {
|
||||
private int timeRange;
|
||||
private String timeRangeUnit;
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
package io.metersphere.api.dto;
|
||||
|
||||
import io.metersphere.dto.RequestResult;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ApiDefinitionExecResultDTO {
|
||||
private String id;
|
||||
|
||||
private String name;
|
||||
|
||||
private String resourceId;
|
||||
|
||||
private String status;
|
||||
|
||||
private String userId;
|
||||
|
||||
private Long startTime;
|
||||
|
||||
private Long endTime;
|
||||
|
||||
private Long createTime;
|
||||
|
||||
private String type;
|
||||
|
||||
private String actuator;
|
||||
|
||||
private String triggerMode;
|
||||
|
||||
private String errorCode;
|
||||
|
||||
private String versionId;
|
||||
|
||||
private String projectId;
|
||||
|
||||
private String integratedReportId;
|
||||
|
||||
private long totalAssertions = 0;
|
||||
|
||||
private long passAssertions = 0;
|
||||
|
||||
private RequestResult requestResult;
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package io.metersphere.api.dto;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
public class ApiReportBatchRequest extends QueryAPIReportRequest {
|
||||
|
||||
private List<String> ids;
|
||||
|
||||
/**
|
||||
* isSelectAllDate:选择的数据是否是全部数据(全部数据是不受分页影响的数据)
|
||||
* filters: 数据状态
|
||||
* name:如果是全部数据,那么表格如果历经查询,查询参数是什么
|
||||
* moduleIds: 哪些模块的数据
|
||||
* unSelectIds:是否在页面上有未勾选的数据,有的话他们的ID是哪些。
|
||||
* filters/name/moduleIds/unSeelctIds 只在isSelectAllDate为true时需要。为了让程序能明确批量的范围。
|
||||
*/
|
||||
private boolean isSelectAllDate;
|
||||
|
||||
private List<String> unSelectIds;
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package io.metersphere.api.dto;
|
||||
|
||||
import io.metersphere.base.domain.ApiTestReport;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
public class ApiReportResult extends ApiTestReport {
|
||||
|
||||
private String testName;
|
||||
|
||||
private String projectName;
|
||||
|
||||
private String userName;
|
||||
|
||||
private List<String> scenarioIds;
|
||||
|
||||
private String content;
|
||||
}
|
|
@ -27,7 +27,7 @@ public class ApiScenarioReportDTO {
|
|||
private long scenarioStepError;
|
||||
private long scenarioStepSuccess;
|
||||
private long scenarioStepErrorReport;
|
||||
private long scenarioStepUnExecuteReport;
|
||||
private long scenarioStepPending;
|
||||
|
||||
|
||||
private long totalAssertions = 0;
|
|
@ -0,0 +1,17 @@
|
|||
package io.metersphere.api.dto;
|
||||
|
||||
import io.metersphere.base.domain.CustomFunctionWithBLOBs;
|
||||
import io.metersphere.request.OrderRequest;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class CustomFunctionRequest extends CustomFunctionWithBLOBs {
|
||||
private Map<String, List<String>> filters;
|
||||
private List<OrderRequest> orders;
|
||||
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
package io.metersphere.api.dto;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class FileOperationRequest {
|
||||
private String id;
|
||||
private String name;
|
||||
}
|
|
@ -13,4 +13,4 @@ public class HashTreeInfoDTO {
|
|||
private String jmx;
|
||||
private HashTree hashTree;
|
||||
private List<FileMetadata> repositoryFiles;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package io.metersphere.api.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Data
|
||||
public class MsgDTO {
|
||||
private String reportId;
|
||||
private String toReport;
|
||||
private boolean execEnd;
|
||||
private String content;
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
package io.metersphere.api.dto;
|
||||
|
||||
import io.metersphere.controller.request.OrderRequest;
|
||||
import io.metersphere.request.OrderRequest;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package io.metersphere.api.dto;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class QueryReferenceRequest {
|
||||
private String scenarioId;
|
||||
private String apiId;
|
||||
private String loadId;
|
||||
private String projectId;
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
package io.metersphere.api.dto;
|
||||
|
||||
import io.metersphere.base.domain.TestPlan;
|
||||
import io.metersphere.request.OrderRequest;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class QueryTestPlanRequest extends TestPlan {
|
||||
|
||||
private boolean recent = false;
|
||||
|
||||
private List<String> planIds;
|
||||
|
||||
private String scenarioId;
|
||||
|
||||
private String apiId;
|
||||
|
||||
private String loadId;
|
||||
|
||||
private List<OrderRequest> orders;
|
||||
|
||||
private Map<String, List<String>> filters;
|
||||
|
||||
private Map<String, Object> combine;
|
||||
|
||||
private String projectId;
|
||||
|
||||
private String projectName;
|
||||
|
||||
/**
|
||||
* 执行人或者负责人
|
||||
*/
|
||||
private String executorOrPrincipal;
|
||||
|
||||
/**
|
||||
* 是否通过筛选条件查询(这个字段针对我的工作台-页面列表上的筛选做特殊处理)
|
||||
*/
|
||||
private boolean byFilter;
|
||||
|
||||
private List<String> filterStatus;
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package io.metersphere.api.dto.scenario.request.dubbo;
|
||||
package io.metersphere.api.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package io.metersphere.track.dto;
|
||||
package io.metersphere.api.dto;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
|
@ -0,0 +1,15 @@
|
|||
package io.metersphere.api.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class ReplaceFileIdRequest {
|
||||
private String newFileMetadataId;
|
||||
private String oldFileMetadataId;
|
||||
private List<String> apiIdList = new ArrayList<>();
|
||||
private List<String> apiTestCaseIdList = new ArrayList<>();
|
||||
private List<String> apiScenarioIdList = new ArrayList<>();
|
||||
}
|
|
@ -1,7 +1,8 @@
|
|||
package io.metersphere.api.dto;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
import io.metersphere.base.domain.ApiScenarioReportResultWithBLOBs;
|
||||
import io.metersphere.commons.utils.JSON;
|
||||
import io.metersphere.commons.utils.LogUtil;
|
||||
import io.metersphere.dto.RequestResult;
|
||||
import io.metersphere.dto.ResponseResult;
|
||||
|
@ -32,7 +33,7 @@ public class RequestResultExpandDTO extends RequestResult {
|
|||
public RequestResultExpandDTO(ApiScenarioReportResultWithBLOBs requestResult) {
|
||||
if (requestResult.getBaseInfo() != null) {
|
||||
try {
|
||||
ApiScenarioReportBaseInfoDTO dto = JSONObject.parseObject(requestResult.getBaseInfo(), ApiScenarioReportBaseInfoDTO.class);
|
||||
ApiScenarioReportBaseInfoDTO dto = JSON.parseObject(requestResult.getBaseInfo(), ApiScenarioReportBaseInfoDTO.class);
|
||||
this.setName(dto.getReqName());
|
||||
this.setSuccess(dto.isReqSuccess());
|
||||
this.setError(dto.getReqError());
|
|
@ -0,0 +1,31 @@
|
|||
package io.metersphere.api.dto;
|
||||
|
||||
import io.metersphere.api.dto.automation.ApiScenarioReportResult;
|
||||
import io.metersphere.base.domain.ApiScenarioWithBLOBs;
|
||||
import io.metersphere.base.domain.UiScenarioWithBLOBs;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class RunModeDataDTO {
|
||||
// 执行HashTree
|
||||
private ApiScenarioWithBLOBs scenario;
|
||||
private UiScenarioWithBLOBs uiScenario;
|
||||
// 测试场景/测试用例
|
||||
private String testId;
|
||||
|
||||
private String reportId;
|
||||
// 初始化报告
|
||||
private ApiScenarioReportResult report;
|
||||
//
|
||||
private String apiCaseId;
|
||||
|
||||
private Map<String, String> planEnvMap;
|
||||
|
||||
public RunModeDataDTO() {
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package io.metersphere.api.dto;
|
||||
|
||||
public class RunningParamKeys {
|
||||
public static final String RUNNING_DEBUG_SAMPLER_NAME = "RunningDebugSampler";
|
||||
public static final String API_ENVIRONMENT_ID = "${__metersphere_env_id}";
|
||||
public static final String RUNNING_PARAMS_PREFIX = "MS.ENV.";
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package io.metersphere.track.request.testcase;
|
||||
package io.metersphere.api.dto;
|
||||
|
||||
import io.metersphere.api.dto.automation.TestPlanScenarioRequest;
|
||||
import lombok.Getter;
|
|
@ -0,0 +1,41 @@
|
|||
package io.metersphere.api.dto;
|
||||
|
||||
import io.metersphere.api.dto.definition.request.auth.MsAuthManager;
|
||||
import io.metersphere.api.dto.scenario.KeyValue;
|
||||
import io.metersphere.base.domain.Schedule;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author song.tianyang
|
||||
* @Date 2021/3/12 12:57 下午
|
||||
* @Description
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class ScheduleRequest extends Schedule {
|
||||
|
||||
//定时任务来源: 测试计划/测试场景
|
||||
private String scheduleFrom;
|
||||
|
||||
private String projectId;
|
||||
|
||||
private String moduleId;
|
||||
|
||||
private String modulePath;
|
||||
|
||||
private String modeId;
|
||||
|
||||
private String swaggerUrl;
|
||||
|
||||
private String taskId;
|
||||
|
||||
// 鉴权相关
|
||||
private List<KeyValue> headers;
|
||||
private List<KeyValue> arguments;
|
||||
private MsAuthManager authManager;
|
||||
private Boolean coverModule = false;
|
||||
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
package io.metersphere.api.dto.automation;
|
||||
|
||||
import io.metersphere.base.domain.FileMetadata;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class ApiScenarioExportJmxDTO {
|
||||
private String name;
|
||||
private String id;
|
||||
private String jmx;
|
||||
private Integer version;
|
||||
|
||||
//性能测试引用场景时需要场景下的附件
|
||||
private List<FileMetadata> fileMetadataList;
|
||||
//项目-环境id
|
||||
private Map<String, List<String>> projectEnvMap;
|
||||
|
||||
public ApiScenarioExportJmxDTO(String name, String jmx) {
|
||||
this.name = StringUtils.replace(name, "/", "");
|
||||
this.jmx = jmx;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
package io.metersphere.api.dto.automation;
|
||||
|
||||
import io.metersphere.dto.TreeNodeDTO;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class ApiScenarioModuleDTO extends TreeNodeDTO<ApiScenarioModuleDTO> {
|
||||
private String path;
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package io.metersphere.api.dto.automation;
|
||||
|
||||
import io.metersphere.base.domain.ApiScenarioReportWithBLOBs;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
public class ApiScenarioReportResult extends ApiScenarioReportWithBLOBs {
|
||||
|
||||
private String testName;
|
||||
|
||||
private String projectName;
|
||||
|
||||
private String testId;
|
||||
|
||||
private String userName;
|
||||
|
||||
private List<String> scenarioIds;
|
||||
|
||||
private String content;
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
package io.metersphere.api.dto.automation;
|
||||
|
||||
import io.metersphere.request.BaseQueryRequest;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class ApiScenarioRequest extends BaseQueryRequest {
|
||||
private String id;
|
||||
private String excludeId;
|
||||
private String moduleId;
|
||||
private String name;
|
||||
private String userId;
|
||||
private String planId;
|
||||
private boolean recent = false;
|
||||
private boolean isSelectThisWeedData;
|
||||
private long createTime = 0;
|
||||
private long scheduleCreateTime = 0;
|
||||
private String executeStatus;
|
||||
private String selectDataType;
|
||||
private boolean notInTestPlan;
|
||||
private String reviewId;
|
||||
private String versionId;
|
||||
private String refId;
|
||||
private Boolean allowedRepeatCase = false;
|
||||
|
||||
//操作人
|
||||
private String operator;
|
||||
//操作时间
|
||||
private Long operationTime;
|
||||
/**
|
||||
* 是否需要查询环境字段
|
||||
*/
|
||||
private boolean selectEnvironment = false;
|
||||
|
||||
//测试计划关联场景过滤掉步骤为0的场景
|
||||
private String stepTotal;
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
package io.metersphere.api.dto.automation;
|
||||
|
||||
import io.metersphere.commons.constants.PropertyConstant;
|
||||
import io.metersphere.commons.utils.LogUtil;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
@ -56,8 +57,8 @@ public class EsbDataStruct {
|
|||
|
||||
this.name = name;
|
||||
|
||||
if(typeLength.startsWith("string")){
|
||||
this.type = "string";
|
||||
if(typeLength.startsWith(PropertyConstant.STRING)){
|
||||
this.type = PropertyConstant.STRING;
|
||||
String lengthStr = typeLength.substring(6);
|
||||
if(lengthStr.startsWith("(") && lengthStr.endsWith(")")){
|
||||
try {
|
||||
|
@ -66,10 +67,10 @@ public class EsbDataStruct {
|
|||
}catch (Exception e){ }
|
||||
|
||||
}
|
||||
}else if(typeLength.startsWith("array")){
|
||||
this.type = "array";
|
||||
}else if(typeLength.startsWith(PropertyConstant.ARRAY)){
|
||||
this.type = PropertyConstant.ARRAY;
|
||||
}else{
|
||||
this.type = "object";
|
||||
this.type = PropertyConstant.OBJECT;
|
||||
}
|
||||
|
||||
if(StringUtils.isEmpty(desc)){desc = "";}
|
||||
|
@ -113,12 +114,11 @@ public class EsbDataStruct {
|
|||
Element element = null;
|
||||
try {
|
||||
element = document.addElement(this.name);
|
||||
if (StringUtils.equalsAnyIgnoreCase(type, "string", "array")) {
|
||||
long lengthNum = Long.parseLong(this.contentType);
|
||||
if (StringUtils.equalsAnyIgnoreCase(type, PropertyConstant.STRING, PropertyConstant.ARRAY)) {
|
||||
String attrString = "";
|
||||
if (StringUtils.equalsIgnoreCase(this.type, "string")) {
|
||||
if (StringUtils.equalsIgnoreCase(this.type, PropertyConstant.STRING)) {
|
||||
attrString = "s," + contentType;
|
||||
} else if (StringUtils.equalsIgnoreCase(this.type, "array")) {
|
||||
} else if (StringUtils.equalsIgnoreCase(this.type, PropertyConstant.ARRAY)) {
|
||||
attrString = "a," + contentType;
|
||||
}
|
||||
element.addAttribute("attr", attrString);
|
||||
|
@ -152,12 +152,11 @@ public class EsbDataStruct {
|
|||
Element element = null;
|
||||
try {
|
||||
element = document.addElement(this.name);
|
||||
if (StringUtils.equalsAnyIgnoreCase(type, "string", "array")) {
|
||||
long lengthNum = Long.parseLong(this.contentType);
|
||||
if (StringUtils.equalsAnyIgnoreCase(type, PropertyConstant.STRING, PropertyConstant.ARRAY)) {
|
||||
String attrString = "";
|
||||
if (StringUtils.equalsIgnoreCase(this.type, "string")) {
|
||||
if (StringUtils.equalsIgnoreCase(this.type, PropertyConstant.STRING)) {
|
||||
attrString = "s," + contentType;
|
||||
} else if (StringUtils.equalsIgnoreCase(this.type, "array")) {
|
||||
} else if (StringUtils.equalsIgnoreCase(this.type, PropertyConstant.ARRAY)) {
|
||||
attrString = "a," + contentType;
|
||||
}
|
||||
element.addAttribute("attr", attrString);
|
|
@ -1,7 +1,6 @@
|
|||
package io.metersphere.api.dto.automation;
|
||||
|
||||
import io.metersphere.base.domain.ApiScenario;
|
||||
import io.metersphere.track.dto.TestPlanDTO;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
package io.metersphere.api.dto.automation;
|
||||
|
||||
import io.metersphere.dto.RunModeConfigDTO;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
public class RunScenarioRequest {
|
||||
private String id;
|
||||
|
||||
private String reportId;
|
||||
|
||||
private String environmentId;
|
||||
|
||||
private String projectId;
|
||||
|
||||
private String triggerMode;
|
||||
|
||||
private String executeType;
|
||||
|
||||
private String runMode;
|
||||
|
||||
/**
|
||||
* 测试情景和测试计划的关联ID
|
||||
*/
|
||||
private String planScenarioId;
|
||||
|
||||
private List<String> planCaseIds;
|
||||
|
||||
private List<String> ids;
|
||||
|
||||
private String reportUserID;
|
||||
|
||||
private Map<String, String> scenarioTestPlanIdMap;
|
||||
|
||||
private ApiScenarioRequest condition;
|
||||
|
||||
private RunModeConfigDTO config;
|
||||
|
||||
private boolean isTestPlanScheduleJob = false;
|
||||
|
||||
//生成测试报告:当isTestPlanScheduleJob为ture时使用
|
||||
private String testPlanReportId;
|
||||
|
||||
private String requestOriginator;
|
||||
|
||||
// 失败重跑
|
||||
private boolean isRerun;
|
||||
private String serialReportId;
|
||||
private Map<String, ApiScenarioReportResult> reportMap;
|
||||
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
package io.metersphere.api.dto.automation;
|
||||
|
||||
public enum ScenarioStatus {
|
||||
// Saved, Success, Error, Timeout, Fail, Trash, Underway
|
||||
}
|
|
@ -0,0 +1,160 @@
|
|||
package io.metersphere.api.dto.automation;
|
||||
|
||||
import io.metersphere.commons.constants.PropertyConstant;
|
||||
import io.metersphere.commons.utils.LogUtil;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.dom4j.Document;
|
||||
import org.dom4j.Element;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* 树形表格数据格式
|
||||
*
|
||||
* @author song.tianyang
|
||||
* @Date 2021/3/15 4:37 下午
|
||||
* @Description
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class TcpTreeTableDataStruct {
|
||||
private String uuid;
|
||||
private String name;
|
||||
private String value;
|
||||
private String type;
|
||||
private String systemName;
|
||||
private String contentType;
|
||||
private String condition;
|
||||
private boolean required;
|
||||
private String description;
|
||||
private List<TcpTreeTableDataStruct> children;
|
||||
private String status = "";
|
||||
|
||||
public void init(){
|
||||
this.uuid = UUID.randomUUID().toString();
|
||||
this.systemName = "";
|
||||
this.description = "";
|
||||
this.value="";
|
||||
this.required = true;
|
||||
this.contentType = "";
|
||||
this.type = "";
|
||||
this.children = new ArrayList<>();
|
||||
}
|
||||
|
||||
public TcpTreeTableDataStruct copy(boolean copyChildren) {
|
||||
TcpTreeTableDataStruct returnObj = new TcpTreeTableDataStruct();
|
||||
returnObj.name = this.name;
|
||||
returnObj.value = this.value;
|
||||
returnObj.type = this.type;
|
||||
returnObj.systemName = this.systemName;
|
||||
returnObj.contentType = this.contentType;
|
||||
returnObj.required = this.required;
|
||||
returnObj.description = this.description;
|
||||
if (copyChildren) {
|
||||
returnObj.children = this.children;
|
||||
} else {
|
||||
returnObj.children = new ArrayList<>();
|
||||
}
|
||||
return returnObj;
|
||||
}
|
||||
|
||||
public Element genXmlElementByChildren(Element document) {
|
||||
this.name = this.name.replace("&", "&").replace("<", "<").replace(">", ">")
|
||||
.replace("\"", """).replace("©", "'");
|
||||
if (StringUtils.isEmpty(this.name)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Element element = null;
|
||||
try {
|
||||
element = document.addElement(this.name);
|
||||
if (StringUtils.equalsAnyIgnoreCase(type, PropertyConstant.STRING, PropertyConstant.ARRAY)) {
|
||||
String attrString = "";
|
||||
if (StringUtils.equalsIgnoreCase(this.type, PropertyConstant.STRING)) {
|
||||
attrString = "s," + contentType;
|
||||
} else if (StringUtils.equalsIgnoreCase(this.type, PropertyConstant.ARRAY)) {
|
||||
attrString = "a," + contentType;
|
||||
}
|
||||
element.addAttribute("attr", attrString);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LogUtil.error(e);
|
||||
}
|
||||
|
||||
if (element != null) {
|
||||
if (this.children == null || this.children.isEmpty()) {
|
||||
if(this.value == null ){
|
||||
this.value = "";
|
||||
}
|
||||
element.addText(this.value);
|
||||
} else {
|
||||
for (TcpTreeTableDataStruct child : children) {
|
||||
child.genXmlElementByChildren(element);
|
||||
}
|
||||
}
|
||||
}
|
||||
return element;
|
||||
}
|
||||
|
||||
public Element genXmlElementByDocument(Document document) {
|
||||
this.name = this.name.replace("&", "&").replace("<", "<").replace(">", ">")
|
||||
.replace("\"", """).replace("©", "'");
|
||||
if (StringUtils.isEmpty(this.name)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Element element = null;
|
||||
try {
|
||||
element = document.addElement(this.name);
|
||||
if (StringUtils.equalsAnyIgnoreCase(type, PropertyConstant.STRING, PropertyConstant.ARRAY)) {
|
||||
String attrString = "";
|
||||
if (StringUtils.equalsIgnoreCase(this.type, PropertyConstant.STRING)) {
|
||||
attrString = "s," + contentType;
|
||||
} else if (StringUtils.equalsIgnoreCase(this.type, PropertyConstant.ARRAY)) {
|
||||
attrString = "a," + contentType;
|
||||
}
|
||||
element.addAttribute("attr", attrString);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LogUtil.error(e);
|
||||
}
|
||||
|
||||
if (element != null) {
|
||||
if (this.children == null || this.children.isEmpty()) {
|
||||
if(this.value == null){
|
||||
element.addText("");
|
||||
}else {
|
||||
element.addText(this.value);
|
||||
}
|
||||
} else {
|
||||
for (TcpTreeTableDataStruct child : children) {
|
||||
child.genXmlElementByChildren(element);
|
||||
}
|
||||
}
|
||||
}
|
||||
return element;
|
||||
}
|
||||
|
||||
public List<String> getNameDeep() {
|
||||
List<String> returnList = new ArrayList<>();
|
||||
if(StringUtils.isNotEmpty(this.name)){
|
||||
returnList.add(this.name);
|
||||
}
|
||||
if(CollectionUtils.isNotEmpty(this.children)){
|
||||
for (TcpTreeTableDataStruct child :this.children) {
|
||||
List<String> itemNameList = child.getNameDeep();
|
||||
for (String itemName :itemNameList) {
|
||||
if(!returnList.contains(itemName)){
|
||||
returnList.add(itemName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return returnList;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
package io.metersphere.api.dto.automation;
|
||||
|
||||
import io.metersphere.base.domain.TestPlanWithBLOBs;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class TestPlanDTO extends TestPlanWithBLOBs {
|
||||
private String projectName;
|
||||
private String userName;
|
||||
private List<String> projectIds;
|
||||
private List<String> principals;
|
||||
private List<String> follows;
|
||||
/**
|
||||
* 定时任务ID
|
||||
*/
|
||||
private String scheduleId;
|
||||
/**
|
||||
* 定时任务是否开启
|
||||
*/
|
||||
private boolean scheduleOpen;
|
||||
/**
|
||||
* 定时任务状态
|
||||
*/
|
||||
private String scheduleStatus;
|
||||
/**
|
||||
* 定时任务规则
|
||||
*/
|
||||
private String scheduleCorn;
|
||||
/**
|
||||
* 定时任务下一次执行时间
|
||||
*/
|
||||
private Long scheduleExecuteTime;
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
package io.metersphere.api.dto.automation;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class TestPlanFailureScenarioDTO extends ApiScenarioDTO {
|
||||
private ApiScenarioReportResult response;
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
package io.metersphere.api.dto.automation;
|
||||
|
||||
import io.metersphere.controller.request.OrderRequest;
|
||||
import io.metersphere.request.OrderRequest;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package io.metersphere.api.dto.datacount;
|
||||
|
||||
import io.metersphere.track.dto.TestPlanDTO;
|
||||
import io.metersphere.api.dto.automation.TestPlanDTO;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package io.metersphere.api.dto.datacount.request;
|
||||
import io.metersphere.request.OrderRequest;
|
||||
import io.metersphere.request.TestPlanRequest;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class QueryTestPlanRequest extends TestPlanRequest {
|
||||
private String workspaceId;
|
||||
private String userId;
|
||||
private List<OrderRequest> orders;
|
||||
private Map<String, List<String>> filters;
|
||||
private Map<String, Object> combine;
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package io.metersphere.api.dto.datacount.request;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author song.tianyang
|
||||
* @Date 2020/12/17 5:04 下午
|
||||
* @Description
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class ScheduleInfoRequest {
|
||||
private String taskID;
|
||||
private boolean enable;
|
||||
private List<String> taskIds;
|
||||
private boolean selectAll;
|
||||
private QueryTestPlanRequest queryTestPlanRequest;
|
||||
}
|
|
@ -1,8 +1,9 @@
|
|||
package io.metersphere.api.dto.datacount.response;
|
||||
|
||||
import io.metersphere.api.dto.datacount.ApiDataCountResult;
|
||||
import io.metersphere.api.dto.scenario.request.RequestType;
|
||||
import io.metersphere.commons.constants.ExecuteResult;
|
||||
import io.metersphere.commons.constants.RequestTypeConstants;
|
||||
import io.metersphere.commons.enums.ApiReportStatus;
|
||||
import io.metersphere.commons.enums.ApiTestDataStatus;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
@ -131,16 +132,16 @@ public class ApiDataCountDTO {
|
|||
for (ApiDataCountResult countResult :
|
||||
countResultList) {
|
||||
switch (countResult.getGroupField().toUpperCase()) {
|
||||
case RequestType.DUBBO:
|
||||
case RequestTypeConstants.DUBBO:
|
||||
this.rpcApiDataCountNumber += countResult.getCountNumber();
|
||||
break;
|
||||
case RequestType.HTTP:
|
||||
case RequestTypeConstants.HTTP:
|
||||
this.httpApiDataCountNumber += countResult.getCountNumber();
|
||||
break;
|
||||
case RequestType.SQL:
|
||||
case RequestTypeConstants.SQL:
|
||||
this.sqlApiDataCountNumber += countResult.getCountNumber();
|
||||
break;
|
||||
case RequestType.TCP:
|
||||
case RequestTypeConstants.TCP:
|
||||
this.tcpApiDataCountNumber += countResult.getCountNumber();
|
||||
break;
|
||||
default:
|
||||
|
@ -159,13 +160,13 @@ public class ApiDataCountDTO {
|
|||
public void countStatus(List<ApiDataCountResult> countResultList) {
|
||||
for (ApiDataCountResult countResult :
|
||||
countResultList) {
|
||||
if (StringUtils.equalsIgnoreCase(countResult.getGroupField(), "Underway")) {
|
||||
if (StringUtils.equalsIgnoreCase(countResult.getGroupField(), ApiTestDataStatus.UNDERWAY.getValue())) {
|
||||
//运行中
|
||||
this.runningCount += countResult.getCountNumber();
|
||||
} else if (StringUtils.equalsIgnoreCase(countResult.getGroupField(), "Completed")) {
|
||||
} else if (StringUtils.equalsIgnoreCase(countResult.getGroupField(), ApiTestDataStatus.COMPLETED.getValue())) {
|
||||
//已完成
|
||||
this.finishedCount += countResult.getCountNumber();
|
||||
} else if (StringUtils.equalsIgnoreCase(countResult.getGroupField(), "Prepare")) {
|
||||
} else if (StringUtils.equalsIgnoreCase(countResult.getGroupField(), ApiTestDataStatus.PREPARE.getValue())) {
|
||||
this.notStartedCount += countResult.getCountNumber();
|
||||
}
|
||||
}
|
||||
|
@ -184,11 +185,11 @@ public class ApiDataCountDTO {
|
|||
|
||||
public void countRunResult(List<ApiDataCountResult> countResultByRunResult) {
|
||||
for (ApiDataCountResult countResult : countResultByRunResult) {
|
||||
if (StringUtils.equalsAnyIgnoreCase(countResult.getGroupField(), "notRun", "unexecute") || StringUtils.isEmpty(countResult.getGroupField())) {
|
||||
if (StringUtils.equalsAnyIgnoreCase(countResult.getGroupField(), "notRun", ApiReportStatus.PENDING.name()) || StringUtils.isEmpty(countResult.getGroupField())) {
|
||||
this.unexecuteCount += countResult.getCountNumber();
|
||||
} else if ("Fail".equals(countResult.getGroupField())) {
|
||||
} else if (ApiReportStatus.ERROR.name().equals(countResult.getGroupField())) {
|
||||
this.executionFailedCount += countResult.getCountNumber();
|
||||
} else if (StringUtils.equalsAnyIgnoreCase(countResult.getGroupField(), ExecuteResult.ERROR_REPORT_RESULT.toString(), ExecuteResult.ERROR_REPORT.toString())) {
|
||||
} else if (StringUtils.equalsAnyIgnoreCase(countResult.getGroupField(), ApiReportStatus.FAKE_ERROR.name())) {
|
||||
this.fakeErrorCount += countResult.getCountNumber();
|
||||
} else {
|
||||
this.executionPassCount += countResult.getCountNumber();
|
||||
|
@ -198,13 +199,13 @@ public class ApiDataCountDTO {
|
|||
|
||||
public void countScheduleExecute(List<ApiDataCountResult> allExecuteResult) {
|
||||
for (ApiDataCountResult countResult : allExecuteResult) {
|
||||
if (StringUtils.equalsIgnoreCase(countResult.getGroupField(), "success")) {
|
||||
if (StringUtils.equalsIgnoreCase(countResult.getGroupField(), ApiReportStatus.SUCCESS.name())) {
|
||||
this.successCount += countResult.getCountNumber();
|
||||
this.executedCount += countResult.getCountNumber();
|
||||
} else if (StringUtils.equalsAnyIgnoreCase(countResult.getGroupField(), ExecuteResult.SCENARIO_ERROR.toString(), "Fail")) {
|
||||
} else if (StringUtils.equalsAnyIgnoreCase(countResult.getGroupField(), ApiReportStatus.ERROR.name())) {
|
||||
this.failedCount += countResult.getCountNumber();
|
||||
this.executedCount += countResult.getCountNumber();
|
||||
} else if (StringUtils.equalsAnyIgnoreCase(countResult.getGroupField(), ExecuteResult.ERROR_REPORT_RESULT.toString())) {
|
||||
} else if (StringUtils.equalsAnyIgnoreCase(countResult.getGroupField(), ApiReportStatus.FAKE_ERROR.name())) {
|
||||
this.fakeErrorCount += countResult.getCountNumber();
|
||||
this.executedCount += countResult.getCountNumber();
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
package io.metersphere.api.dto.datacount.response;
|
||||
|
||||
import io.metersphere.track.dto.TestPlanDTO;
|
||||
import io.metersphere.api.dto.automation.TestPlanDTO;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
package io.metersphere.api.dto.definition;
|
||||
|
||||
import io.metersphere.base.domain.ApiDefinitionWithBLOBs;
|
||||
import io.metersphere.controller.request.OrderRequest;
|
||||
import io.metersphere.request.OrderRequest;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package io.metersphere.api.dto.definition;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author song.tianyang
|
||||
* @Date 2021/4/6 5:32 下午
|
||||
* @Description
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class ApiCaseBatchCondition extends ApiTestCaseRequest {
|
||||
private boolean selectAll;
|
||||
private List<String> unSelectIds;
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
package io.metersphere.api.dto.definition;
|
||||
|
||||
import io.metersphere.api.dto.ApiTestImportRequest;
|
||||
import io.metersphere.api.dto.mockconfig.MockConfigImportDTO;
|
||||
import io.metersphere.api.dto.mock.config.MockConfigImportDTO;
|
||||
import io.metersphere.base.domain.ApiDefinitionWithBLOBs;
|
||||
import io.metersphere.base.domain.ApiTestCaseWithBLOBs;
|
||||
import lombok.Getter;
|
|
@ -1,6 +1,6 @@
|
|||
package io.metersphere.api.dto.definition;
|
||||
|
||||
import io.metersphere.controller.request.RelationshipEdgeRequest;
|
||||
import io.metersphere.request.RelationshipEdgeRequest;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
package io.metersphere.api.dto.definition;
|
||||
|
||||
import io.metersphere.request.ApiSyncCaseRequest;
|
||||
import io.metersphere.request.BaseQueryRequest;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class ApiDefinitionRequest extends BaseQueryRequest {
|
||||
|
||||
private String id;
|
||||
private String excludeId;
|
||||
private String moduleId;
|
||||
private String module;
|
||||
private String protocol;
|
||||
private String name;
|
||||
private String userId;
|
||||
private String planId;
|
||||
private boolean recent = false;
|
||||
private boolean isSelectThisWeedData = false;
|
||||
private long createTime = 0;
|
||||
private String status;
|
||||
private String apiCoverage;
|
||||
private String apiCaseCoverage;
|
||||
private String scenarioCoverage;
|
||||
private String reviewId;
|
||||
private String refId;
|
||||
private String versionId;
|
||||
private String path;
|
||||
private String method;
|
||||
|
||||
//被场景覆盖的接口id集合
|
||||
private List<String> coverageIds;
|
||||
|
||||
// 测试计划是否允许重复
|
||||
private boolean repeatCase;
|
||||
//是否进入待更新列表
|
||||
private Boolean toBeUpdated;
|
||||
|
||||
//当前时间减去进入待更新的时间
|
||||
private Long toBeUpdateTime;
|
||||
|
||||
//同步配置
|
||||
private ApiSyncCaseRequest syncConfig;
|
||||
|
||||
//全选
|
||||
private boolean selectAll;
|
||||
|
||||
private Long deleteTime;
|
||||
private String deleteUserId;
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package io.metersphere.api.dto.definition;
|
||||
|
||||
import io.metersphere.dto.TreeNodeDTO;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class ApiModuleDTO extends TreeNodeDTO<ApiModuleDTO> {
|
||||
private String protocol;
|
||||
|
||||
private String path;
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
package io.metersphere.api.dto.definition;
|
||||
|
||||
import io.metersphere.base.domain.ApiTestCaseWithBLOBs;
|
||||
import io.metersphere.controller.request.OrderRequest;
|
||||
import io.metersphere.request.OrderRequest;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
package io.metersphere.api.dto.definition;
|
||||
|
||||
import io.metersphere.request.ApiSyncCaseRequest;
|
||||
import io.metersphere.request.BaseQueryRequest;
|
||||
import io.metersphere.request.OrderRequest;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class ApiTestCaseRequest extends BaseQueryRequest {
|
||||
private String id;
|
||||
private List<String> ids;
|
||||
private String planId;
|
||||
private String projectId;
|
||||
private String priority;
|
||||
private String name;
|
||||
private String environmentId;
|
||||
private String workspaceId;
|
||||
private String apiDefinitionId;
|
||||
private String status;
|
||||
private String protocol;
|
||||
private String moduleId;
|
||||
private List<String> moduleIds;
|
||||
private List<OrderRequest> orders;
|
||||
private Map<String, List<String>> filters;
|
||||
private Map<String, Object> combine;
|
||||
private boolean isSelectThisWeedData;
|
||||
private long createTime = 0;
|
||||
private long updateTime = 0;
|
||||
private String reviewId;
|
||||
private String deleteUserId;
|
||||
private long deleteTime;
|
||||
private Boolean allowedRepeatCase = false;
|
||||
/**
|
||||
* 检查待更新的(近三天有更新的或者状态为error的)
|
||||
*/
|
||||
private boolean toUpdate;
|
||||
/**
|
||||
* 是否进入待更新列表
|
||||
*/
|
||||
private boolean toBeUpdated;
|
||||
|
||||
/**
|
||||
* 当前时间减去进入待更新的时间
|
||||
*/
|
||||
private Long toBeUpdateTime;
|
||||
|
||||
/**
|
||||
* 进入待更新列表用例状态集合
|
||||
*/
|
||||
private List<String> statusList;
|
||||
/**
|
||||
* 不需要查用例状态
|
||||
*/
|
||||
private boolean noSearchStatus;
|
||||
|
||||
/**
|
||||
* 是否需要查询环境字段
|
||||
*/
|
||||
private boolean selectEnvironment = false;
|
||||
|
||||
/**
|
||||
* 查询排除一些接口
|
||||
*/
|
||||
private List<String> notInIds;
|
||||
|
||||
//页面跳转时附带的过滤条件
|
||||
private String redirectFilter;
|
||||
|
||||
//同步配置
|
||||
private ApiSyncCaseRequest syncConfig;
|
||||
|
||||
//全选
|
||||
private boolean selectAll;
|
||||
}
|
|
@ -1,9 +1,8 @@
|
|||
package io.metersphere.api.dto.definition;
|
||||
|
||||
import io.metersphere.api.dto.mockconfig.MockConfigImportDTO;
|
||||
import io.metersphere.api.dto.mock.config.MockConfigImportDTO;
|
||||
import io.metersphere.base.domain.ApiDefinitionWithBLOBs;
|
||||
import io.metersphere.base.domain.ApiTestCaseWithBLOBs;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue