Skip to content

Commit 325847a

Browse files
author
DABURON Vincent
committed
Change version 1.4 add installer and script shell for jmeter-plugins-manager
1 parent 214633d commit 325847a

File tree

5 files changed

+105
-3
lines changed

5 files changed

+105
-3
lines changed

README.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ The maven groupId, artifactId and version, this plugin is in the **Maven Central
117117
```xml
118118
<groupId>io.github.vdaburon</groupId>
119119
<artifactId>junit-reporter-kpi-from-jmeter-dashboard-stats</artifactId>
120-
<version>1.3</version>
120+
<version>1.4</version>
121121
```
122122
Just include the plugin in your `pom.xml` and execute `mvn verify` <br>
123123
or individual launch `mvn -DjsonStats=statistics.json -DkpiFile=kpi.csv -DjunitFile=jmeter-junit-plugin-jmstats.xml exec:java@create_junit-report-kpi-from-jmeter-json-statics`
@@ -136,7 +136,7 @@ or individual launch `mvn -DjsonStats=statistics.json -DkpiFile=kpi.csv -DjunitF
136136
<dependency>
137137
<groupId>io.github.vdaburon</groupId>
138138
<artifactId>junit-reporter-kpi-from-jmeter-dashboard-stats</artifactId>
139-
<version>1.3</version>
139+
<version>1.4</version>
140140
</dependency>
141141
</dependencies>
142142

@@ -180,12 +180,28 @@ This tool is a java jar, so it's could be use as simple jar (look at [Release](h
180180
java -jar junit-reporter-kpi-from-jmeter-dashboard-stats-&lt;version&gt;-jar-with-dependencies.jar -jsonStats statistics.json -kpiFile kpi.csv -junitFile junit-report.xml -exitReturnOnFail true
181181
</pre>
182182

183+
## Tool installed with jmeter-plugins-manager
184+
This tool could be installed with the jmeter-plugins-manager from jmeter.plugins.org.<br>
185+
The tool name is : "vdn@github - junit-reporter-kpi-from-jmeter-dashboard-stats tool"
186+
187+
in JMETER_HOME\bin (Windows)
188+
<pre>
189+
junit-reporter-kpi-from-jmeter-dashboard-stats.cmd -jsonStats statistics.json -kpiFile kpi.csv -junitFile junit-report.xml -htmlOutFile result.html -csvOutFile result.csv
190+
</pre>
191+
or <br>
192+
in JMETER_HOME/bin (Linux or MacOS)
193+
<pre>
194+
junit-reporter-kpi-from-jmeter-dashboard-stats.sh -jsonStats statistics.json -kpiFile kpi.csv -junitFile junit-report.xml -htmlOutFile result.html -csvOutFile result.csv
195+
</pre>
196+
183197
## Link to others projects
184198
Usually this plugin is use with [jmeter-maven-plugin](https://github.com/jmeter-maven-plugin/jmeter-maven-plugin) set `<generateReports>true</generateReports>` to generate the dashboard with `statistics.json` file.<br>
185199

186200
You could also use [jmeter-graph-tool-maven-plugin](https://github.com/vdaburon/jmeter-graph-tool-maven-plugin)
187201

188202
## Versions
203+
version 1.4 add jmeter-plugins.org installer
204+
189205
version 1.3 export result in html, json or csv format
190206

191207
Version 1.2 change the Test Suite Name

pom.xml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>io.github.vdaburon</groupId>
88
<artifactId>junit-reporter-kpi-from-jmeter-dashboard-stats</artifactId>
9-
<version>1.3</version>
9+
<version>1.4</version>
1010
<packaging>jar</packaging>
1111
<name>Create a JUnit XML file with KPI rules from JMeter Dashboard Stats</name>
1212
<description>A tool that creates a JUnit XML file with KPI rules from JMeter JMeter Dashboard stats.json and generates a result file in JUnit XML format and other formats : html, csv and json.</description>
@@ -188,5 +188,13 @@
188188
</configuration>
189189
</plugin>
190190
</plugins>
191+
192+
<resources>
193+
<resource>
194+
<directory>src/main/resources</directory>
195+
<!-- add version for the generated library in the script shell .cmd and .sh -->
196+
<filtering>true</filtering>
197+
</resource>
198+
</resources>
191199
</build>
192200
</project>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package io.github.vdaburon.jmeter.utils.jsonkpi;
2+
3+
import java.io.File;
4+
import java.io.IOException;
5+
import java.io.InputStream;
6+
import java.nio.file.Files;
7+
import java.nio.file.StandardCopyOption;
8+
9+
public class ToolInstaller {
10+
public static void main(String[] argv) throws IOException {
11+
writeOut("junit-reporter-kpi-from-jmeter-dashboard-stats.cmd", false);
12+
writeOut("junit-reporter-kpi-from-jmeter-dashboard-stats.sh", true);
13+
}
14+
15+
private static void writeOut(String resName, boolean executable) throws IOException {
16+
resName = "/io/github/vdaburon/jmeter/utils/jsonkpi/" + resName;
17+
File self = new File(ToolInstaller.class.getProtectionDomain().getCodeSource().getLocation().getFile());
18+
File src = new File(resName);
19+
String home = self.getParentFile().getParentFile().getParent();
20+
File dest = new File(home + File.separator + "bin" + File.separator + src.getName());
21+
22+
InputStream is = ToolInstaller.class.getResourceAsStream(resName);
23+
Files.copy(is, dest.toPath(), StandardCopyOption.REPLACE_EXISTING);
24+
dest.setExecutable(executable);
25+
}
26+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
@echo off
2+
3+
rem Licensed to the Apache Software Foundation (ASF) under one or more
4+
rem contributor license agreements. See the NOTICE file distributed with
5+
rem this work for additional information regarding copyright ownership.
6+
rem The ASF licenses this file to You under the Apache License, Version 2.0
7+
rem (the "License"); you may not use this file except in compliance with
8+
rem the License. You may obtain a copy of the License at
9+
rem
10+
rem http://www.apache.org/licenses/LICENSE-2.0
11+
rem
12+
rem Unless required by applicable law or agreed to in writing, software
13+
rem distributed under the License is distributed on an "AS IS" BASIS,
14+
rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
rem See the License for the specific language governing permissions and
16+
rem limitations under the License.
17+
18+
rem Run Generating JUnit Report based on custom Key Performance Indicators (KPIs) applied to the JMeter Dashboard Statistics Json file
19+
rem Look README at https://github.com/vdaburon/JUnitReportKpiJMeterDashboardStats
20+
21+
setlocal
22+
23+
cd /D %~dp0
24+
25+
set CP=..\lib\ext\junit-reporter-kpi-from-jmeter-dashboard-stats-${version}-jar-with-dependencies.jar
26+
27+
java -jar %CP% %*
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/sh
2+
3+
## Licensed to the Apache Software Foundation (ASF) under one or more
4+
## contributor license agreements. See the NOTICE file distributed with
5+
## this work for additional information regarding copyright ownership.
6+
## The ASF licenses this file to You under the Apache License, Version 2.0
7+
## (the "License"); you may not use this file except in compliance with
8+
## the License. You may obtain a copy of the License at
9+
##
10+
## http://www.apache.org/licenses/LICENSE-2.0
11+
##
12+
## Unless required by applicable law or agreed to in writing, software
13+
## distributed under the License is distributed on an "AS IS" BASIS,
14+
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
## See the License for the specific language governing permissions and
16+
## limitations under the License.
17+
18+
## Run Generating JUnit Report based on custom Key Performance Indicators (KPIs) applied to the JMeter Dashboard Statistics Json file
19+
## Look README at https://github.com/vdaburon/JUnitReportKpiJMeterDashboardStats
20+
21+
cd `dirname $0`
22+
23+
CP=../lib/ext/junit-reporter-kpi-from-jmeter-dashboard-stats-${version}-jar-with-dependencies.jar
24+
25+
java -jar $CP $*

0 commit comments

Comments
 (0)