Extension library for JUnit 4

Add new [Rules](https://github.com/junit-team/junit4/wiki/Rules) for JUnit4.

License

License

Categories

Categories

JUnit Unit Testing
GroupId

GroupId

name.valery1707.junit
ArtifactId

ArtifactId

junit4-rule
Last Version

Last Version

0.1.2
Release Date

Release Date

Type

Type

jar
Description

Description

Extension library for JUnit 4
Add new [Rules](https://github.com/junit-team/junit4/wiki/Rules) for JUnit4.
Project URL

Project URL

https://github.com/valery1707/junit4-rule
Source Code Management

Source Code Management

https://github.com/valery1707/junit4-rule

Download junit4-rule

How to add to project

<!-- https://jarcasting.com/artifacts/name.valery1707.junit/junit4-rule/ -->
<dependency>
    <groupId>name.valery1707.junit</groupId>
    <artifactId>junit4-rule</artifactId>
    <version>0.1.2</version>
</dependency>
// https://jarcasting.com/artifacts/name.valery1707.junit/junit4-rule/
implementation 'name.valery1707.junit:junit4-rule:0.1.2'
// https://jarcasting.com/artifacts/name.valery1707.junit/junit4-rule/
implementation ("name.valery1707.junit:junit4-rule:0.1.2")
'name.valery1707.junit:junit4-rule:jar:0.1.2'
<dependency org="name.valery1707.junit" name="junit4-rule" rev="0.1.2">
  <artifact name="junit4-rule" type="jar" />
</dependency>
@Grapes(
@Grab(group='name.valery1707.junit', module='junit4-rule', version='0.1.2')
)
libraryDependencies += "name.valery1707.junit" % "junit4-rule" % "0.1.2"
[name.valery1707.junit/junit4-rule "0.1.2"]

Dependencies

compile (3)

Group / Artifact Type Version
junit : junit jar 4.12
com.google.code.findbugs : jsr305 Optional jar 3.0.2
org.jetbrains : annotations Optional jar 16.0.2

test (1)

Group / Artifact Type Version
org.assertj : assertj-core jar 3.10.0

Project Modules

There are no modules declared in this project.

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

Versions

Version
0.1.2