Hi Eric,
To tell the truth I didn’t understand quite well what you you meant. Please,
read the article which link I provided.
Maven sure fire already supports in-module testing almost well (there is one
problem with resources). The problem is in NB — it doesn’t consider situation
when main and test module ARE ONE MODULE with same name (because they are merged
at compilation time). So, when I have in main module in com.foo.Bar my
com.foo.BarTest doesn’t see that com.foo.Bar.
I think this issue is rather important because as JPMS is becoming more popular
people will think how they will
make unit testing for their modules. In-module testing has a lot of advantages
over two modules design.
--
Best regards, Alex Orlov
>Пятница, 11 декабря 2020, 22:33 +03:00 от Eric Bresie <[email protected]>:
>
>I'm still new on modules but...
>
>On the ticket the class under test module-info.java didn't look to have any
>exported interfaces. Could that be preventing the test case from having
>access to elements of the class?
>
>Assume test mechanism in use for this (junit, ngtest, etc.) are utilizing jars
>which support modules also right?
>
>Eric Bresie
>[email protected]
>On Thu, Dec 10, 2020 at 12:43 PM Alex Orlov < [email protected] >
>wrote:
>
>>Hello all,
>>
>>NB 12.1 supports JPMS modules rather well. However, there is still one
>>problem that must be solved.
>>The problem is about unit testing with JPMS — NB doesn’t support in-module
>>testing that is the best
>>variant for unit testing (because tests and classes under tests are in the
>>same package).
>>
>>What is in-module testing is described here in details :
>>https://sormuras.github.io/blog/2018-09-11-testing-in-the-modular-world.html#in-module-testing-with-module-infojava
>>
>>The issue I opened is here —
>>https://issues.apache.org/jira/browse/NETBEANS-4550
>>
>>However, I didn’t see any movement. So, could anyone say if there are any
>>plans to add in-module support in NB 12?
>>
>>--
>>Best regards, Alex Orlov