Jmeter-Maven-Plugin高级应用:Modifying Properties
Modifying Properties
Modifying Properties
- Using Your Own Properties Files
- Adding Additional Properties To <propertiesJMeter>
- Adding Additional Properties To <propertiesSaveService>
- Adding Additional Properties To <propertiesUpgrade>
- Adding Additional Properties To <propertiesUser>
- Adding Additional Properties To <propertiesGlobal>
- Adding Additional Properties To <propertiesSystem>
- Setting <propertiesReplacedByCustomFiles>
- Specifying A <customPropertiesFile>
- Specifying The <propertiesFilesDirectory>
Using Your Own Properties Files
The easiest way to configure JMeter with this plugin is to supply your own properties files. When it starts up the plugin will scan the ${project.base.directory}/src/test/jmeter directory for the following files:
- jmeter.properties
- saveservice.properties
- upgrade.properties
- system.properties
- user.properties
- global.properties
Adding Additional Properties To <propertiesJMeter>
It is possible to set properties that configure the main JMeter library. To set those properties you will need to specify each property in your pom.xml in the config element <propertiesJmeter>(The example below shows a property called log_level.jmeter being set).
Each property specified is merged into the JMeter properties file jmeter.properties, it will overwrite any identical properties within the file.
+---+
<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>
<propertiesJMeter>
<log_level.jmeter>DEBUG</log_level.jmeter>
</propertiesJMeter>
</configuration>
</plugin>
</plugins>
</build>
[...]
</project>
+---+
Adding Additional Properties To <propertiesSaveService>
It is possible to set properties that configure the Saveservice of the main JMeter library. To set those properties you will need to specify each property in your pom.xml in the config element<propertiesSaveservice> (The example below shows a property called HTTPSampler2 being set).
Each property specified is merged into the JMeter properties file saveservice.properties, it will overwrite any identical properties within the file.
+---+
<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>
<propertiesSaveService>
<HTTPSampler2>org.apache.jmeter.protocol.http.sampler.HTTPSampler2</HTTPSampler2>
</propertiesSaveService>
</configuration>
</plugin>
</plugins>
</build>
[...]
</project>
+---+
Adding Additional Properties To <propertiesUpgrade>
It is possible to set properties that are used in the oldValue to newValue upgrade mapping of the main JMeter library. To set those properties you will need to specify each property in yourpom.xml in the config element <propertiesUpgrade>. (The example below shows a property called my.old.ClassName being set).
Each property specified is merged into the JMeter properties file upgrade.properties, it will overwrite any identical properties within the file.
+---+
<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>
<propertiesUpgrade>
<my.old.ClassName>my.new.ClassName</my.old.ClassName>
</propertiesUpgrade>
</configuration>
</plugin>
</plugins>
</build>
[...]
</project>
+---+
Adding Additional Properties To <propertiesUser>
JMeter user properties are properties supplied to JMeter that can be used in JMeter tests. To set user properties you will need to specify each property in your pom.xml in the config element<propertiesUser> (The example below shows a property called threads and a propery calledtestIterations being set).
Each property specified is merged into the JMeter properties file user.properties, it will overwrite any identical properties within the file.
+---+
<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>
<propertiesUser>
<threads>10</threads>
<testIterations>5</testIterations>
</propertiesUser>
</configuration>
</plugin>
</plugins>
</build>
[...]
</project>
+---+
Adding Additional Properties To <propertiesGlobal>
Global properties are properties that are sent to the remote machines. To set those properties you will need to specify each property in your pom.xml in the config element<propertiesGlobal> (The example below shows a property called threads and a property calledtestIterations being set).
Each property specified is merged into the JMeter properties file global.properties, it will overwrite any identical properties within the file.
+---+
<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>
<propertiesGlobal>
<threads>10</threads>
<testIterations>5</testIterations>
</propertiesGlobal>
</configuration>
</plugin>
</plugins>
</build>
[...]
</project>
+---+
Adding Additional Properties To <propertiesSystem>
JMeter can set system properties, these are global environment properties accessible by all applications running in the same JVM (They are not accessible outside the JVM). To set system properties you will need to specify each property in your pom.xml in the config element<propertiesSystem> (The example below shows a property called my.system.property being set).
Each property specified is merged into the JMeter properties file system.properties, it will overwrite any identical properties within the file.
+---+
<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>
<propertiesSystem>
<my.system.property>my.system.property.value</my.system.property>
</propertiesSystem>
</configuration>
</plugin>
</plugins>
</build>
[...]
</project>
+---+
Setting <propertiesReplacedByCustomFiles>
By default all properties specified in the settings above will be merged with any existing properties. If you want them to be replaced instead you can do this by setting<propertiesReplacedByCustomFiles> to true (it is false by default). Please think very carefullybefore doing this, the reason we merge properties by default is to ensure that all properties are merged into the latest valid versions of the properties files supplied with JMeter. If you overwrite the properties files but are missing a property that is required by JMeter things will most likely break.
+---+
<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>
<propertiesReplacedByCustomFiles>${basedir}true</propertiesReplacedByCustomFiles>
</configuration>
</plugin>
</plugins>
</build>
[...]
</project>
+---+
Specifying A <customPropertiesFile>
This will allow you to set an absolute path to JMeter custom (test dependent) properties file. This is the equivalent of setting " --addprop my.properties" on the command line.
+---+
<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>
<customPropertiesFiles>
<file>/user/home/myuser/myCustom.properties</file>
</customPropertiesFiles>
</configuration>
</plugin>
</plugins>
</build>
[...]
</project>
+---+
Specifying The <propertiesFilesDirectory>
You can specify the directory where the .properties 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>
<propertiesFilesDirectory>/user/home/myuser/properties</propertiesFilesDirectory>
</configuration>
</plugin>
</plugins>
</build>
[...]
</project>
+---+
Jmeter-Maven-Plugin高级应用:Modifying Properties的更多相关文章
- Spring Boot的Maven插件Spring Boot Maven plugin详解
Spring Boot的Maven插件(Spring Boot Maven plugin)能够以Maven的方式为应用提供Spring Boot的支持,即为Spring Boot应用提供了执行Mave ...
- 基于Jmeter+maven+Jenkins构建性能自动化测试平台
一.目的: 为能够将相关系统性能测试做为常规化测试任务执行,且可自动无人值守定时执行并输出性能测试结果报告及统计数据,因此基于Jmeter+maven+Jenkins构建了一套性能自动化测试平台 ...
- Jmeter+maven+Jenkins构建云性能测试平台(mark 推荐)
转自:http://www.cnblogs.com/victorcai0922/archive/2012/06/20/2555502.html Jmeter+maven+Jenkins构建云性能测试平 ...
- 学习Maven之Cobertura Maven Plugin
cobertura-maven-plugin是个什么鬼? cobertura-maven-plugin是一个校验单元测试用例覆盖率的工具,可以生成一个测试覆盖率报告,可以给单元测试用例编写提供参考. ...
- Maven实现Web应用集成測试自己主动化 -- 部署自己主动化(WebTest Maven Plugin)
上篇:Maven实现Web应用集成測试自己主动化 -- 測试自己主动化(WebTest Maven Plugin) 之前介绍了怎样在maven中使用webtest插件实现web的集成測试,这里有个遗留 ...
- 解决Jetty Maven Plugin:Please initialize the log4j system properly(转)
解决Jetty Maven Plugin:Please initialize the log4j system properly.Jetty Maven Plugin环境: <plugin> ...
- Spring Boot Maven Plugin(一):repackage目标
简介 Spring Boot Maven Plugin插件提供spring boot在maven中的支持.允许你打包可运行的jar包或war包. 插件提供了几个maven目标和Spring Boot ...
- Spring Boot Maven Plugin打包异常及三种解决方法:Unable to find main class
[背景]spring-boot项目,打包成可执行jar,项目内有两个带有main方法的类并且都使用了@SpringBootApplication注解(或者另一种情形:你有两个main方法并且所在类都没 ...
- Maven实现Web应用集成測试自己主动化 -- 測试自己主动化(WebTest Maven Plugin)
近期在appfuse看到使用webtest-maven-plugin实现Web应用的集成測试,研究了下.感觉很不错.对于Web应用自己主动构建很有帮助,在性能測试之前能够保证Web应用的基本功能工作正 ...
随机推荐
- [BZOJ4668]冷战(并查集)
比较自然的思路是,由于需要记录连通块合并时的信息,所以需要建出Kruskal重构树. 需要用LCT维护,支持加点和在线LCA操作. 不妨考虑在并查集合并的同时记录信息,pre[x]表示x与它的父亲相连 ...
- 【线段树】【扫描线】Petrozavodsk Winter Training Camp 2018 Day 5: Grand Prix of Korea, Sunday, February 4, 2018 Problem A. Donut
题意:平面上n个点,每个点带有一个或正或负的权值,让你在平面上放一个内边长为2l,外边长为2r的正方形框,问你最大能圈出来的权值和是多少? 容易推出,能框到每个点的 框中心 的范围也是一个以该点为中心 ...
- 【洛谷】NOIP提高组模拟赛Day2【动态开节点/树状数组】【双头链表模拟】
U41571 Agent2 题目背景 炎炎夏日还没有过去,Agent们没有一个想出去外面搞事情的.每当ENLIGHTENED总部组织活动时,人人都说有空,结果到了活动日,却一个接着一个咕咕咕了.只有不 ...
- Codeforces Round #296 (Div. 1) C. Data Center Drama 欧拉回路
Codeforces Round #296 (Div. 1)C. Data Center Drama Time Limit: 2 Sec Memory Limit: 256 MBSubmit: xx ...
- CentOS 7下配置安装KVM
注意:KVM一切安装和运行都是在root用户下完成的,并且只有root才能支持某些软件. 一.准备工作: 1.关闭selinux,iptables,重启后生效 ##关闭selinux # sed -i ...
- Effective OC : 1-5
1,了解Objective-C语言的起源: OC为C语言的超集,为C加入了面向对象的特性. 要理解C中的指针和内存模型. 2.在类文件里尽量少引入其它头文件: 引入过多头文件.将借口暴露,添加耦合度. ...
- 事件冒泡与捕获&事件托付
设想这样一种情况 一个div里面有个span元素 ,当鼠标单击span时,这个事件算是谁的? div还是span? 准确的说两个都触发了,这种认可大家都允许,事实就是这种, 第二个问题来了,这个事件 ...
- systemtap 用户态调试
#include <stdio.h> int main( void) { ; a=fun(,); printf("%d\n",a); } int fun(int a,i ...
- 报错:无法从int?转换为int
□ 背景分析 在控制器方法中的一个参数允许为null值:public ActionResult GetByCategory(int? categoryId = null) 当把这里的categoryI ...
- java基础之hashcode理解及hashmap实现原理及MD5
HashCode值 1. hashcode值是int的,64位.int hashCode(). 2. java object类默认的hashcode()计算方法是根据对象的内存地址来计算的.所以可由此 ...