地址:https://github.com/jmeter-maven-plugin/jmeter-maven-plugin/wiki/Advanced-Configuration

Selecting Tests To Run

  • Running All Tests
  • Specifying <testFilesIncluded>
  • Specifying <testFilesIncluded> Using Regex
  • Specifying <testFilesExcluded>
  • Specifying <testFilesExcluded> Using Regex
  • Specifying The <testFilesDirectory>

Running All Tests

To run all tests held in the ${project.base.directory}/src/test/jmeter you just need to run the phase you have assigned to the execution phase.

In the example below the execution phase has been set to verify:

+---+
<project>[...]<build><plugins><plugin><groupId>com.lazerycode.jmeter</groupId> <artifactId>jmeter-maven-plugin</artifactId> <version>2.0.3</version> <executions> <execution> <id>jmeter-tests</id> <goals> <goal>jmeter</goal> </goals> </execution> </executions> </plugin> </plugins> </build> [...] </project> +---+

So to run all the tests type:

mvn verify

Specifying <testFilesIncluded>

You can explicitly specify which tests in the ${project.base.directory}/src/test/jmeter should be run by using the <jMeterTestFiles> tag:

+---+
<project>[...]<build><plugins><plugin><groupId>com.lazerycode.jmeter</groupId> <artifactId>jmeter-maven-plugin</artifactId> <version>2.0.3</version> <executions> <execution> <id>jmeter-tests</id> <goals> <goal>jmeter</goal> </goals> </execution> </executions> <configuration> <testFilesIncluded> <jMeterTestFile>test1.jmx</jMeterTestFile> <jMeterTestFile>test2.jmx</jMeterTestFile> </testFilesIncluded> </configuration> </plugin> </plugins> </build> [...] </project> +---+

This time when you type mvn verify only test1.jmx and test2.jmx will be run.

Specifying <testFilesIncluded> Using Regex

You can also use a regex to specify which tests to include, below is a simple example showing how to include all tests starting with the text foo:

+---+
<project>[...]<build><plugins><plugin><groupId>com.lazerycode.jmeter</groupId> <artifactId>jmeter-maven-plugin</artifactId> <version>2.0.3</version> <executions> <execution> <id>jmeter-tests</id> <goals> <goal>jmeter</goal> </goals> </execution> </executions> <configuration> <testFilesIncluded> <jMeterTestFile>foo*.jmx</jMeterTestFile> </testFilesIncluded> </configuration> </plugin> </plugins> </build> [...] </project> +---+

Specifying <testFilesExcluded>

Rather than specifying which tests should be run, you could alternatively specify which tests in the ${project.base.directory}/src/test/jmeter you do not wish to run by using the <excludeJMeterTestFiles> tag:

+---+
<project>[...]<build><plugins><plugin><groupId>com.lazerycode.jmeter</groupId> <artifactId>jmeter-maven-plugin</artifactId> <version>2.0.3</version> <executions> <execution> <id>jmeter-tests</id> <goals> <goal>jmeter</goal> </goals> </execution> </executions> <configuration> <testFilesExcluded> <excludeJMeterTestFile>test3.jmx</excludeJMeterTestFile> <excludeJMeterTestFile>test4.jmx</excludeJMeterTestFile> </testFilesExcluded> </configuration> </plugin> </plugins> </build> [...] </project> +---+

This time when you type mvn verify all tests in the tests in the${project.base.directory}/src/test/jmeter apart from test3.jmx and test4.jmx will be run.

Specifying <testFilesExcluded> Using Regex

You can also use a regex to specify which tests to exclude, below is a simple example showing how to include all tests ending with the text bar:

+---+
<project>[...]
<build><plugins><plugin><groupId>com.lazerycode.jmeter</groupId> <artifactId>jmeter-maven-plugin</artifactId> <version>2.0.3</version> <executions> <execution> <id>jmeter-tests</id> <goals> <goal>jmeter</goal> </goals> </execution> </executions> <configuration> <testFilesExcluded> <excludeJMeterTestFile>*bar.jmx</excludeJMeterTestFile> </testFilesExcluded> </configuration> </plugin> </plugins> </build> [...] </project> +---+

Specifying The <testFilesDirectory>

You can specify the directory where the test files are located in your file system (by default the plugin will assume they are in ${project.base.directory}/src/test/jmeter)

+---+
<project>[...]<build><plugins><plugin><groupId>com.lazerycode.jmeter</groupId> <artifactId>jmeter-maven-plugin</artifactId> <version>2.0.3</version> <executions> <execution> <id>jmeter-tests</id> <goals> <goal>jmeter</goal> </goals> </execution> </executions> <configuration> <testFilesDirectory>/scratch/testfiles/</testFilesDirectory> </configuration> </plugin> </plugins> </build> [...]

转载于:https://www.cnblogs.com/ceshi2016/p/5986988.html

Jmeter-Maven-Plugin高级应用:Selecting Tests To Run相关推荐

  1. 解决Jetty Maven Plugin:Please initialize the log4j system properly(转)

    解决Jetty Maven Plugin:Please initialize the log4j system properly. Jetty Maven Plugin环境: <plugin&g ...

  2. Versions maven plugin 修改版本

    文章目录 版本控制 修改全模块版本号 修改模块版本 修改指定模块版本号 参数介绍 代码经过长期修改后,版本号却从没有推进,导致个别release稳定版的模块更新代码之后,其他开发机器并不会自动更新本地 ...

  3. eclipse Plugin execution not covered by lifecycle configuration:maven.***.plugin

    具体是pom 不能引入和识别对应maven-plugin: 例如:Plugin execution not covered by lifecycle configuration: org.apache ...

  4. org.springframework.boot:spring boot maven plugin丢失---SpringCloud Alibaba_若依微服务框架改造_--工作笔记012

    警告]"build.plugins.plugin.version"for org.springframework.boot:spring boot maven plugin丢失. ...

  5. Spring Boot的Maven插件Spring Boot Maven plugin详解

    pring Boot的Maven插件(Spring Boot Maven plugin)能够以Maven的方式为应用提供Spring Boot的支持,即为Spring Boot应用提供了执行Maven ...

  6. wro4j和maven plugin在编译期间压缩静态资源

    优化前:  基本上所有的jsp都引用了这一大坨静态文件: <link rel="stylesheet" type="text/css" href=&quo ...

  7. wro4j和maven plugin在编译期间压缩静态资源.

    优化前: 基本上所有的jsp都引用了这一大坨静态文件: <link rel="stylesheet" type="text/css" href=" ...

  8. no main manifest attribute maven package 运行打包后的jar包报错:xxx.jar中没有主清单属性 通过配置 maven plugin 解决

    文章目录 命令行运行生成的jar包,报错 解决 手动修复 修改打包规则 一劳永逸 MANIFEST.MF demo Others IDEA 中关于 main class 的配置 命令行运行生成的jar ...

  9. eclipse maven plugin 插件 安装 和 配置

    本文转自:http://www.blogjava.net/fancydeepin/archive/2012/07/13/eclipse_maven3_plugin.html maven3 安装: 安装 ...

最新文章

  1. 语言堆栈入门——堆和栈的区别
  2. web项目不想放在tomcat的webapps目录下的
  3. C++ STL : 模拟实现STL中的list类
  4. echarts2.2.7入门
  5. 西工大java实验报告给,西工大数字集成电路实验 实验课6 加法器的设计
  6. [转帖]win10 .Net Runtime Optimization Service占用大量CPU资源解决方法
  7. java之Stack详细介绍
  8. Django新手需要注意的10个要点
  9. 9-3 数据分布概论
  10. jQuery EasyUI API 中文文档 - 菜单按钮(MenuButton)
  11. HeadFirst jsp 08 无脚本JSP
  12. 我是怎样给 Delphi 代码着色的 - 回复 sunhj 的问题
  13. 2021牛客多校9.F.Train Wreck 构造
  14. 设为主页代码及添加到收藏夹代码大全
  15. Ubuntu双系统卸载教程
  16. 杠杆炒股为什么会被强制平仓?
  17. MSSqlserver的锁模式介绍
  18. C: 重复宏定义warning: “A“ redefined
  19. 如何关闭华为自动杀进程_如何彻底关闭windows 10的 自动更新
  20. yarn WEB UI及reserved memory、spark WEB UI

热门文章

  1. 在存储过程中构建动态SQL
  2. 如何使用Visual Studio无需成本即可实现连续集成
  3. idea的setting界面怎么进_Mac版YY语音进入频道失败怎么破?
  4. python读取word内容存入数据库、并求simhash_介绍一个基于simhash作海量文章排重的库:simhashpy...
  5. php设计验证码图片,php实现简单的图片验证码
  6. windows7计算机用户账户,win7系统删除用户账户的方法(图文)
  7. php 图片文件转base64编码格式,php如何将图片转为base64编码格式
  8. 服务器sxs文件通用的吗,win10x sources sxs文件有什么作用
  9. PHP报不存在图像文件,使用TP3.2.3图片文件上传显示不存在图像文件
  10. 火车站售票系统_好消息!海门火车站自助售取票机增加自助退票功能