I have created a JUnit test suite that has multiple test cases. A couple of these are for functionality that are currently under implementation. I want to skip these test cases. How do I skip tests cases with JUnit?

My suite code looks like:

package pack1;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;


public class TestAll {

1. You need to import

import org.junit.Ignore;

2. Tag @Ignore is available in JUnit - It will skip your test from executing

public void your_test_to_skipped() {

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.