You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Kevan Dunsmore (JIRA)" <ji...@codehaus.org> on 2007/04/16 17:42:46 UTC

[jira] Created: (MNG-2950) maven-idea-plugin generates projects that do not work properly with JUnit 4.

maven-idea-plugin generates projects that do not work properly with JUnit 4.
----------------------------------------------------------------------------

                 Key: MNG-2950
                 URL: http://jira.codehaus.org/browse/MNG-2950
             Project: Maven 2
          Issue Type: Bug
          Components: Plugins and Lifecycle
    Affects Versions: 2.0.6
         Environment: Windows XP Pro,
maven-idea-plugin V 2.1-SNAPSHOT
            Reporter: Kevan Dunsmore
            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

        

[jira] Moved: (MIDEA-87) maven-idea-plugin generates projects that do not work properly with JUnit 4.

Posted by "Dennis Lundberg (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MIDEA-87?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dennis Lundberg moved MNG-2950 to MIDEA-87:
-------------------------------------------

    Affects Version/s:     (was: 2.0.6)
                       2.0
          Component/s:     (was: Plugins and Lifecycle)
           Complexity:   (was: Intermediate)
                  Key: MIDEA-87  (was: MNG-2950)
              Project: Maven 2.x Idea Plugin  (was: Maven 2)

> 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
>            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

        

[jira] Commented: (MIDEA-87) maven-idea-plugin generates projects that do not work properly with JUnit 4.

Posted by "Edwin Punzalan (JIRA)" <ji...@codehaus.org>.
    [ 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

        

[jira] Updated: (MIDEA-87) maven-idea-plugin generates projects that do not work properly with JUnit 4.

Posted by "Edwin Punzalan (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MIDEA-87?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Edwin Punzalan updated MIDEA-87:
--------------------------------

    Priority: Major  (was: Critical)

I'm lowering the priority of this issue since the reporter is not responding and I'm not able to reproduce this.

> 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
>         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