-1

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;

@RunWith(Suite.class)
@SuiteClasses({
    pack1.TC01CL.class,
    pack1.TC02CL.class,
    pack1.TC03CL.class
})

public class TestAll {
}
1

1. You need to import

import org.junit.Ignore;

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

@Ignore
@Test
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.