Make the use of 'test' env-var more Eclipse-friendly
----------------------------------------------------

                 Key: MSUREFIRE-180
                 URL: http://jira.codehaus.org/browse/MSUREFIRE-180
             Project: Maven 2.x Surefire Plugin
          Issue Type: Improvement
    Affects Versions: 2.2
            Reporter: raif
            Priority: Minor
         Attachments: surefire-20061116.patch.txt

when using Maven2 in Eclipse, running one test can be made easier with the 
attached external-tool launcher:

<?xml version="1.0" encoding="UTF-8"?>
<launchConfiguration type="org.maven.ide.eclipse.Maven2LaunchConfigurationType">
<listAttribute key="M2_PROPERTIES">
<listEntry value="test=${resource_name}"/>
</listAttribute>
<stringAttribute key="M2_GOALS" value="test"/>
<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" 
value="${project}"/>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.ui.externaltools.launchGroup"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" 
value="${workspace_loc:/xxx"/>
</launchConfiguration>

this allows the developer to select a test, and then run the above external 
tool.  Eclipse resolves this variable to the name of the selected test class; 
e.g. "TestFoo.java".  the problem with the current code of the plugin is that 
the value of the 'test' env-var is blindly used with a ".java" suffix thus 
causing the ultimate regular expression used for selecting the test file 
invalid; e.g. with the example value above that expression ends up being: 
"**/TestFoo.java.java".

the attached patch only adds the ".java" suffix if the value of the 'test' 
env-var does not end with the same.

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

        

Reply via email to