in theory it should be doable.
the mechanisms to distinguish beteen testng and junit could be extended in
the build-impl.xml inside the nbproject folder.
there the antscript evaluates the classpath on testng or junit4 artifacts.
once that is determined, the script selects the proper runner. this looks
extendable to me. assuming that the build-impl.xml is either generated from
a template, or copied verbatim, the nb module containing it needs a bit of
patching. as for being able to select the initial first test variant: a bit
of restoring the old mechanism so in the end one can select junit4, testng
and junit5. need some pointers into the code base, to start tweaking and
prepare a pull request.

On Thu, 10 Jan 2019, 11:10 Peter Hull <peterhul...@gmail.com wrote:

> Hi all,
> I was trying to add Tests to a Java SE project and it didn't work. So
> I went back to the simplest case to try again.
> 1. Create a new Java Application with default main class
> 2. Select Tools|Create/Update Tests, press OK
> 3. (IDE creates files and adds a default test for 'main')
> 4. Select Run|Test Project
>
> I see:
> Compiling 1 source file to
>
> D:\Libraries\Documents\NetBeansProjects\JavaApplication16\build\test\classes
> warning: unknown enum constant Status.STABLE
>   reason: class file for org.apiguardian.api.API$Status not found
> warning: unknown enum constant Status.STABLE
> (this line repeated)
> 13 warnings
> compile-test:
> Created dir:
> D:\Libraries\Documents\NetBeansProjects\JavaApplication16\build\test\results
> No tests executed.
> test-report:
> test:
> BUILD SUCCESSFUL (total time: 1 second)
>
> If I select the 'main' Java file and Run|Test File I get:
>
> C:\Users\peter\AppData\Local\NetBeans\Cache\10.0\executor-snippets\junit.xml:184:
> The following error occurred while executing this line:
>
> C:\Users\peter\AppData\Local\NetBeans\Cache\10.0\executor-snippets\junit.xml:128:
> The <classpath> or <modulepath> for <junit> must include junit.jar if
> not in Ant's own classpath
> BUILD FAILED (total time: 0 seconds)
>
> Should this work and if so, what am I doing wrong?
>
> Using
> Product Version: Apache NetBeans IDE 10.0 (Build
> incubator-netbeans-release-380-on-20181217)
> Java: 11.0.1; OpenJDK 64-Bit Server VM 11.0.1+13
> Runtime: OpenJDK Runtime Environment 11.0.1+13
> System: Windows 10 version 10.0 running on amd64; Cp1252; en_GB (nb)
>
> Thanks,
> Peter
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@netbeans.apache.org
> For additional commands, e-mail: users-h...@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>

Reply via email to