Mojo's GWT Maven Plugin
  1. Mojo's GWT Maven Plugin
  2. MGWT-175

Warnings from tests that are excluded during gwt:test

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Won't Fix
    • Affects Version/s: 1.2
    • Fix Version/s: None
    • Labels:
      None
    • Number of attachments :
      1

      Description

      I currently have a project setup that combines standard JUnit 4 tests along with the GWTTestCase tests. I have it configured[1] based on the testing guide for how to separate the tests. The build works however I get warning for tests that are supposed be excluded from being ran during the gwt:test goal.

      [INFO] [surefire:test

      {execution: default-test}

      ]
      [INFO] Surefire report directory: /home/mw010351/workspaces/preferences/example-project/target/surefire-reports

      -------------------------------------------------------
      T E S T S
      -------------------------------------------------------
      Running com.example.project.client.SimpleTest
      Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.022 sec

      Results :

      Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

      [INFO] [gwt:test

      {execution: test}

      ]
      [INFO] using GWT jars for specified version 2.0.0
      [INFO] establishing classpath list (scope = test)
      [INFO]
      [INFO] -------------------------------------------------------
      [INFO] T E S T S
      [INFO] -------------------------------------------------------
      [INFO] Running junit.framework.TestSuite@11975b59
      [INFO] Validating newly compiled units
      [INFO] [ERROR] Errors in 'file:/home/mw010351/workspaces/preferences/example-project/src/test/java/com/example/project/client/SimpleTest.java'
      [INFO] [ERROR] Line 10: No source code is available for type org.junit.Assert; did you forget to inherit a required module?
      [INFO] Validating newly compiled units
      [INFO] [ERROR] Errors in 'file:/home/mw010351/workspaces/preferences/example-project/src/test/java/com/example/project/client/SimpleTest.java'
      [INFO] [ERROR] Line 10: No source code is available for type org.junit.Assert; did you forget to inherit a required module?
      [INFO] Hello World
      [INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 11.818 sec
      [INFO]
      [INFO] Results :
      [INFO]
      [INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
      [INFO]
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD SUCCESSFUL
      [INFO] ------------------------------------------------------------------------

      [1] - http://mojo.codehaus.org/gwt-maven-plugin/user-guide/testing.html

        Activity

        Hide
        Jon Vaughan added a comment - - edited

        Me too - "Validating newly compiled units" picks up on classes that are not in the include path, whether I am running tests individually or as part of a suite. Also regardless of whether they run in the test phase or the default.

        Show
        Jon Vaughan added a comment - - edited Me too - "Validating newly compiled units" picks up on classes that are not in the include path, whether I am running tests individually or as part of a suite. Also regardless of whether they run in the test phase or the default.
        Hide
        Olivier Lamy added a comment -

        to review

        Show
        Olivier Lamy added a comment - to review
        Olivier Lamy made changes -
        Field Original Value New Value
        Fix Version/s 2.1.x [ 16941 ]
        nicolas de loof made changes -
        Fix Version/s 2.2 [ 17169 ]
        Fix Version/s 2.1.x [ 16941 ]
        nicolas de loof made changes -
        Fix Version/s 2.2.0 [ 17169 ]
        Hide
        Thomas Broyer added a comment -

        GWT scans all files on the "source path" (within the classpath), regardless of which tests to run.

        The only possible fix would be to settle on a project layout where GWTTestCase go into src/test/gwt rather than src/test/java and using a special invocation of the maven-compiler-plugin to compile them into a different directory than target/test-classes (e.g. target/gwt-test-classes) so that we could run gwt:test with that output directory in the classpath in place of target/test-classes.
        That would preclude sharing code between src/test/java and src/test/gwt, unless src/test/gwt (or target/gwt-test-classes) is also used with the maven-surefire-plugin.

        I don't think this is worth it, given these messages don't fail the build.

        It's far easier to "segregate" your tests in packages so that you don't mix JUnit4 and JUnit3 tests in the same package.
        Alternately you can explicitly exclude JUnit4 tests from the source path using an exclude patter in your gwt.xml.

        Show
        Thomas Broyer added a comment - GWT scans all files on the "source path" (within the classpath), regardless of which tests to run. The only possible fix would be to settle on a project layout where GWTTestCase go into src/test/gwt rather than src/test/java and using a special invocation of the maven-compiler-plugin to compile them into a different directory than target/test-classes (e.g. target/gwt-test-classes ) so that we could run gwt:test with that output directory in the classpath in place of target/test-classes . That would preclude sharing code between src/test/java and src/test/gwt , unless src/test/gwt (or target/gwt-test-classes ) is also used with the maven-surefire-plugin . I don't think this is worth it, given these messages don't fail the build. It's far easier to "segregate" your tests in packages so that you don't mix JUnit4 and JUnit3 tests in the same package. Alternately you can explicitly exclude JUnit4 tests from the source path using an exclude patter in your gwt.xml .
        Thomas Broyer made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Won't Fix [ 2 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Micah Whitacre
          • Votes:
            5 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: