https://github.com/valery1707/junit4-rule
Library for JUnit 4 with some useful rules
https://github.com/valery1707/junit4-rule
Last synced: about 2 months ago
JSON representation
Library for JUnit 4 with some useful rules
- Host: GitHub
- URL: https://github.com/valery1707/junit4-rule
- Owner: valery1707
- License: mit
- Created: 2018-07-02T11:23:02.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2020-10-14T08:10:30.000Z (over 4 years ago)
- Last Synced: 2025-01-23T05:24:00.371Z (3 months ago)
- Language: Java
- Size: 113 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://maven-badges.herokuapp.com/maven-central/name.valery1707.junit/junit4-rule)
[](http://opensource.org/licenses/MIT)[](https://codecov.io/gh/valery1707/junit4-rule)
[](https://coveralls.io/github/valery1707/junit4-rule?branch=master)
[](https://www.codacy.com/app/valery1707/junit4-rule?utm_source=github.com&utm_medium=referral&utm_content=valery1707/junit4-rule&utm_campaign=Badge_Grade)[](https://travis-ci.org/valery1707/junit4-rule)
[](https://ci.appveyor.com/project/valery1707/junit4-rule/branch/master)
[](https://sputnik.ci/app#/builds/valery1707/junit4-rule)[](http://www.rultor.com/p/valery1707/junit4-rule)
Library for JUnit 4 with some useful rules
# `ConditionalIgnoreRule`
Core mechanism for implementing custom conditions for ignore tests.
You can ignore test by custom rule only in 3 steps:
1. Create class implementing `name.valery1707.junit.rule.ConditionalIgnoreRule.IgnoreCondition`
1. Add `@org.junit.Rule`-annotated field in test class with `name.valery1707.junit.rule.ConditionalIgnoreRule`
1. Add annotation `name.valery1707.junit.rule.ConditionalIgnoreRule.ConditionalIgnore` with condition created at first stepConditions can be reused by many test methods and ever test classes.
Base implementations of conditionals:
* `BaseEnvironmentCondition` - test of environment values by regexp or simple equals