Apache Rat
  1. Apache Rat
  2. RAT-104

Using jUnit4 annotation based tests instead of junit3 - migration from junit 3.8.2 to current junit 4.10

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.9
    • Fix Version/s: 0.9
    • Component/s: maven
    • Labels:

      Description

      I'd like to migrate all tests from JUnit3 to annotation based JUnit4 tests - in order to do so the pom's need to be adapted.

      Any objections?

        Issue Links

          Activity

          Hide
          Stefan Bodewig added a comment -

          RAT-59 has been fixed now.

          Show
          Stefan Bodewig added a comment - RAT-59 has been fixed now.
          Hide
          Philipp Ottlinger added a comment -

          Since RAT-59 is not resolved no native JUnit4 test can be added to the trunk.

          Show
          Philipp Ottlinger added a comment - Since RAT-59 is not resolved no native JUnit4 test can be added to the trunk.
          Hide
          Philipp Ottlinger added a comment -

          When I try to run a JUnit4-test (with static imports) with the current pom I get:

           Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.1:testCompile (default-testCompile) on project apache-rat-core: Compilation failure: Compilation failure:
          [ERROR] /home/hirsch/Documents/workspace/rat-plugin/apache-rat-core/src/test/java/org/apache/rat/analysis/license/GPL3LicenseTest.java:[7,7] error: static import declarations are not supported in -source 1.4
          [ERROR] 
          [ERROR] (use -source 5 or higher to enable static import declarations)
          

          Thus the code level needs to be raised to 1.5.

          What are the objections to update to Java5 at all?

          Apart from static imports there are other nice things that could be added

          Show
          Philipp Ottlinger added a comment - When I try to run a JUnit4-test (with static imports) with the current pom I get: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.1:testCompile ( default -testCompile) on project apache-rat-core: Compilation failure: Compilation failure: [ERROR] /home/hirsch/Documents/workspace/rat-plugin/apache-rat-core/src/test/java/org/apache/rat/analysis/license/GPL3LicenseTest.java:[7,7] error: static import declarations are not supported in -source 1.4 [ERROR] [ERROR] (use -source 5 or higher to enable static import declarations) Thus the code level needs to be raised to 1.5. What are the objections to update to Java5 at all? Apart from static imports there are other nice things that could be added
          Hide
          Stefan Bodewig added a comment -

          Using JUnit 4.x means Java5 at build/test time while RAT-59 means Java5 at runtime.

          Show
          Stefan Bodewig added a comment - Using JUnit 4.x means Java5 at build/test time while RAT-59 means Java5 at runtime.
          Hide
          Philipp Ottlinger added a comment - - edited

          I'm not sure whether the switch to Java 1.5 relates to
          https://issues.apache.org/jira/browse/RAT-59

          Perhaps this can be performed as well ?
          Otherwise a real JUnit4 test will fail since sourceCode level still is 1.4 and thus no annotations are supported.

          Show
          Philipp Ottlinger added a comment - - edited I'm not sure whether the switch to Java 1.5 relates to https://issues.apache.org/jira/browse/RAT-59 Perhaps this can be performed as well ? Otherwise a real JUnit4 test will fail since sourceCode level still is 1.4 and thus no annotations are supported.
          Hide
          Stefan Bodewig added a comment -

          Gump is using JUnit's trunk when building/testing RAT so I know it won't hurt to upgrade.

          This means Java5 is now required at build time but I don't expect that to be an issue.

          Fixed with svn revision 1206203

          Show
          Stefan Bodewig added a comment - Gump is using JUnit's trunk when building/testing RAT so I know it won't hurt to upgrade. This means Java5 is now required at build time but I don't expect that to be an issue. Fixed with svn revision 1206203
          Hide
          Philipp Ottlinger added a comment -

          Patched pom.xml to work with Junit 4.10 instead of old version.

          Show
          Philipp Ottlinger added a comment - Patched pom.xml to work with Junit 4.10 instead of old version.

            People

            • Assignee:
              Unassigned
              Reporter:
              Philipp Ottlinger
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development