[ http://jira.codehaus.org/browse/MIDEA-87?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_111209 ]
Edwin Punzalan commented on MIDEA-87: ------------------------------------- I can't seem to reproduce this one. I tried using the attached zip file, and I can run see 3 test methods being called... on both Idea 6.0 and 7.0.1. I then tried running idea:clean and idea:idea on the same project. And again, I can see all 4 test methods being executed. Of course, I checked the existence/non-existence of the TEST_RUNNER on all executions and restarted Idea every time I save the file. > maven-idea-plugin generates projects that do not work properly with JUnit 4. > ---------------------------------------------------------------------------- > > Key: MIDEA-87 > URL: http://jira.codehaus.org/browse/MIDEA-87 > Project: Maven 2.x IDEA Plugin > Issue Type: Bug > Affects Versions: 2.0 > Environment: Windows XP Pro, > maven-idea-plugin V 2.1-SNAPSHOT > Reporter: Kevan Dunsmore > Assignee: Edwin Punzalan > Priority: Critical > Attachments: testbug.zip > > > Generating a project using the maven-idea-plugin results in project files > that cause Idea to be unable to execute Junit 4 tests where the test classes > are POJOs in a hierarchy. > For example, if I have the following JUnit 4 test classes, Idea does not > recognize the valid test hierarchy: > public abstract class BaseTest { > @Test > public void foo() { > // Test code here. > } > } > public class MySpecializedTest extends BaseTest { } > 1. Right clicking on MySpecializedTest does not show the "Run > MySpecializedTest" test context menu option. > 2. Executing all tests in the package returns an error stating that no test > classes could be found. > If you change MySpecializedTest to this: > public class MySpecializedTest extends BaseTest { > @Test > public void bar() { > // Specialized test code > } > } > Then Idea finds the MySpecializedTest.bar() test and executes it but does not > execute the inherited foo() test case. > This problem is caused by the inclusion of the following element in the ipr > file: > <component name="JUnitProjectSettings"> > <option name="TEST_RUNNER" value="UI" /> > </component> > After I manually removed the element (actually commented it out) and > restarted Idea, it was able to detect the correct number of tests in the test > class hierarchy. > Please find attached to this issue a zip file containing a project > illustrating this bug. I have modified the .ipr file to comment-out the > problem element shown above. As such, the project is configured such that > Idea will correctly identify the JUnit tests. To view the bug behavior, open > the .ipr file and uncomment the element (it's the first one in the file under > the root "project" element). -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira