Skip to content
forked from ttsui/pending

JUnit rule to mark tests as pending. Tests marked as pending will not be evaluated.

License

Notifications You must be signed in to change notification settings

tumbarumba/pending

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 

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

No packages published

Languages

  • Java 100.0%