Uploaded image for project: 'Maven Surefire'
  1. Maven Surefire
  2. SUREFIRE-186

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

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0 (2.2 plugin)
    • 2.4
    • None
    • None
    • Patch

    Description

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            raif raif
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: