I am looking for a way to run single Junit test methods (not the whole test, just a single one provided through the "-D" parameter to ant) in a Jenkins compliant way. There are a lot of different tutorials (most of them going into completely different directions) and I could not find one actually working with Junit4.*. (e.g. there is no TestCase(String methodName) constructor anymore...)
I am able to parse parameters with the "-D" option through ant and I can start single testcases with
Request requestCase = Request.method(Class.forName("testmethod"), Parameter.testCase);
Result result = new JUnitCore().run(requestCase);
but probably since I am usually running everything in TestSuites, Jenkins runs the single test seperately but doesn't register the tests have been run.
tl;dr: Is there a good way to run a single test method (not a whole class) with junit, so that Jenkins can properly pick up the results?