@Gavish, if you want to ignore all the test methods, then you need to use @Ignore annotation at the class level. Following code snippet will demonstrate how you can ignore all test methods by calling @ignore at class level:
package ignoreTestCase.junit;
import static org.junit.Assert.assertEquals;
import org.junit.Ignore;
import org.junit.Test;
@Ignore
public class JunitTestExample {
public String message = "Ignore Test Methods";
JUnitMessage junitMessage = new JUnitMessage(message);
@Test
public void testJUnitMessage() {
System.out.println("Junit Message is printing ");
assertEquals(message, junitMessage.printMessage());
}
@Test
public void testJUnitHiMessage() {
message="Hi!" +message;
System.out.println("Junit Hi Message is printing ");
assertEquals(message, junitMessage.printHiMessage());
}
}