Can you run a test for a single method only, not a whole class? Ideally from the command line.
e.g. for a class:
public class TestClass extends Unittest {
@Test
public void test1_shouldbeRun() {
}
@Test
public void test2_shouldNotBeRun() {
}
}
I only want to run the method “test1_shouldBeRun”.
I do not think if that is natively supported by JUnit. However, you have some alternatives:
@Ignoreannotation helps you.TestSuitand an Ant task that can make this for you.