You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@netbeans.apache.org by "Luff, Chris" <ch...@cerner.com.INVALID> on 2022/08/01 10:31:03 UTC

Nb14, Maven and JUnit Jupiter

Following up on a tweet[1] conversation about the interactions of the NetBeans UI and JUnit Jupiter. I created an example project[2]. The takeaway is that, if the junit-jupiter-engine is not on the class path the UI controls for running focused test methods do nothing and report a misconfigured Surefire or Junit4.

[1]:https://twitter.com/cbm64/status/1553017512954044416
[2]:https://github.com/cbm64chris/jupiter-nb-test

Let me know what y’all think.

Thx
Luff


Product Version: Apache NetBeans IDE 14
Java: 18.0.1; OpenJDK 64-Bit Server VM 18.0.1+10
Runtime: OpenJDK Runtime Environment 18.0.1+10
System: Mac OS X version 12.5 running on x86_64; UTF-8; en_GB (nb)


CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024. Cerner Limited, Registered in England no 2519305, Registered Office 37 North Wharf Road, London W2 1AF.

Re: Nb14, Maven and JUnit Jupiter

Posted by Neil C Smith <ne...@apache.org>.
On Mon, 1 Aug 2022 at 11:31, Luff, Chris <ch...@cerner.com> wrote:
> Following up on a tweet[1] conversation about the interactions of the NetBeans UI and JUnit Jupiter. I created an example project[2]. The takeaway is that, if the junit-jupiter-engine is not on the class path the UI controls for running focused test methods do nothing and report a misconfigured Surefire or Junit4.

Thanks.  The error message and POM change could definitely be more
helpful there, but I still think the project is probably
misconfigured.

The check is at
https://github.com/apache/netbeans/blob/master/java/maven/src/org/netbeans/modules/maven/ActionProviderImpl.java#L224
and the error message is in that file too.

Try with mvn --debug.  While the test runs on the CLI, it seems to
pick up JUnit 3?  More to the point, without adding the
junit-jupiter-engine dependency, single test method selection on the
CLI doesn't work either as far as I can see - try adding a second test
method that throws an assertion error and using -Dtest=... to select
the method.

Best wishes,

Neil

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists