You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@netbeans.apache.org by Alex Sviridov <oo...@mail.ru.INVALID> on 2019/07/02 09:26:53 UTC
Integration tests in NetBeans and module-info
Hi all,
I use NB 11.0 and I work on JPMS module with integrations tests. My folder structure is like this:
.
|-- pom.xml
`-- src
|-- it
| `-- java
| `-- com
| `-- soebes
| `-- maui
| `-- it
| `-- BitMaskIT.java
|-- main
| `-- java
| `-- com
| `-- soebes
| `-- maui
| `-- it
| `-- BitMask.java
`-- test
`-- java
`-- com
`-- soebes
`-- maui
`-- it
`-- BitMaskTest.java
The problem is NB wants JUnit modules for integrations tests to be declared in module-info.
Otherwise it shows errors. At the same time code all execution tests are compiled and
run without problems. Could anyone say how to fix it?
--
Best regards, Alex Sviridov
Re: Integration tests in NetBeans and module-info
Posted by Emma Atkinson <em...@gmail.com>.
I too searched for a solution in my case with TestNG. I did not want to
contaminate the module.info with test lines that had to be edited out once
testing was passed successfully. Defeats one object of black box
integration testing adding a risk that an inadvertent change crept in.
My solution was to put TestNG on the classpath until I find something
better.
Other potential solutions I thought of involve changing the build scripts
to accommodate a "test" module.info file under the test hierarchy or a
module.info delta file for testing. Some sort of flag in the module file to
indicate a "for testing" annotation would be another way, I suppose. These
are not great either.
I am surprised this wasn't considered when Oracle introduced modules into
JDK-9. May be it was. So I stand ready to be corrected.
Emma
On 10:27, Tue, 2 Jul 2019 Alex Sviridov <ooo_saturn7@mail.ru.invalid wrote:
> Hi all,
>
> I use NB 11.0 and I work on JPMS module with integrations tests. My folder
> structure is like this:
> .
> |-- pom.xml
> `-- src
> |-- it
> | `-- java
> | `-- com
> | `-- soebes
> | `-- maui
> | `-- it
> | `-- BitMaskIT.java
> |-- main
> | `-- java
> | `-- com
> | `-- soebes
> | `-- maui
> | `-- it
> | `-- BitMask.java
> `-- test
> `-- java
> `-- com
> `-- soebes
> `-- maui
> `-- it
> `-- BitMaskTest.java
>
> The problem is NB wants JUnit modules for integrations tests to be
> declared in module-info.
> Otherwise it shows errors. At the same time code all execution tests are
> compiled and
> run without problems. Could anyone say how to fix it?
>
>
> --
> Best regards, Alex Sviridov
>