Fwd: Junit5 support in netbeans

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
Report Content as Inappropriate

Fwd: Junit5 support in netbeans

Geertjan Wielenga-3

Re JUnit5, I've just been having a discussion about this, see below.


-------- Forwarded Message --------
Subject: Junit5 support in netbeans
Date: Wed, 12 Apr 2017 12:26:49 +0100
From: James Pittendreigh [hidden email]
To: [hidden email]

Hi Geertjan,

Thank you for replying to my tweet, I'll try to explain what I was referring to with regards to "Junit 5 support in Netbeans"...

In Netbeans, if I run any Junit 4 tests, then the tests are run via the relevant gradle/maven commands and the results are displayed in the Test Results panel like so:

If I try the same with a Junit5 test, then the tests are run (because the same gradle/maven goals are invoked) but the IDE is not configured to pick up the test reports from the junit location or format, as such Netbeans does not show the test results in the Test Results panel, and instead shows the error bubble, like in the picture below:

If I compare this to on Jetbrains' IntelliJ IDE, this shows the junit 5 tests graphically. I guess there's a couple of other things to note here in the output which is different to Junit4. Junit5 supports nested or hierarchical tests, so tests can be grouped by feature.  Additionally it has support for tests to have a human readable display name, so as you can see below, some tests have spaces, and some are nested:

I guess there's a few other requirements for full support, but something else that strikes me as missing is:  When you go to Tools -> Create Update Unit tests, it'd be great if this section was able to detect that you are using junit5, and offer up the opportunity to generate Junit 5 compatible methods (it currently only supports Junit4 ones). The annotations used in Junit 5 are sometimes different to their Junit 4 counterparts, for example, @BeforeClass is now @BeforeAll, additionally the junit5 annotations have a different namespace.

I tested the above scenarios in Netbeans 8.1 and 8.2.

I hope this makes my tweet a little clearer, I completely understand Netbeans is a community driven project, but was just curious as to if this feature would be added any time soon (I would love to get back to using Netbeans!)

Many thanks