Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wavesoftware/java-jmh-junit-utilities
A JMH utilities to be used in JUnit tests
https://github.com/wavesoftware/java-jmh-junit-utilities
Last synced: about 12 hours ago
JSON representation
A JMH utilities to be used in JUnit tests
- Host: GitHub
- URL: https://github.com/wavesoftware/java-jmh-junit-utilities
- Owner: wavesoftware
- License: apache-2.0
- Created: 2016-03-31T08:41:25.000Z (over 8 years ago)
- Default Branch: develop
- Last Pushed: 2021-04-26T17:59:21.000Z (over 3 years ago)
- Last Synced: 2024-10-19T03:18:29.084Z (about 1 month ago)
- Language: Java
- Size: 41 KB
- Stars: 2
- Watchers: 4
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# JMH Utils for JUnit
This micro library holds a set of JUnit utilities for usage with JMH testing framework.[![Build Status](https://travis-ci.org/wavesoftware/java-jmh-junit-utilities.svg?branch=master)](https://travis-ci.org/wavesoftware/java-jmh-junit-utilities) [![Coverage Status](https://coveralls.io/repos/wavesoftware/java-jmh-junit-utilities/badge.svg?branch=master&service=github)](https://coveralls.io/github/wavesoftware/java-jmh-junit-utilities?branch=master) [![SonarQube Tech Debt](https://img.shields.io/sonar/http/sonar-ro.wavesoftware.pl/pl.wavesoftware:jmh-junit-utilities/tech_debt.svg)](http://sonar-ro.wavesoftware.pl/dashboard/index/3862) [![Maven Central](https://img.shields.io/maven-central/v/pl.wavesoftware/jmh-junit-utilities.svg)](https://search.maven.org/artifact/pl.wavesoftware/jmh-junit-utilities/)
## General use
### `JmhCleaner` extension
JMH is kinda dirty. It leaves after himself a set of tests classes. They are placed in Maven generated sources directory and may cause a false positives in code analysis tools like SonarQube. `JmhCleaner` rule is designed to overcome that and remove any JMH generated classes.
Use it as a standard JUnit 5 extension. One needs to pass a test class in constructor.Example:
```java
@RegisterExtension
static JmhCleaner cleaner = new JmhCleaner(MyClassTest.class);
```### `JavaAgentSkip` extension
JMH is, as any performance framework, sensitive to all intrusions like running java agents. Those are coverage tools (Jacoco), debuggers, profilers and so on. To overcome that one can use `JavaAgentSkip` rule to automatically skip test is JAva agent is present.
Example:
```java
@RegisterExtension
static JavaAgentSkip javaAgentSkip = JavaAgentSkip.ifPresent();
```## Maven
```xml
pl.wavesoftware
jmh-junit-utilities
2.0.0```
## Contributing
Contributions are welcome!
To contribute, follow the standard [git flow](http://danielkummer.github.io/git-flow-cheatsheet/) of:
1. Fork it
1. Create your feature branch (`git checkout -b feature/my-new-feature`)
1. Commit your changes (`git commit -am 'Add some feature'`)
1. Push to the branch (`git push origin feature/my-new-feature`)
1. Create new Pull RequestEven if you can't contribute code, if you have an idea for an improvement please open an [issue](https://github.com/wavesoftware/java-jmh-junit-utilities/issues).
## Requirements
* JDK >= 1.8
### Releases
- 2.0.0
- Support for JDK >= 1.8
- Support for JUnit 5
- Dropped support for JUnit 4
- 1.0.0
- Support for JDK >= 1.6
- Initial release