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

          Philipp Ottlinger created issue -
          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.
          Philipp Ottlinger made changes -
          Field Original Value New Value
          Attachment RAT104patchedPomXmlWithJunit410AndVersionPropertyValue_r1205166.txt [ 12504801 ]
          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
          Stefan Bodewig made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          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.
          Philipp Ottlinger made changes -
          Link This issue is blocked by RAT-59 [ RAT-59 ]
          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 -

          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
          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.
          Philipp Ottlinger made changes -
          Resolution Fixed [ 1 ]
          Status Resolved [ 5 ] Reopened [ 4 ]
          Hide
          Stefan Bodewig added a comment -

          RAT-59 has been fixed now.

          Show
          Stefan Bodewig added a comment - RAT-59 has been fixed now.
          Stefan Bodewig made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Fix Version/s 0.9 [ 12319071 ]
          Resolution Fixed [ 1 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Resolved Resolved
          2d 18h 2m 1 Stefan Bodewig 25/Nov/11 15:08
          Resolved Resolved Reopened Reopened
          4d 6h 58m 1 Philipp Ottlinger 29/Nov/11 22:07
          Reopened Reopened Resolved Resolved
          23h 4m 1 Stefan Bodewig 30/Nov/11 21:11

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development