Eric Bresie ebre...@gmail.com
On Sat, Dec 31, 2022 at 11:18 AM Ernie Rael <err...@raelity.com> wrote: > I ran into this, and didn't find a simple solution. > > https://lists.apache.org/thread/lto47nxlhj2r6fbk16l93qs3vy9g2rtg > https://lists.apache.org/thread/tk263h5xco04kwpcfrt55p0lnlmokb0m > > I think you need to hookup a new test runner. I didn't pursue it because > ant is a dead end. > Based on another Slack chat (thanks Laszlo), I'm assuming this is changing in the "nbbuild/templates/common.xml" file within the "-do-junit" target and/or maybe add a new "-do-junit5" target maybe? And maybe update some of the documentation (i.e. https://netbeans.apache.org/kb/docs/java/junit-intro.html) to add JUnit 5 (assume this is maybe take JUnit 4 and adapter where necessary - i.e. from @beforeClass @BeforeTest to @BeforeAll and @BeforeEach, etc., use "JUnit 5 Library" instead of any earlier library) My solution, considering that ant is essentially deprecated in NetBeans, > was to convert projects to Maven or Gradle. -ernie > > On 22/12/31 8:08 AM, Eric Bresie wrote: > > 1. > > While trying to work on janitor issue in Netbeans (an "ant > project"), > > I create new file (Unit Test) for the Janitor class (by default > > it appears > > to generate JUnit 5 based) but noticed when doing so and > > attempting to run > > the test it fails to run with the below warnings/errors (see end > > of email). > > 2. I think this is related to an issue previously identified in JIRA > > 3. NETBEANS-5371<https://issues.apache.org/jira/browse/NETBEANS-5371 > >The > > generated JUnit 5 code from the Ant project cannot be run] > > > > > > If I read it correctly, from the thread it seemed to imply possible > > workaround of either (1) using JUnit 4, or (2) using gradle/maven to deal > > with the dependencies issues. Given netbeans is still ant based (any > plans > > to migrate Netbeans from Ant to Maven or Gradle in the future?), not sure > > if migrating to gradle/maven is fully an option. > > > > The "JUnit5" was added under the "Unit Test Libraries" in the process, so > > maybe there is something going on in that context. > > > > I find some related unit tests (1), (2) issues but nothing beyond that. > > Has anyone else seen similar problems and knows of an existing issues or > > should I migrate the original NETBEANS-5371 JIRA ticket into the GitHub > > issue? > > > > I am using Netbeans 16 with Java 11 on Windows 11. > > > > Eric Bresie > > ebre...@gmail.com > > > > References > > > > 1.https://github.com/apache/netbeans/issues/4576 Create/Update > Tests > > constantly introduces incorrect JUnit dependency version > > 2.https://github.com/apache/netbeans/issues/4904 Many tests fail > on JDK > > 11 > > > > > > Log Exert: > > > > projectized-common.do-unit-test-build: > > Compiling 1 source file to > > C:\git\netbeans\platform\janitor\build\test\unit\classes > > Ignoring source, target and bootclasspath as release has been set > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/AfterEach.class): > > warning: Cannot find annotation method 'status()' in type 'API': class > file > > for org.apiguardian.api.API not found > > warning: unknown enum constant Status.STABLE > > reason: class file for org.apiguardian.api.API$Status not found > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/AfterEach.class): > > warning: Cannot find annotation method 'since()' in type 'API' > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/AfterAll.class): > > warning: Cannot find annotation method 'status()' in type 'API' > > warning: unknown enum constant Status.STABLE > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/AfterAll.class): > > warning: Cannot find annotation method 'since()' in type 'API' > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/BeforeEach.class): > > warning: Cannot find annotation method 'status()' in type 'API' > > warning: unknown enum constant Status.STABLE > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/BeforeEach.class): > > warning: Cannot find annotation method 'since()' in type 'API' > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/BeforeAll.class): > > warning: Cannot find annotation method 'status()' in type 'API' > > warning: unknown enum constant Status.STABLE > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/BeforeAll.class): > > warning: Cannot find annotation method 'since()' in type 'API' > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Test.class): > > warning: Cannot find annotation method 'status()' in type 'API' > > warning: unknown enum constant Status.STABLE > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Test.class): > > warning: Cannot find annotation method 'since()' in type 'API' > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'status()' in type 'API' > > warning: unknown enum constant Status.STABLE > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'since()' in type 'API' > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'status()' in type 'API' > > warning: unknown enum constant Status.STABLE > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'since()' in type 'API' > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'status()' in type 'API' > > warning: unknown enum constant Status.STABLE > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'since()' in type 'API' > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'status()' in type 'API' > > warning: unknown enum constant Status.STABLE > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'since()' in type 'API' > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'status()' in type 'API' > > warning: unknown enum constant Status.STABLE > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'since()' in type 'API' > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'status()' in type 'API' > > warning: unknown enum constant Status.STABLE > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'since()' in type 'API' > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'status()' in type 'API' > > warning: unknown enum constant Status.STABLE > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'since()' in type 'API' > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'status()' in type 'API' > > warning: unknown enum constant Status.STABLE > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'since()' in type 'API' > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'status()' in type 'API' > > warning: unknown enum constant Status.STABLE > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'since()' in type 'API' > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'status()' in type 'API' > > warning: unknown enum constant Status.STABLE > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'since()' in type 'API' > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'status()' in type 'API' > > warning: unknown enum constant Status.STABLE > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'since()' in type 'API' > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'status()' in type 'API' > > warning: unknown enum constant Status.STABLE > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'since()' in type 'API' > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'status()' in type 'API' > > warning: unknown enum constant Status.STABLE > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'since()' in type 'API' > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'status()' in type 'API' > > warning: unknown enum constant Status.STABLE > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'since()' in type 'API' > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'status()' in type 'API' > > warning: unknown enum constant Status.STABLE > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'since()' in type 'API' > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'status()' in type 'API' > > warning: unknown enum constant Status.STABLE > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'since()' in type 'API' > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'status()' in type 'API' > > warning: unknown enum constant Status.STABLE > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'since()' in type 'API' > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'status()' in type 'API' > > warning: unknown enum constant Status.STABLE > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'since()' in type 'API' > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'status()' in type 'API' > > warning: unknown enum constant Status.STABLE > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'since()' in type 'API' > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'status()' in type 'API' > > warning: unknown enum constant Status.STABLE > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'since()' in type 'API' > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'status()' in type 'API' > > warning: unknown enum constant Status.STABLE > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'since()' in type 'API' > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'status()' in type 'API' > > warning: unknown enum constant Status.STABLE > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'since()' in type 'API' > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'status()' in type 'API' > > warning: unknown enum constant Status.STABLE > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'since()' in type 'API' > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'status()' in type 'API' > > warning: unknown enum constant Status.STABLE > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'since()' in type 'API' > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'status()' in type 'API' > > warning: unknown enum constant Status.STABLE > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'since()' in type 'API' > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'status()' in type 'API' > > warning: unknown enum constant Status.STABLE > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'since()' in type 'API' > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'status()' in type 'API' > > warning: unknown enum constant Status.STABLE > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'since()' in type 'API' > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'status()' in type 'API' > > warning: unknown enum constant Status.STABLE > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'since()' in type 'API' > > > C:\git\netbeans\nbbuild\netbeans\platform\modules\ext\junit-jupiter-api-5.6.0.jar(/org/junit/jupiter/api/Assertions.class): > > warning: Cannot find annotation method 'status()' in type 'API' > > error: warnings found and -Werror specified > > 1 error > > 100 warnings > > C:\git\netbeans\nbbuild\templates\common.xml:660: The following error > > occurred while executing this line: > > C:\git\netbeans\nbbuild\templates\common.xml:638: Compile failed; see the > > compiler error output for details. > > BUILD FAILED (total time: 0 seconds) > > >