Community
Participate
Working Groups
Build ID: I20070323-1616 Steps To Reproduce: 1. Create a test where test method is in inner class: public class SomeContainerClass { public static class Innerclass { @Test public void test() { } } } 2. Run it as JUnit test from Outline view where inner class can be selected. 3. Open JUnit result tab. Select 'test' method and run it from context menu. More information: We are developing a BDD framework on top of JUnit (see http://www.jdave.org/examples.html). It organizes tests using inner classes. We can run them with JUnit4 runners when annotating with @RunWith(JDaveRunner.class) but trying to run individual tests from JUnit tab fails. For instance, if a test method is in inner class example.Foo$Bar, an error "The input type of lauch configuration does not exists" is displayed. The reason is that javaProject.findType(testTypeName); returns null when testTypeName is 'example.Foo$Bar'. This is the snippet from JUnit plugin code which gets executed: private final IJavaElement getTestTarget(ILaunchConfiguration configuration, IJavaProject javaProject) throws CoreException { .... String testTypeName= configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, ""); //$NON-NLS-1$ if (testTypeName.length() != 0) { testTypeName= performStringSubstitution(testTypeName); IType type= javaProject.findType(testTypeName); if (type != null) { return type; } } informAndAbort(JUnitMessages.JUnitLaunchConfigurationDelegate_input_type_does_not_exist, null, IJavaLaunchConfigurationConstants.ERR_UNSPECIFIED_MAIN_TYPE); return null; // not reachable }
Move to JDT/UI
*** This bug has been marked as a duplicate of bug 178503 ***