valery1707 / junit4-rule

Library for JUnit 4 with some useful rules

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Maven Central License

codecov Coverage Status Codacy Badge

Build Status Build status Sputnik

DevOps By Rultor.com

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
  2. Add @org.junit.Rule-annotated field in test class with name.valery1707.junit.rule.ConditionalIgnoreRule
  3. Add annotation name.valery1707.junit.rule.ConditionalIgnoreRule.ConditionalIgnore with condition created at first step

Conditions 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

About

Library for JUnit 4 with some useful rules

License:MIT License


Languages

Language:Java 91.2%Language:Shell 8.8%