Created
April 1, 2010 09:39
-
-
Save koic/351603 to your computer and use it in GitHub Desktop.
Get test method names from TestCase.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import junit.framework.TestSuite; | |
import org.junit.runner.Description; | |
import org.junit.runner.JUnitCore; | |
import org.junit.runner.notification.RunListener; | |
public class Main { | |
public static void main(String[] args) { | |
JUnitCore core = new JUnitCore(); | |
core.addListener(new RunListener() { | |
public void testFinished(Description description) throws Exception { | |
System.out.println(description.getMethodName()); | |
} | |
}); | |
TestSuite suite = new TestSuite(); | |
suite.addTest(TestCaseClass.class); | |
core.run(suite); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment