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

Clean Build Compilation for Tests generating error for projects sharing packages

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • projects - Ant Project
    • None

    Description

      On a project that uses a package from a different project, when attempting to run all tests (Alt+F6), the tests cannot run due to missing symbols corresponding to the ones of the shared package.

      After that happens, when re attempting to run all the tests they will run since the required symbols are already there.

      Therefore the issue only occurs right after a clean compilation build for testing. The issue can be reproduced by running the test for a single class (Ctrl+F6) and then running all tests (Alt+F6) which will trigger a clean build compilation again.

      Ouput demonstrating the error:

          ant -f ...nbPath
      CurrentProject -Dnb.internal.action.name=test -Dignore.failing.tests=true -Dnb.wait.for.caches=true test
          init:
          Deleting: ...nbPath\CurrentProject\build\built-jar.properties
          deps-jar:
          Updating property file: ...nbPath\CurrentProject\build\built-jar.properties
          SharedPackageProject.init:
          SharedPackageProject.deps-jar:
          Updating property file: ...nbPath\CurrentProject\build\built-jar.properties
          SharedPackageProject.init:
          SharedPackageProject.deps-clean:
          Updating property file: ...nbPath\SharedPackageProject\build\built-clean.properties
          Deleting directory ...nbPath\SharedPackageProject\build
          SharedPackageProject.clean:
          Created dir: ...nbPath\SharedPackageProject\build\classes
          Created dir: ...nbPath\SharedPackageProject\build\empty
          Created dir: ...nbPath\SharedPackageProject\build\generated-sources\ap-source-output
          Compiling 2 source files to ...nbPath\SharedPackageProject\build\classes
          SharedPackageProject.compile:
          Created dir: ...nbPath\SharedPackageProject\dist
          Copying 1 file to ...nbPath\SharedPackageProject\build
          Copy libraries to ...nbPath\SharedPackageProject\dist\lib.
          Building jar: ...nbPath\SharedPackageProject\dist\SharedPackageProject.jar
          To run this application from the command line without Ant, try:
          java -jar "...nbPath\SharedPackageProject\dist\SharedPackageProject.jar"
          SharedPackageProject.jar:
          init:
          deps-clean:
          Updating property file: ...nbPath\CurrentProject\build\built-clean.properties
          SharedPackageProject.init:
          SharedPackageProject.deps-clean:
          Updating property file: ...nbPath\CurrentProject\build\built-clean.properties
          Deleting directory ...nbPath\SharedPackageProject\build
          SharedPackageProject.clean:
          Deleting directory ...nbPath\CurrentProject\build
          clean:
          Created dir: ...nbPath\CurrentProject\build\classes
          Created dir: ...nbPath\CurrentProject\build\empty
          Created dir: ...nbPath\CurrentProject\build\generated-sources\ap-source-output
          Compiling 11 source files to ...nbPath\CurrentProject\build\classes
          ...nbPath\CurrentProject\src\CurrentProject\Dao.java:13: error: package SharedPackageProject does not exist
          import SharedPackageProject.SmartDatabase;
          ...nbPath\CurrentProject\src\CurrentProject\Dao.java:22: error: cannot find symbol

      Output when running all tests for a second time:

          ant -f ...nbPath
      CurrentProject -Dnb.internal.action.name=test -Dignore.failing.tests=true -Dnb.wait.for.caches=true test
          init:
          deps-jar:
          Updating property file: ...nbPath\CurrentProject\build\built-jar.properties
          SharedPackageProject.init:
          SharedPackageProject.deps-jar:
          Created dir: ...nbPath\SharedPackageProject\build
          Updating property file: ...nbPath\CurrentProject\build\built-jar.properties
          Created dir: ...nbPath\SharedPackageProject\build\classes
          Created dir: ...nbPath\SharedPackageProject\build\empty
          Created dir: ...nbPath\SharedPackageProject\build\generated-sources\ap-source-output
          Compiling 2 source files to ...nbPath\SharedPackageProject\build\classes
          SharedPackageProject.compile:
          Created dir: ...nbPath\SharedPackageProject\dist
          Copying 1 file to ...nbPath\SharedPackageProject\build
          Copy libraries to ...nbPath\SharedPackageProject\dist\lib.
          Building jar: ...nbPath\SharedPackageProject\dist\SharedPackageProject.jar
          To run this application from the command line without Ant, try:
          java -jar "...nbPath\SharedPackageProject\dist\SharedPackageProject.jar"
          SharedPackageProject.jar:
          Compiling 11 source files to ...nbPath\CurrentProject\build\classes
          compile:
          Created dir: ...nbPath\CurrentProject\build\test\classes
          Compiling 4 source files to ...nbPath\CurrentProject\build\test\classes
          compile-test:
          Created dir: ...nbPath\CurrentProject\build\test\results
          Testsuite: CurrentProject.DaoTest
          //...My expected tests output

      Attachments

        Activity

          People

            Unassigned Unassigned
            leedMx leed Mx
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: