You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@netbeans.apache.org by Peter Hull <pe...@gmail.com> on 2019/01/10 10:10:27 UTC

NetBeans 10 JUnit support

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-unsubscribe@netbeans.apache.org
For additional commands, e-mail: users-help@netbeans.apache.org

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


Re: NetBeans 10 JUnit support

Posted by Geertjan Wielenga <ge...@googlemail.com.INVALID>.
Related to this:

https://netbeans.org/bugzilla/show_bug.cgi?id=245637
https://hg.netbeans.org/web-main/rev/459035808e45

The above is how upgrading to 4.12 was done.

Gj

On Fri, Jan 18, 2019 at 9:26 PM Geertjan Wielenga <
geertjan.wielenga@googlemail.com> wrote:

> Great to hear, thanks. Will investigate too.
>
> We need to get JUnit 5 support for Ant, clearly, quite a few people asking
> for this who're not ready or never will be ready to use Maven.
>
> Any insights anyone can provide around how best to do this would
> be appreciated, I'll be investigating this too.
>
> Gj
>
>
> On Fri, Jan 18, 2019 at 7:08 PM John McDonnell <mc...@gmail.com>
> wrote:
>
>> Hi Geertjan
>>
>> I didn't remove any dialog.
>>
>> Not near a laptop at present but I don't remember seeing that dialog for
>> a few versions now... maybe it only showed when you had a lower version of
>> java that could support JUnit 3 or 4. But then again at lease in NB 8.2 if
>> you had a java 8 project no dialog showed.
>>
>> I implemented my approach based on the opinion from the JUnit 5 docs(I
>> think) that JUnit 5 is the more java 8 specific version to use (or
>> something to that effect. Can't remember the actual wording).
>>
>> I guess I didn't think many other people use Ant based projects in 2018.
>> Any changes in further from me will have that consideration.
>>
>> Regards
>>
>> John
>>
>> On Fri 18 Jan 2019, 13:07 Geertjan Wielenga <
>> geertjan.wielenga@googlemail.com wrote:
>>
>>> I was looking at this today and I can't find the "Select JUnit Version"
>>> dialog, which is there in the tutorial, but not in Apache NetBeans 10:
>>>
>>> https://netbeans.org/kb/docs/java/junit-intro.html
>>>
>>> @John McDonnell <mc...@gmail.com>, I guess you removed that
>>> dialog so that only JUnit 5 tests can now be created? I'm not sure about
>>> that in retrospect -- I think we should let the user choose which JUnit
>>> version they want to use and not assume JUnit 5 for all cases?
>>>
>>> Gj
>>>
>>>
>>> On Mon, Jan 14, 2019 at 9:16 PM John McDonnell <mc...@gmail.com>
>>> wrote:
>>>
>>>> This looks familiar...
>>>>
>>>> This was around the area where I got stuck.  I had found
>>>> https://github.com/apache/incubator-netbeans/tree/master/java/java.j2seproject/src/org/netbeans/modules/java/j2seproject/resources
>>>> where theres a reference to j2seproject3:junit in the build-impl.xsl but
>>>> dont believe I made it too much further.
>>>>
>>>> Regards
>>>>
>>>> John
>>>>
>>>> On Mon, 14 Jan 2019 at 15:23, Peter Hull <pe...@gmail.com> wrote:
>>>>
>>>>> On Fri, Jan 11, 2019 at 9:38 AM Peter Hull <pe...@gmail.com>
>>>>> wrote:
>>>>> > If I can, I will try and manually get JUnit 5 tests working and make
>>>>> > list of what I had to add/change.
>>>>> I do need a bit more help on this (John McDonnell?)
>>>>> I added these files to netbeans/extide/ant/lib:
>>>>> * junit-platform-commons-1.3.1.jar
>>>>> * junit-platform-engine-1.3.1.jar
>>>>> * junit-platform-launcher-1.3.1.jar
>>>>>
>>>>> I made sure the library JUnit-5.3.1 was in the Test Libraries for my
>>>>> project
>>>>>
>>>>> And added this target to my project's build.xml file:
>>>>>     <target name="test-five" depends="compile-test,-pre-test-run">
>>>>>         <junitlauncher>
>>>>>             <classpath>
>>>>>                 <path path="${run.test.classpath}"/>
>>>>>             </classpath>
>>>>>             <testclasses>
>>>>>                 <fileset dir="${build.test.classes.dir}">
>>>>>                     <include name="**/*Test.class"/>
>>>>>                 </fileset>
>>>>>                 <listener type="legacy-brief" sendSysOut="true"/>
>>>>>                 <listener type="legacy-xml" sendSysErr="true"
>>>>> sendSysOut="true"/>
>>>>>             </testclasses>
>>>>>         </junitlauncher>
>>>>>     </target>
>>>>>
>>>>> Now running the target 'test-five' does run my tests (the framework
>>>>> for which was generated by NB) but there is no integration with the
>>>>> IDE.
>>>>> According to the docs, the "legacy-*" listeners produce output
>>>>> compatible with JUnit4 so if we could hook into these it should be OK.
>>>>> Looking at the existing test targets in the build.xml and
>>>>> build-impl.xml, I can't figure out how they work - it seems like NB
>>>>> provides some extra tasks to ant which are called things like
>>>>> j2seproject3:junit and j2seproject3:test-impl but I can't see where
>>>>> they come from.
>>>>>
>>>>> Any hints from those who know?
>>>>>
>>>>> Thanks
>>>>> Pete
>>>>>
>>>>

Re: NetBeans 10 JUnit support

Posted by Geertjan Wielenga <ge...@googlemail.com.INVALID>.
Great to hear, thanks. Will investigate too.

We need to get JUnit 5 support for Ant, clearly, quite a few people asking
for this who're not ready or never will be ready to use Maven.

Any insights anyone can provide around how best to do this would
be appreciated, I'll be investigating this too.

Gj


On Fri, Jan 18, 2019 at 7:08 PM John McDonnell <mc...@gmail.com>
wrote:

> Hi Geertjan
>
> I didn't remove any dialog.
>
> Not near a laptop at present but I don't remember seeing that dialog for a
> few versions now... maybe it only showed when you had a lower version of
> java that could support JUnit 3 or 4. But then again at lease in NB 8.2 if
> you had a java 8 project no dialog showed.
>
> I implemented my approach based on the opinion from the JUnit 5 docs(I
> think) that JUnit 5 is the more java 8 specific version to use (or
> something to that effect. Can't remember the actual wording).
>
> I guess I didn't think many other people use Ant based projects in 2018.
> Any changes in further from me will have that consideration.
>
> Regards
>
> John
>
> On Fri 18 Jan 2019, 13:07 Geertjan Wielenga <
> geertjan.wielenga@googlemail.com wrote:
>
>> I was looking at this today and I can't find the "Select JUnit Version"
>> dialog, which is there in the tutorial, but not in Apache NetBeans 10:
>>
>> https://netbeans.org/kb/docs/java/junit-intro.html
>>
>> @John McDonnell <mc...@gmail.com>, I guess you removed that
>> dialog so that only JUnit 5 tests can now be created? I'm not sure about
>> that in retrospect -- I think we should let the user choose which JUnit
>> version they want to use and not assume JUnit 5 for all cases?
>>
>> Gj
>>
>>
>> On Mon, Jan 14, 2019 at 9:16 PM John McDonnell <mc...@gmail.com>
>> wrote:
>>
>>> This looks familiar...
>>>
>>> This was around the area where I got stuck.  I had found
>>> https://github.com/apache/incubator-netbeans/tree/master/java/java.j2seproject/src/org/netbeans/modules/java/j2seproject/resources
>>> where theres a reference to j2seproject3:junit in the build-impl.xsl but
>>> dont believe I made it too much further.
>>>
>>> Regards
>>>
>>> John
>>>
>>> On Mon, 14 Jan 2019 at 15:23, Peter Hull <pe...@gmail.com> wrote:
>>>
>>>> On Fri, Jan 11, 2019 at 9:38 AM Peter Hull <pe...@gmail.com>
>>>> wrote:
>>>> > If I can, I will try and manually get JUnit 5 tests working and make
>>>> > list of what I had to add/change.
>>>> I do need a bit more help on this (John McDonnell?)
>>>> I added these files to netbeans/extide/ant/lib:
>>>> * junit-platform-commons-1.3.1.jar
>>>> * junit-platform-engine-1.3.1.jar
>>>> * junit-platform-launcher-1.3.1.jar
>>>>
>>>> I made sure the library JUnit-5.3.1 was in the Test Libraries for my
>>>> project
>>>>
>>>> And added this target to my project's build.xml file:
>>>>     <target name="test-five" depends="compile-test,-pre-test-run">
>>>>         <junitlauncher>
>>>>             <classpath>
>>>>                 <path path="${run.test.classpath}"/>
>>>>             </classpath>
>>>>             <testclasses>
>>>>                 <fileset dir="${build.test.classes.dir}">
>>>>                     <include name="**/*Test.class"/>
>>>>                 </fileset>
>>>>                 <listener type="legacy-brief" sendSysOut="true"/>
>>>>                 <listener type="legacy-xml" sendSysErr="true"
>>>> sendSysOut="true"/>
>>>>             </testclasses>
>>>>         </junitlauncher>
>>>>     </target>
>>>>
>>>> Now running the target 'test-five' does run my tests (the framework
>>>> for which was generated by NB) but there is no integration with the
>>>> IDE.
>>>> According to the docs, the "legacy-*" listeners produce output
>>>> compatible with JUnit4 so if we could hook into these it should be OK.
>>>> Looking at the existing test targets in the build.xml and
>>>> build-impl.xml, I can't figure out how they work - it seems like NB
>>>> provides some extra tasks to ant which are called things like
>>>> j2seproject3:junit and j2seproject3:test-impl but I can't see where
>>>> they come from.
>>>>
>>>> Any hints from those who know?
>>>>
>>>> Thanks
>>>> Pete
>>>>
>>>

Re: NetBeans 10 JUnit support

Posted by John McDonnell <mc...@gmail.com>.
Hi Geertjan

I didn't remove any dialog.

Not near a laptop at present but I don't remember seeing that dialog for a
few versions now... maybe it only showed when you had a lower version of
java that could support JUnit 3 or 4. But then again at lease in NB 8.2 if
you had a java 8 project no dialog showed.

I implemented my approach based on the opinion from the JUnit 5 docs(I
think) that JUnit 5 is the more java 8 specific version to use (or
something to that effect. Can't remember the actual wording).

I guess I didn't think many other people use Ant based projects in 2018.
Any changes in further from me will have that consideration.

Regards

John

On Fri 18 Jan 2019, 13:07 Geertjan Wielenga <
geertjan.wielenga@googlemail.com wrote:

> I was looking at this today and I can't find the "Select JUnit Version"
> dialog, which is there in the tutorial, but not in Apache NetBeans 10:
>
> https://netbeans.org/kb/docs/java/junit-intro.html
>
> @John McDonnell <mc...@gmail.com>, I guess you removed that
> dialog so that only JUnit 5 tests can now be created? I'm not sure about
> that in retrospect -- I think we should let the user choose which JUnit
> version they want to use and not assume JUnit 5 for all cases?
>
> Gj
>
>
> On Mon, Jan 14, 2019 at 9:16 PM John McDonnell <mc...@gmail.com>
> wrote:
>
>> This looks familiar...
>>
>> This was around the area where I got stuck.  I had found
>> https://github.com/apache/incubator-netbeans/tree/master/java/java.j2seproject/src/org/netbeans/modules/java/j2seproject/resources
>> where theres a reference to j2seproject3:junit in the build-impl.xsl but
>> dont believe I made it too much further.
>>
>> Regards
>>
>> John
>>
>> On Mon, 14 Jan 2019 at 15:23, Peter Hull <pe...@gmail.com> wrote:
>>
>>> On Fri, Jan 11, 2019 at 9:38 AM Peter Hull <pe...@gmail.com>
>>> wrote:
>>> > If I can, I will try and manually get JUnit 5 tests working and make
>>> > list of what I had to add/change.
>>> I do need a bit more help on this (John McDonnell?)
>>> I added these files to netbeans/extide/ant/lib:
>>> * junit-platform-commons-1.3.1.jar
>>> * junit-platform-engine-1.3.1.jar
>>> * junit-platform-launcher-1.3.1.jar
>>>
>>> I made sure the library JUnit-5.3.1 was in the Test Libraries for my
>>> project
>>>
>>> And added this target to my project's build.xml file:
>>>     <target name="test-five" depends="compile-test,-pre-test-run">
>>>         <junitlauncher>
>>>             <classpath>
>>>                 <path path="${run.test.classpath}"/>
>>>             </classpath>
>>>             <testclasses>
>>>                 <fileset dir="${build.test.classes.dir}">
>>>                     <include name="**/*Test.class"/>
>>>                 </fileset>
>>>                 <listener type="legacy-brief" sendSysOut="true"/>
>>>                 <listener type="legacy-xml" sendSysErr="true"
>>> sendSysOut="true"/>
>>>             </testclasses>
>>>         </junitlauncher>
>>>     </target>
>>>
>>> Now running the target 'test-five' does run my tests (the framework
>>> for which was generated by NB) but there is no integration with the
>>> IDE.
>>> According to the docs, the "legacy-*" listeners produce output
>>> compatible with JUnit4 so if we could hook into these it should be OK.
>>> Looking at the existing test targets in the build.xml and
>>> build-impl.xml, I can't figure out how they work - it seems like NB
>>> provides some extra tasks to ant which are called things like
>>> j2seproject3:junit and j2seproject3:test-impl but I can't see where
>>> they come from.
>>>
>>> Any hints from those who know?
>>>
>>> Thanks
>>> Pete
>>>
>>

Re: NetBeans 10 JUnit support

Posted by Geertjan Wielenga <ge...@googlemail.com.INVALID>.
I was looking at this today and I can't find the "Select JUnit Version"
dialog, which is there in the tutorial, but not in Apache NetBeans 10:

https://netbeans.org/kb/docs/java/junit-intro.html

@John McDonnell <mc...@gmail.com>, I guess you removed that dialog
so that only JUnit 5 tests can now be created? I'm not sure about that in
retrospect -- I think we should let the user choose which JUnit version
they want to use and not assume JUnit 5 for all cases?

Gj


On Mon, Jan 14, 2019 at 9:16 PM John McDonnell <mc...@gmail.com>
wrote:

> This looks familiar...
>
> This was around the area where I got stuck.  I had found
> https://github.com/apache/incubator-netbeans/tree/master/java/java.j2seproject/src/org/netbeans/modules/java/j2seproject/resources
> where theres a reference to j2seproject3:junit in the build-impl.xsl but
> dont believe I made it too much further.
>
> Regards
>
> John
>
> On Mon, 14 Jan 2019 at 15:23, Peter Hull <pe...@gmail.com> wrote:
>
>> On Fri, Jan 11, 2019 at 9:38 AM Peter Hull <pe...@gmail.com> wrote:
>> > If I can, I will try and manually get JUnit 5 tests working and make
>> > list of what I had to add/change.
>> I do need a bit more help on this (John McDonnell?)
>> I added these files to netbeans/extide/ant/lib:
>> * junit-platform-commons-1.3.1.jar
>> * junit-platform-engine-1.3.1.jar
>> * junit-platform-launcher-1.3.1.jar
>>
>> I made sure the library JUnit-5.3.1 was in the Test Libraries for my
>> project
>>
>> And added this target to my project's build.xml file:
>>     <target name="test-five" depends="compile-test,-pre-test-run">
>>         <junitlauncher>
>>             <classpath>
>>                 <path path="${run.test.classpath}"/>
>>             </classpath>
>>             <testclasses>
>>                 <fileset dir="${build.test.classes.dir}">
>>                     <include name="**/*Test.class"/>
>>                 </fileset>
>>                 <listener type="legacy-brief" sendSysOut="true"/>
>>                 <listener type="legacy-xml" sendSysErr="true"
>> sendSysOut="true"/>
>>             </testclasses>
>>         </junitlauncher>
>>     </target>
>>
>> Now running the target 'test-five' does run my tests (the framework
>> for which was generated by NB) but there is no integration with the
>> IDE.
>> According to the docs, the "legacy-*" listeners produce output
>> compatible with JUnit4 so if we could hook into these it should be OK.
>> Looking at the existing test targets in the build.xml and
>> build-impl.xml, I can't figure out how they work - it seems like NB
>> provides some extra tasks to ant which are called things like
>> j2seproject3:junit and j2seproject3:test-impl but I can't see where
>> they come from.
>>
>> Any hints from those who know?
>>
>> Thanks
>> Pete
>>
>

Re: NetBeans 10 JUnit support

Posted by John McDonnell <mc...@gmail.com>.
This looks familiar...

This was around the area where I got stuck.  I had found
https://github.com/apache/incubator-netbeans/tree/master/java/java.j2seproject/src/org/netbeans/modules/java/j2seproject/resources
where theres a reference to j2seproject3:junit in the build-impl.xsl but
dont believe I made it too much further.

Regards

John

On Mon, 14 Jan 2019 at 15:23, Peter Hull <pe...@gmail.com> wrote:

> On Fri, Jan 11, 2019 at 9:38 AM Peter Hull <pe...@gmail.com> wrote:
> > If I can, I will try and manually get JUnit 5 tests working and make
> > list of what I had to add/change.
> I do need a bit more help on this (John McDonnell?)
> I added these files to netbeans/extide/ant/lib:
> * junit-platform-commons-1.3.1.jar
> * junit-platform-engine-1.3.1.jar
> * junit-platform-launcher-1.3.1.jar
>
> I made sure the library JUnit-5.3.1 was in the Test Libraries for my
> project
>
> And added this target to my project's build.xml file:
>     <target name="test-five" depends="compile-test,-pre-test-run">
>         <junitlauncher>
>             <classpath>
>                 <path path="${run.test.classpath}"/>
>             </classpath>
>             <testclasses>
>                 <fileset dir="${build.test.classes.dir}">
>                     <include name="**/*Test.class"/>
>                 </fileset>
>                 <listener type="legacy-brief" sendSysOut="true"/>
>                 <listener type="legacy-xml" sendSysErr="true"
> sendSysOut="true"/>
>             </testclasses>
>         </junitlauncher>
>     </target>
>
> Now running the target 'test-five' does run my tests (the framework
> for which was generated by NB) but there is no integration with the
> IDE.
> According to the docs, the "legacy-*" listeners produce output
> compatible with JUnit4 so if we could hook into these it should be OK.
> Looking at the existing test targets in the build.xml and
> build-impl.xml, I can't figure out how they work - it seems like NB
> provides some extra tasks to ant which are called things like
> j2seproject3:junit and j2seproject3:test-impl but I can't see where
> they come from.
>
> Any hints from those who know?
>
> Thanks
> Pete
>

Re: NetBeans 10 JUnit support

Posted by Peter Hull <pe...@gmail.com>.
On Fri, Jan 11, 2019 at 9:38 AM Peter Hull <pe...@gmail.com> wrote:
> If I can, I will try and manually get JUnit 5 tests working and make
> list of what I had to add/change.
I do need a bit more help on this (John McDonnell?)
I added these files to netbeans/extide/ant/lib:
* junit-platform-commons-1.3.1.jar
* junit-platform-engine-1.3.1.jar
* junit-platform-launcher-1.3.1.jar

I made sure the library JUnit-5.3.1 was in the Test Libraries for my project

And added this target to my project's build.xml file:
    <target name="test-five" depends="compile-test,-pre-test-run">
        <junitlauncher>
            <classpath>
                <path path="${run.test.classpath}"/>
            </classpath>
            <testclasses>
                <fileset dir="${build.test.classes.dir}">
                    <include name="**/*Test.class"/>
                </fileset>
                <listener type="legacy-brief" sendSysOut="true"/>
                <listener type="legacy-xml" sendSysErr="true"
sendSysOut="true"/>
            </testclasses>
        </junitlauncher>
    </target>

Now running the target 'test-five' does run my tests (the framework
for which was generated by NB) but there is no integration with the
IDE.
According to the docs, the "legacy-*" listeners produce output
compatible with JUnit4 so if we could hook into these it should be OK.
Looking at the existing test targets in the build.xml and
build-impl.xml, I can't figure out how they work - it seems like NB
provides some extra tasks to ant which are called things like
j2seproject3:junit and j2seproject3:test-impl but I can't see where
they come from.

Any hints from those who know?

Thanks
Pete

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

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


Re: NetBeans 10 JUnit support

Posted by Emilian Bold <em...@gmail.com>.
I think we should also ask ourselves if the IDE NetBeans must promote
JUnit 5 or not.

I don't see a big push from actual users for JUnit 5. And for most
users JUnit 4 is quite adequate (and I wonder how many are picking 5
because it's newer versus because they are actually missing something
in JUnit 4).

The IDE should promote unit testing, that's for sure. A given unit
testing library... some data would be nice.

--emi

https://coolbeans.xyz/ - CoolBeans: An IDE for Java, JavaEE, PHP and more!

On Fri, Jan 11, 2019 at 11:38 AM Peter Hull <pe...@gmail.com> wrote:
>
> On Thu, Jan 10, 2019 at 7:47 PM John McDonnell <mc...@gmail.com> wrote:
> > I think at a minimum it requires an upgrade to the bundled Ant version, and then some changes to some internal build.xml's (which I think is where I got lost previously)
> NetBean's version of ant is 1.10.4 and that does have the
> `junitlauncher` task, but NB does not include the optional
> ant-junitlauncher.jar library with it.
> So I think we will need that jar plus the platform and engine
> libraries (listed in
> https://ant.apache.org/manual/Tasks/junitlauncher.html) added to the
> JUnit-5.x.y library in NB, plus the build script changes as mentioned
> by others.
> Alternatively, using Junit 4 is much more straightforward. I couldn't
> tell from the JUnit website whether JUnit 5 is supposed to co-exist
> with 4, or whether 4 is now done and everyone should be moving on.
> If I can, I will try and manually get JUnit 5 tests working and make
> list of what I had to add/change.
> Pete
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: users-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>

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

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


Re: NetBeans 10 JUnit support

Posted by Peter Hull <pe...@gmail.com>.
On Fri, Jan 11, 2019 at 10:10 AM Tushar Joshi <tu...@gmail.com> wrote:
> I remember JUnit 3.8.1 being used for many years even when JUnit 4 was the standard.
> Project have reluctance for shifting an existing JUnit library for many reasons.
>
> Given that we should have both JUnit versions 4.11 as well as 5.x supported in
> an IDE.
Right. The JUnit 4 libraries are packaged with NetBeans so if you have
an existing project it will continue to work (or should!)
The question is whether someone creating a new project would want to
start with JUnit 4 (I can see they would, if they already have a load
of other projects and they want to be consistent)
Pete

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

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


Re: NetBeans 10 JUnit support

Posted by Tushar Joshi <tu...@gmail.com>.
>
> JUnit 5 is supposed to co-exist
> with 4, or whether 4 is now done and everyone should be moving on.
>

I remember JUnit 3.8.1 being used for many years even when JUnit 4 was the
standard.
Project have reluctance for shifting an existing JUnit library for many
reasons.

Given that we should have both JUnit versions 4.11 as well as 5.x supported
in
an IDE.

with regards
    Tushar

Tushar Joshi, Nagpur: http://www.tusharjoshi.com

* MCSD_NET C#, SCJP, RHCE, ZCE, PMP, CSM, SAFe, PRINCE2

* Senior Architect @ Persistent Systems http://www.persistent.com
* LinkedIn: http://www.linkedin.com/in/tusharvjoshi

Re: NetBeans 10 JUnit support

Posted by Peter Hull <pe...@gmail.com>.
On Thu, Jan 10, 2019 at 7:47 PM John McDonnell <mc...@gmail.com> wrote:
> I think at a minimum it requires an upgrade to the bundled Ant version, and then some changes to some internal build.xml's (which I think is where I got lost previously)
NetBean's version of ant is 1.10.4 and that does have the
`junitlauncher` task, but NB does not include the optional
ant-junitlauncher.jar library with it.
So I think we will need that jar plus the platform and engine
libraries (listed in
https://ant.apache.org/manual/Tasks/junitlauncher.html) added to the
JUnit-5.x.y library in NB, plus the build script changes as mentioned
by others.
Alternatively, using Junit 4 is much more straightforward. I couldn't
tell from the JUnit website whether JUnit 5 is supposed to co-exist
with 4, or whether 4 is now done and everyone should be moving on.
If I can, I will try and manually get JUnit 5 tests working and make
list of what I had to add/change.
Pete

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

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


Re: NetBeans 10 JUnit support

Posted by John McDonnell <mc...@gmail.com>.
I think at a minimum it requires an upgrade to the bundled Ant version, and
then some changes to some internal build.xml's (which I think is where I
got lost previously)

I can take another look next week (or maybe near the end of the month now
that I look at my calendar ), and kick it off in dev mailing list if I get
stuck or need to validate questions.

Regards

John

On Thu, 10 Jan 2019 at 15:01, Geertjan Wielenga <
geertjan.wielenga@googlemail.com> wrote:

> Could we take a look at this for Apache NetBeans 11? The simplest
> requirement is that the process of using JUnit 5 with Ant should be as
> simple as in 8.2 with JUnit 4. Several are reporting having problems with
> this and can’t all switch to Maven.
>
> Gj
>
> On Thu, 10 Jan 2019 at 15:52, John McDonnell <mc...@gmail.com>
> wrote:
>
>> Yep...
>>
>> We never got around to implementing JUnit 5 support for Ant based
>> projects in NB 10.
>>
>> Im not really an Ant user and did try to take a look a t what would be
>> required but never got to a final solution for it.
>>
>> Regards
>>
>> John
>>
>> On Thu 10 Jan 2019, 11:16 Geertjan Wielenga
>> <geertjan.wielenga@googlemail.com.invalid wrote:
>>
>>> Recommend you use Maven in NetBeans, which will cause the dependencies,
>>> including that one, to automatically be added.
>>>
>>> Gj
>>>
>>> On Thu, Jan 10, 2019 at 12:14 PM Geertjan Wielenga <
>>> geertjan.wielenga@googlemail.com> wrote:
>>>
>>>> Seems to be related to this:
>>>>
>>>> https://github.com/junit-team/junit5/issues/1104
>>>>
>>>> Gj
>>>>
>>>> On Thu, Jan 10, 2019 at 12:11 PM Geertjan Wielenga <
>>>> geertjan.wielenga@googlemail.com> wrote:
>>>>
>>>>> reason: class file for org.apiguardian.api.API$Status not found
>>>>>
>>>>> No idea what 'org.apiguarian.api.API' is.
>>>>>
>>>>> Gj
>>>>>
>>>>> On Thu, Jan 10, 2019 at 11:10 AM Peter Hull <pe...@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-unsubscribe@netbeans.apache.org
>>>>>> For additional commands, e-mail: users-help@netbeans.apache.org
>>>>>>
>>>>>> For further information about the NetBeans mailing lists, visit:
>>>>>> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>>>>>>
>>>>>>

Re: NetBeans 10 JUnit support

Posted by Geertjan Wielenga <ge...@googlemail.com.INVALID>.
Could we take a look at this for Apache NetBeans 11? The simplest
requirement is that the process of using JUnit 5 with Ant should be as
simple as in 8.2 with JUnit 4. Several are reporting having problems with
this and can’t all switch to Maven.

Gj

On Thu, 10 Jan 2019 at 15:52, John McDonnell <mc...@gmail.com>
wrote:

> Yep...
>
> We never got around to implementing JUnit 5 support for Ant based projects
> in NB 10.
>
> Im not really an Ant user and did try to take a look a t what would be
> required but never got to a final solution for it.
>
> Regards
>
> John
>
> On Thu 10 Jan 2019, 11:16 Geertjan Wielenga
> <geertjan.wielenga@googlemail.com.invalid wrote:
>
>> Recommend you use Maven in NetBeans, which will cause the dependencies,
>> including that one, to automatically be added.
>>
>> Gj
>>
>> On Thu, Jan 10, 2019 at 12:14 PM Geertjan Wielenga <
>> geertjan.wielenga@googlemail.com> wrote:
>>
>>> Seems to be related to this:
>>>
>>> https://github.com/junit-team/junit5/issues/1104
>>>
>>> Gj
>>>
>>> On Thu, Jan 10, 2019 at 12:11 PM Geertjan Wielenga <
>>> geertjan.wielenga@googlemail.com> wrote:
>>>
>>>> reason: class file for org.apiguardian.api.API$Status not found
>>>>
>>>> No idea what 'org.apiguarian.api.API' is.
>>>>
>>>> Gj
>>>>
>>>> On Thu, Jan 10, 2019 at 11:10 AM Peter Hull <pe...@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-unsubscribe@netbeans.apache.org
>>>>> For additional commands, e-mail: users-help@netbeans.apache.org
>>>>>
>>>>> For further information about the NetBeans mailing lists, visit:
>>>>> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>>>>>
>>>>>

Re: NetBeans 10 JUnit support

Posted by John McDonnell <mc...@gmail.com>.
Yep...

We never got around to implementing JUnit 5 support for Ant based projects
in NB 10.

Im not really an Ant user and did try to take a look a t what would be
required but never got to a final solution for it.

Regards

John

On Thu 10 Jan 2019, 11:16 Geertjan Wielenga
<geertjan.wielenga@googlemail.com.invalid wrote:

> Recommend you use Maven in NetBeans, which will cause the dependencies,
> including that one, to automatically be added.
>
> Gj
>
> On Thu, Jan 10, 2019 at 12:14 PM Geertjan Wielenga <
> geertjan.wielenga@googlemail.com> wrote:
>
>> Seems to be related to this:
>>
>> https://github.com/junit-team/junit5/issues/1104
>>
>> Gj
>>
>> On Thu, Jan 10, 2019 at 12:11 PM Geertjan Wielenga <
>> geertjan.wielenga@googlemail.com> wrote:
>>
>>> reason: class file for org.apiguardian.api.API$Status not found
>>>
>>> No idea what 'org.apiguarian.api.API' is.
>>>
>>> Gj
>>>
>>> On Thu, Jan 10, 2019 at 11:10 AM Peter Hull <pe...@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-unsubscribe@netbeans.apache.org
>>>> For additional commands, e-mail: users-help@netbeans.apache.org
>>>>
>>>> For further information about the NetBeans mailing lists, visit:
>>>> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>>>>
>>>>

Re: NetBeans 10 JUnit support

Posted by Geertjan Wielenga <ge...@googlemail.com.INVALID>.
Recommend you use Maven in NetBeans, which will cause the dependencies,
including that one, to automatically be added.

Gj

On Thu, Jan 10, 2019 at 12:14 PM Geertjan Wielenga <
geertjan.wielenga@googlemail.com> wrote:

> Seems to be related to this:
>
> https://github.com/junit-team/junit5/issues/1104
>
> Gj
>
> On Thu, Jan 10, 2019 at 12:11 PM Geertjan Wielenga <
> geertjan.wielenga@googlemail.com> wrote:
>
>> reason: class file for org.apiguardian.api.API$Status not found
>>
>> No idea what 'org.apiguarian.api.API' is.
>>
>> Gj
>>
>> On Thu, Jan 10, 2019 at 11:10 AM Peter Hull <pe...@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-unsubscribe@netbeans.apache.org
>>> For additional commands, e-mail: users-help@netbeans.apache.org
>>>
>>> For further information about the NetBeans mailing lists, visit:
>>> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>>>
>>>

Re: NetBeans 10 JUnit support

Posted by Geertjan Wielenga <ge...@googlemail.com.INVALID>.
Seems to be related to this:

https://github.com/junit-team/junit5/issues/1104

Gj

On Thu, Jan 10, 2019 at 12:11 PM Geertjan Wielenga <
geertjan.wielenga@googlemail.com> wrote:

> reason: class file for org.apiguardian.api.API$Status not found
>
> No idea what 'org.apiguarian.api.API' is.
>
> Gj
>
> On Thu, Jan 10, 2019 at 11:10 AM Peter Hull <pe...@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-unsubscribe@netbeans.apache.org
>> For additional commands, e-mail: users-help@netbeans.apache.org
>>
>> For further information about the NetBeans mailing lists, visit:
>> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>>
>>

Re: NetBeans 10 JUnit support

Posted by Geertjan Wielenga <ge...@googlemail.com.INVALID>.
reason: class file for org.apiguardian.api.API$Status not found

No idea what 'org.apiguarian.api.API' is.

Gj

On Thu, Jan 10, 2019 at 11:10 AM Peter Hull <pe...@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-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: users-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>

Re: NetBeans 10 JUnit support

Posted by Pieter van den Hombergh <pi...@gmail.com>.
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 <peterhull90@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-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: users-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>