Uploaded image for project: 'NetBeans'
  1. NetBeans
  2. NETBEANS-4550

NetBeans show error in test classes when we have module-info in test

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 12.0
    • 12.3
    • None

    Description

      Here is a test project https://github.com/PashaTurok/jpms-resource-test1 that has module-info in src/test/java (it is possible starting from surefire/failsafe 3.0.0-M5.

      When we do in-module testing the name of the src/test/java/module-info is the same as the name of src/main/java/module-info. For details see https://sormuras.github.io/blog/2018-09-11-testing-in-the-modular-world.html

      However, NB works badly with such configuration it shows erros and doesn't fix imports etc. See the picture.

      To make situation clearer.

       

      There are these alternatives to use tests with jpms modules:

      1. main and test without module-info (classpath)
      2. main with module-info, but test without module-info (main in modulepath and tests in classpath)
      3. main and test on modulepath:

      1. Two modules: one is a main module and the other is a test module with different packages.
      2. One merged module that contains both tests and main classes with same package names.

       This issue is about 3.2.

      These details were also discussed for SF and FS plugins here https://issues.apache.org/jira/browse/SUREFIRE-1811

      Attachments

        Issue Links

          Activity

            People

              jlahoda Jan Lahoda
              Pavel_K Pavel_K
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 10m
                  1h 10m