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应用的基本功能工作正 ...
随机推荐
- BZOJ.3489.A simple rmq problem(主席树 Heap)
题目链接 当时没用markdown写,可能看起来比较难受...可以复制到别的地方看比如DevC++. \(Description\) 给定一个长为n的序列,多次询问[l,r]中最大的只出现一次的数.强 ...
- 某谷 P5159 WD与矩阵
题面在这里 崴脚回家后的小休闲2333. 显然每一行的1的个数必须是偶数,这样可以归纳证明前i行异或出来的m位二进制数也有偶数个1,这样最后一行就有且仅有一种放法了. 于是ans = 2^((n-1) ...
- 新的起点 Entry KINGSOFT
夜里,陪宝宝睡了会,呃岁月转变,变化里,不经意间加入了kingsoft. 呃,第一天所以算是一个起点或是一个开始.遇到些琐事,Slow network,oa Account login O(∩_∩)O ...
- chinese hacker-----WriteUp
原题地址:http://ctf5.shiyanbar.com/web/2/ 提示下载一个数据库 下载下来后发现是加密的 有密码,但发现密码不是4648 这里用到“DbView” 直接破解密码进入 发 ...
- LNMP一键安装包如何重装Nginx
LNMP一键安装包安装好后,相应的Mysql,Nginx及PHP都会安装配置完成. 由于某些特殊情况的需要,如何更换Nginx的版本呢? nginx升级脚本可以完成. 1. 手动编译方法:/usr/l ...
- 关于django Class-based views的理解
django是mvt模式,其中v就是这个显示逻辑部分,简单来讲,view函数可以说是接收request,然后处理,返回response的主体函数. 对于一些简单的逻辑关系,可以用直接用函数模式来进行处 ...
- word-ladder总结
title: word ladder总结 categories: LeetCode tags: 算法 LeetCode comments: true date: 2016-10-16 09:42:30 ...
- XDM、GDM和KDM
XDM.GDM.KDM是三种X Window的显示管理器 (1)XDM(默认的X Window System Display Manager)(2)GDM(gnome提供的Display Manage ...
- PyQt5 布局
import sys from PyQt5.QtWidgets import QWidget, QLabel, QApplication, QVBoxLayout, QHBoxLayout, QPus ...
- 转 UIActivityIndicatorView、UIProgressView 活动与进度指示器-IOS开发
活动指示器(UIActivityIndicatorView)可以告知用户有一个操作正在进行中.进度指示器(UIProgressView )也具有同样功能,而且还可以告知用户离操作结束还多远. 这两个指 ...