Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.tools.ant.taskdefs.optional.junit
Class JUnitVersionHelper

    java.lang.Object
      org.apache.tools.ant.taskdefs.optional.junit.JUnitVersionHelper

    public class JUnitVersionHelper

extends java.lang.Object

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

Constructor Summary
`JUnitVersionHelper()`

Method Summary
`static java.lang.String` | `getTestCaseName(junit.framework.Test t)` JUnit 3.7 introduces TestCase.getName() and subsequent versions of JUnit remove the old name() method.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### JUnitVersionHelper

    public JUnitVersionHelper()

Method Detail

### getTestCaseName

    public static java.lang.String getTestCaseName(junit.framework.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.

  Since Ant 1.7 also checks for JUnit4TestCaseFacade explicitly. This is used by junit.framework.JUnit4TestAdapter.

  Parameters:
    `t` - the test.
  Returns:
    the name of the test.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD