This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 253178 - Options when creating JUnit/TestNG tests are ignored
Summary: Options when creating JUnit/TestNG tests are ignored
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: JUnit (show other bugs)
Version: 8.1
Hardware: PC Linux
: P2 normal (vote)
Assignee: Theofanis Oikonomou
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-25 10:23 UTC by Jiri Kovalsky
Modified: 2015-07-17 11:18 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Video showing how Unit Testing options are ignored. (2.81 MB, video/ogg)
2015-07-14 13:33 UTC, Jiri Kovalsky
Details
Video showing how Unit Testing options are NOT ignored. (5.21 MB, video/ogg)
2015-07-14 14:21 UTC, Theofanis Oikonomou
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Kovalsky 2015-06-25 10:23:06 UTC
Product Version: NetBeans IDE Dev (Build 201506250001)
Java: 1.8.0_45; Java HotSpot(TM) 64-Bit Server VM 25.45-b02
Runtime: Java(TM) SE Runtime Environment 1.8.0_45-b14
System: Linux version 3.13.0-37-generic running on amd64; UTF-8; cs_CZ (nb)
User directory: /home/cesilko/.netbeans/dev
Cache directory: /home/cesilko/.cache/netbeans/dev

Description:
============
When generating tests it is not possible to influence which methods should be considered, whether javadoc or comments should be created etc. All checkboxes in "Create Tests" dialog are ignored.

Steps to reproduce:
===================
1. Invoke "File > New Project..." from main menu.
2. Select "Java" category and "Java Application" project type.
3. Click "Next >" and then "Finish" buttons.
4. Right click "Source Packages" node and invoke "Tools > Create/Update Tests" from popup menu.
5. In "Create Tests" dialog uncheck "Public" method access level option and push "OK" button.

Expected: "JavaApplicationTest.java" file is created which does not contain "public void testMain()" method and contains "public void testSomeMethod()" method.
Actual: "JavaApplicationTest.java" file is created which contains "public void testMain()" method and does not contain "public void testSomeMethod()" method.
Comment 1 Theofanis Oikonomou 2015-07-08 15:03:58 UTC
Changeset: 55e20119fb1f
Author:    Theofanis Oikonomou <theofanis@netbeans.org>
Date:      2015-07-08 18:02
Message:
Comment 2 Theofanis Oikonomou 2015-07-08 15:05:54 UTC
it seems that settings were not stored after user pressed OK button when creating tests. It works now for me. Please try a latest build and reopen if it still fails for you. Thanks
Comment 3 Jiri Kovalsky 2015-07-13 11:05:24 UTC
Product Version: NetBeans IDE Dev (Build 201507130001)
Java: 1.8.0_45; Java HotSpot(TM) 64-Bit Server VM 25.45-b02
Runtime: Java(TM) SE Runtime Environment 1.8.0_45-b14
System: Linux version 3.13.0-37-generic running on amd64; UTF-8; cs_CZ (nb)

I am sorry Fanis but I see no difference in the functionality. I unchecked all options but it had no effect on the generated file. Reopening.
Comment 4 Theofanis Oikonomou 2015-07-13 14:10:31 UTC
(In reply to Jiri Kovalsky from comment #3)
> Product Version: NetBeans IDE Dev (Build 201507130001)
> Java: 1.8.0_45; Java HotSpot(TM) 64-Bit Server VM 25.45-b02
> Runtime: Java(TM) SE Runtime Environment 1.8.0_45-b14
> System: Linux version 3.13.0-37-generic running on amd64; UTF-8; cs_CZ (nb)
> 
> I am sorry Fanis but I see no difference in the functionality. I unchecked
> all options but it had no effect on the generated file. Reopening.

Product Version: NetBeans IDE Dev (Build 20150713-09ab6518da77)
Java: 1.7.0_80; Java HotSpot(TM) 64-Bit Server VM 24.80-b11
Runtime: Java(TM) SE Runtime Environment 1.7.0_80-b15
System: Linux version 3.16.0-43-generic running on amd64; UTF-8; en_US (nb)

I am following your steps from comment 1 and I am getting the Expected behavior, no "public void testMain()" method but "public void testSomeMethod()". Played also with other parameters like setup and setupclass and all worked as expected. Could you double check the steps? Thank you
Comment 5 Jiri Kovalsky 2015-07-14 13:33:54 UTC
Created attachment 154614 [details]
Video showing how Unit Testing options are ignored.
Comment 6 Theofanis Oikonomou 2015-07-14 14:21:36 UTC
Created attachment 154618 [details]
Video showing how Unit Testing options are NOT ignored.

the two attached videos show completely different behaviour. I am not sure why this is happening but I could reproduce before the fix and cannot reproduce after the fix as my video shows :)
Comment 7 Jiri Kovalsky 2015-07-14 15:26:52 UTC
And don't you have there some uncommitted changes? Could you please test it in http://bits.netbeans.org/download/trunk/nightly/2015-07-14_00-01-56/zip/netbeans-trunk-nightly-201507140001-javase.zip?
Comment 8 Theofanis Oikonomou 2015-07-15 07:47:54 UTC
(In reply to Jiri Kovalsky from comment #7)
> And don't you have there some uncommitted changes? Could you please test it
> in
> http://bits.netbeans.org/download/trunk/nightly/2015-07-14_00-01-56/zip/
> netbeans-trunk-nightly-201507140001-javase.zip?

fix was pushed in core-main http://hg.netbeans.org/core-main/rev/55e20119fb1f but AFAICT not propagated yet to main-silver due to failures in NB-Core-Build. So, it won't be in zip, right? Closing it again. Jirko, please verify in core-main or wait for the propagation
Comment 9 Quality Engineering 2015-07-17 01:17:59 UTC
Integrated into 'main-silver', will be available in build *201507170001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/55e20119fb1f
User: Theofanis Oikonomou <theofanis@netbeans.org>
Log: Task #253178 - Options when creating JUnit/TestNG tests are ignored
Comment 10 Jiri Kovalsky 2015-07-17 11:18:13 UTC
Product Version: NetBeans IDE Dev (Build 201507170001)
Java: 1.8.0_51; Java HotSpot(TM) 64-Bit Server VM 25.51-b03
Runtime: Java(TM) SE Runtime Environment 1.8.0_51-b16
System: Linux version 3.13.0-37-generic running on amd64; UTF-8; cs_CZ (nb)

Verified in today's trunk build at last. :)