org.apache.tools.ant.taskdefs.optional.junit

Class JUnitVersionHelper


public class JUnitVersionHelper
extends java.lang.Object

Work around for some changes to the public JUnit API between different JUnit releases.

Method Summary

static String
getTestCaseName(Test t)
JUnit 3.7 introduces TestCase.getName() and subsequent versions of JUnit remove the old name() method.

Method Details

getTestCaseName

public static String getTestCaseName(Test t)
JUnit 3.7 introduces TestCase.getName() and subsequent versions of JUnit remove the old name() method. This method provides access to the name of a TestCase via reflection that is supposed to work with version before and after JUnit 3.7.

since Ant 1.5.1 this method will invoke "public String getName()" on any implementation of Test if it exists.


Copyright B) 2000-2008 Apache Software Foundation. All Rights Reserved.