forked from ttsui/pending
-
Notifications
You must be signed in to change notification settings - Fork 0
JUnit rule to mark tests as pending. Tests marked as pending will not be evaluated.
License
victorlira/pending
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Pending is an alternative to using @Ignore for bypassing tests that are failing
due to the functionality not being implemented yet.
Pending provides is a JUnit rule and annotation for marking tests as pending.
A pending test is expected to fail. Should the test pass the unexpected success
will be reported.
Mark Tests As Pending with @PendingImplementation
----------------------------------------------------
Add the @PendingImplementation annotation to either a test class or method to
mark tests as pending.
Example:
@PendingImplementation
public class MyTest {
@Rule public MethodRule pendingRule = new PendingRule();
/* Failing test methods */
...
}
public class MyTest {
@Rule public MethodRule pendingRule = new PendingRule();
@PendingImplementation
@Test public void
testMethod() {
/* Failing test */
...
}
}
The @Pending annotation takes an optional default parameter if you want to
record why a test is marked as pending.
Example:
Code:
public class MyTest {
@Rule public MethodRule pendingRule = PendingRule.withOutput();
@PendingImplementation("Work in progress")
@Test public void
testMethod() {
/* Failing test */
...
}
}
Mark Tests As Pending with JUnit @Category
--------------------------------------------
Tests can be marked as pending with JUnit's @Category annotation.
Example:
@Category(PendingCategory.class)
public class MyTest {
@Rule public MethodRule pendingRule = new PendingRule(PendingCategory.class);
/* Failing test methods */
...
}
public class MyTest {
@Rule public MethodRule pendingRule = new PendingRule(PendingCategory.class);
@Category(PendingCategory.class)
@Test public void
testMethod() {
/* Failing test */
...
}
} About
JUnit rule to mark tests as pending. Tests marked as pending will not be evaluated.
Resources
License
Stars
Watchers
Forks
Packages 0
No packages published
Languages
- Java 100.0%