feat(接口自动化): 导入jmx 增加HashTree 有序处理

This commit is contained in:
fit2-zhao 2021-02-09 14:56:14 +08:00
parent 298e8df45a
commit 16283572c7
3 changed files with 1313 additions and 221 deletions

View File

@ -332,7 +332,7 @@ public class MsJmeterParser extends ScenarioImportAbstractParser {
private void jmterHashTree(HashTree tree, MsTestElement scenario) { private void jmterHashTree(HashTree tree, MsTestElement scenario) {
for (Object key : tree.keySet()) { for (Object key : tree.keySet()) {
MsTestElement elementNode = null; MsTestElement elementNode;
if (CollectionUtils.isEmpty(scenario.getHashTree())) { if (CollectionUtils.isEmpty(scenario.getHashTree())) {
scenario.setHashTree(new LinkedList<>()); scenario.setHashTree(new LinkedList<>());
} }

View File

@ -1,231 +1,228 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="io.metersphere.base.mapper.SwaggerUrlProjectMapper"> <mapper namespace="io.metersphere.base.mapper.SwaggerUrlProjectMapper">
<resultMap id="BaseResultMap" type="io.metersphere.base.domain.SwaggerUrlProject"> <resultMap id="BaseResultMap" type="io.metersphere.base.domain.SwaggerUrlProject">
<id column="id" jdbcType="VARCHAR" property="id"/> <id column="id" jdbcType="VARCHAR" property="id" />
<result column="project_id" jdbcType="VARCHAR" property="projectId"/> <result column="project_id" jdbcType="VARCHAR" property="projectId" />
<result column="swagger_url" jdbcType="VARCHAR" property="swaggerUrl"/> <result column="swagger_url" jdbcType="VARCHAR" property="swaggerUrl" />
<result column="module_id" jdbcType="VARCHAR" property="moduleId"/> <result column="module_id" jdbcType="VARCHAR" property="moduleId" />
<result column="module_path" jdbcType="VARCHAR" property="modulePath"/> <result column="module_path" jdbcType="VARCHAR" property="modulePath" />
<result column="mode_id" jdbcType="VARCHAR" property="modeId"/> <result column="mode_id" jdbcType="VARCHAR" property="modeId" />
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
<where> <where>
<foreach collection="oredCriteria" item="criteria" separator="or"> <foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid"> <if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")"> <trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion"> <foreach collection="criteria.criteria" item="criterion">
<choose> <choose>
<when test="criterion.noValue"> <when test="criterion.noValue">
and ${criterion.condition} and ${criterion.condition}
</when> </when>
<when test="criterion.singleValue"> <when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value} and ${criterion.condition} #{criterion.value}
</when> </when>
<when test="criterion.betweenValue"> <when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when> </when>
<when test="criterion.listValue"> <when test="criterion.listValue">
and ${criterion.condition} and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
separator=","> #{listItem}
#{listItem} </foreach>
</foreach> </when>
</when> </choose>
</choose>
</foreach>
</trim>
</if>
</foreach> </foreach>
</where> </trim>
</sql> </if>
<sql id="Update_By_Example_Where_Clause"> </foreach>
<where> </where>
<foreach collection="example.oredCriteria" item="criteria" separator="or"> </sql>
<if test="criteria.valid"> <sql id="Update_By_Example_Where_Clause">
<trim prefix="(" prefixOverrides="and" suffix=")"> <where>
<foreach collection="criteria.criteria" item="criterion"> <foreach collection="example.oredCriteria" item="criteria" separator="or">
<choose> <if test="criteria.valid">
<when test="criterion.noValue"> <trim prefix="(" prefixOverrides="and" suffix=")">
and ${criterion.condition} <foreach collection="criteria.criteria" item="criterion">
</when> <choose>
<when test="criterion.singleValue"> <when test="criterion.noValue">
and ${criterion.condition} #{criterion.value} and ${criterion.condition}
</when> </when>
<when test="criterion.betweenValue"> <when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} and ${criterion.condition} #{criterion.value}
</when> </when>
<when test="criterion.listValue"> <when test="criterion.betweenValue">
and ${criterion.condition} and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
<foreach close=")" collection="criterion.value" item="listItem" open="(" </when>
separator=","> <when test="criterion.listValue">
#{listItem} and ${criterion.condition}
</foreach> <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
</when> #{listItem}
</choose> </foreach>
</foreach> </when>
</trim> </choose>
</if>
</foreach> </foreach>
</where> </trim>
</sql>
<sql id="Base_Column_List">
id, project_id, swagger_url, module_id, module_path, mode_id
</sql>
<select id="selectByExample" parameterType="io.metersphere.base.domain.SwaggerUrlProjectExample"
resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if> </if>
<include refid="Base_Column_List"/> </foreach>
from swagger_url_project </where>
<if test="_parameter != null"> </sql>
<include refid="Example_Where_Clause"/> <sql id="Base_Column_List">
</if> id, project_id, swagger_url, module_id, module_path, mode_id
<if test="orderByClause != null"> </sql>
order by ${orderByClause} <select id="selectByExample" parameterType="io.metersphere.base.domain.SwaggerUrlProjectExample" resultMap="BaseResultMap">
</if> select
</select> <if test="distinct">
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap"> distinct
select </if>
<include refid="Base_Column_List"/> <include refid="Base_Column_List" />
from swagger_url_project from swagger_url_project
where id = #{id,jdbcType=VARCHAR} <if test="_parameter != null">
</select> <include refid="Example_Where_Clause" />
<delete id="deleteByPrimaryKey" parameterType="java.lang.String"> </if>
delete <if test="orderByClause != null">
from swagger_url_project order by ${orderByClause}
where id = #{id,jdbcType=VARCHAR} </if>
</delete> </select>
<delete id="deleteByExample" parameterType="io.metersphere.base.domain.SwaggerUrlProjectExample"> <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
delete from swagger_url_project select
<if test="_parameter != null"> <include refid="Base_Column_List" />
<include refid="Example_Where_Clause"/> from swagger_url_project
</if> where id = #{id,jdbcType=VARCHAR}
</delete> </select>
<insert id="insert" parameterType="io.metersphere.base.domain.SwaggerUrlProject"> <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
insert into swagger_url_project (id, project_id, swagger_url, delete from swagger_url_project
module_id, module_path, mode_id) where id = #{id,jdbcType=VARCHAR}
values (#{id,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{swaggerUrl,jdbcType=VARCHAR}, </delete>
#{moduleId,jdbcType=VARCHAR}, #{modulePath,jdbcType=VARCHAR}, #{modeId,jdbcType=VARCHAR}) <delete id="deleteByExample" parameterType="io.metersphere.base.domain.SwaggerUrlProjectExample">
</insert> delete from swagger_url_project
<insert id="insertSelective" parameterType="io.metersphere.base.domain.SwaggerUrlProject"> <if test="_parameter != null">
insert into swagger_url_project <include refid="Example_Where_Clause" />
<trim prefix="(" suffix=")" suffixOverrides=","> </if>
<if test="id != null"> </delete>
id, <insert id="insert" parameterType="io.metersphere.base.domain.SwaggerUrlProject">
</if> insert into swagger_url_project (id, project_id, swagger_url,
<if test="projectId != null"> module_id, module_path, mode_id
project_id, )
</if> values (#{id,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{swaggerUrl,jdbcType=VARCHAR},
<if test="swaggerUrl != null"> #{moduleId,jdbcType=VARCHAR}, #{modulePath,jdbcType=VARCHAR}, #{modeId,jdbcType=VARCHAR}
swagger_url, )
</if> </insert>
<if test="moduleId != null"> <insert id="insertSelective" parameterType="io.metersphere.base.domain.SwaggerUrlProject">
module_id, insert into swagger_url_project
</if> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="modulePath != null"> <if test="id != null">
module_path, id,
</if> </if>
<if test="modeId != null"> <if test="projectId != null">
mode_id, project_id,
</if> </if>
</trim> <if test="swaggerUrl != null">
<trim prefix="values (" suffix=")" suffixOverrides=","> swagger_url,
<if test="id != null"> </if>
#{id,jdbcType=VARCHAR}, <if test="moduleId != null">
</if> module_id,
<if test="projectId != null"> </if>
#{projectId,jdbcType=VARCHAR}, <if test="modulePath != null">
</if> module_path,
<if test="swaggerUrl != null"> </if>
#{swaggerUrl,jdbcType=VARCHAR}, <if test="modeId != null">
</if> mode_id,
<if test="moduleId != null"> </if>
#{moduleId,jdbcType=VARCHAR}, </trim>
</if> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="modulePath != null"> <if test="id != null">
#{modulePath,jdbcType=VARCHAR}, #{id,jdbcType=VARCHAR},
</if> </if>
<if test="modeId != null"> <if test="projectId != null">
#{modeId,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR},
</if> </if>
</trim> <if test="swaggerUrl != null">
</insert> #{swaggerUrl,jdbcType=VARCHAR},
<select id="countByExample" parameterType="io.metersphere.base.domain.SwaggerUrlProjectExample" </if>
resultType="java.lang.Long"> <if test="moduleId != null">
select count(*) from swagger_url_project #{moduleId,jdbcType=VARCHAR},
<if test="_parameter != null"> </if>
<include refid="Example_Where_Clause"/> <if test="modulePath != null">
</if> #{modulePath,jdbcType=VARCHAR},
</select> </if>
<update id="updateByExampleSelective" parameterType="map"> <if test="modeId != null">
update swagger_url_project #{modeId,jdbcType=VARCHAR},
<set> </if>
<if test="record.id != null"> </trim>
id = #{record.id,jdbcType=VARCHAR}, </insert>
</if> <select id="countByExample" parameterType="io.metersphere.base.domain.SwaggerUrlProjectExample" resultType="java.lang.Long">
<if test="record.projectId != null"> select count(*) from swagger_url_project
project_id = #{record.projectId,jdbcType=VARCHAR}, <if test="_parameter != null">
</if> <include refid="Example_Where_Clause" />
<if test="record.swaggerUrl != null"> </if>
swagger_url = #{record.swaggerUrl,jdbcType=VARCHAR}, </select>
</if> <update id="updateByExampleSelective" parameterType="map">
<if test="record.moduleId != null"> update swagger_url_project
module_id = #{record.moduleId,jdbcType=VARCHAR}, <set>
</if> <if test="record.id != null">
<if test="record.modulePath != null"> id = #{record.id,jdbcType=VARCHAR},
module_path = #{record.modulePath,jdbcType=VARCHAR}, </if>
</if> <if test="record.projectId != null">
<if test="record.modeId != null">
mode_id = #{record.modeId,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/>
</if>
</update>
<update id="updateByExample" parameterType="map">
update swagger_url_project
set id = #{record.id,jdbcType=VARCHAR},
project_id = #{record.projectId,jdbcType=VARCHAR}, project_id = #{record.projectId,jdbcType=VARCHAR},
</if>
<if test="record.swaggerUrl != null">
swagger_url = #{record.swaggerUrl,jdbcType=VARCHAR}, swagger_url = #{record.swaggerUrl,jdbcType=VARCHAR},
</if>
<if test="record.moduleId != null">
module_id = #{record.moduleId,jdbcType=VARCHAR}, module_id = #{record.moduleId,jdbcType=VARCHAR},
</if>
<if test="record.modulePath != null">
module_path = #{record.modulePath,jdbcType=VARCHAR}, module_path = #{record.modulePath,jdbcType=VARCHAR},
mode_id = #{record.modeId,jdbcType=VARCHAR} </if>
<if test="_parameter != null"> <if test="record.modeId != null">
<include refid="Update_By_Example_Where_Clause"/> mode_id = #{record.modeId,jdbcType=VARCHAR},
</if> </if>
</update> </set>
<update id="updateByPrimaryKeySelective" parameterType="io.metersphere.base.domain.SwaggerUrlProject"> <if test="_parameter != null">
update swagger_url_project <include refid="Update_By_Example_Where_Clause" />
<set> </if>
<if test="projectId != null"> </update>
project_id = #{projectId,jdbcType=VARCHAR}, <update id="updateByExample" parameterType="map">
</if> update swagger_url_project
<if test="swaggerUrl != null"> set id = #{record.id,jdbcType=VARCHAR},
swagger_url = #{swaggerUrl,jdbcType=VARCHAR}, project_id = #{record.projectId,jdbcType=VARCHAR},
</if> swagger_url = #{record.swaggerUrl,jdbcType=VARCHAR},
<if test="moduleId != null"> module_id = #{record.moduleId,jdbcType=VARCHAR},
module_id = #{moduleId,jdbcType=VARCHAR}, module_path = #{record.modulePath,jdbcType=VARCHAR},
</if> mode_id = #{record.modeId,jdbcType=VARCHAR}
<if test="modulePath != null"> <if test="_parameter != null">
module_path = #{modulePath,jdbcType=VARCHAR}, <include refid="Update_By_Example_Where_Clause" />
</if> </if>
<if test="modeId != null"> </update>
mode_id = #{modeId,jdbcType=VARCHAR}, <update id="updateByPrimaryKeySelective" parameterType="io.metersphere.base.domain.SwaggerUrlProject">
</if> update swagger_url_project
</set> <set>
where id = #{id,jdbcType=VARCHAR} <if test="projectId != null">
</update> project_id = #{projectId,jdbcType=VARCHAR},
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.SwaggerUrlProject"> </if>
update swagger_url_project <if test="swaggerUrl != null">
set project_id = #{projectId,jdbcType=VARCHAR}, swagger_url = #{swaggerUrl,jdbcType=VARCHAR},
swagger_url = #{swaggerUrl,jdbcType=VARCHAR}, </if>
module_id = #{moduleId,jdbcType=VARCHAR}, <if test="moduleId != null">
module_path = #{modulePath,jdbcType=VARCHAR}, module_id = #{moduleId,jdbcType=VARCHAR},
mode_id = #{modeId,jdbcType=VARCHAR} </if>
where id = #{id,jdbcType=VARCHAR} <if test="modulePath != null">
</update> module_path = #{modulePath,jdbcType=VARCHAR},
</if>
<if test="modeId != null">
mode_id = #{modeId,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.SwaggerUrlProject">
update swagger_url_project
set project_id = #{projectId,jdbcType=VARCHAR},
swagger_url = #{swaggerUrl,jdbcType=VARCHAR},
module_id = #{moduleId,jdbcType=VARCHAR},
module_path = #{modulePath,jdbcType=VARCHAR},
mode_id = #{modeId,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper> </mapper>

File diff suppressed because it is too large Load Diff