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 191746 - [70cat] Notify that JUnit test class already exists instead of silently accepting
Summary: [70cat] Notify that JUnit test class already exists instead of silently accep...
Status: RESOLVED DUPLICATE of bug 191372
Alias: None
Product: java
Classification: Unclassified
Component: JUnit (show other bugs)
Version: 7.0
Hardware: PC Linux
: P3 normal (vote)
Assignee: Theofanis Oikonomou
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-09 00:01 UTC by quanghung.b
Modified: 2013-09-04 15:19 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description quanghung.b 2010-11-09 00:01:44 UTC
[ BUILD # : 201011070000 ]
[ JDK VERSION : 1.6.14 ]

1. Follow the instructions in TS 68 JUnit
(http://wiki.netbeans.org/TS_68_JUnit) to create a JUnit test class for a java
class. 
2. Modify the generated JUnit test class.
3. Select the Java class and create the JUnit test class again (assume that you
are not concentrated and do it by mistake)
4. When clicking on "OK" button of the "Create Test" window, it could show an
alert to notify that the JUnit test class already exists instead of silently
accepting. 

FYI : the first generated and modified JUnit test class (at step 2) is not
altered after step 4. This is a good thing.
Comment 1 quanghung.b 2010-11-21 19:27:32 UTC
By running the same test under NB Beta 1, I got the following behavior 

1. Right-click on Methods.java (for instance) and choose Tools->Create JUnit Tests
2. UNCHECK "Default Method Bodies" then OK to generate the test class ==> the generated test class is correctly generated (and the methods have no default body)

3. Without modifying the  previously generated test class, create the test class again for Methods.java. This time CHECK "Default Method Bodies" then OK ==> the generated file seems not to be modified and there are still NO default method bodies.
Comment 2 Theofanis Oikonomou 2013-09-04 15:19:37 UTC
@comment 1: This should be better communicated to the user. Probably a combination of both requests. Modifying the menu text AND add some info in the test creation dialog. Thus marking this as dublicate.

@comment 2: This is expected behavior. The wizard will not touch test methods that already exist in the test class. There is no way to determine if htey were modified since their creation or not. It will only add test methods for any new method in the tested class file.

Thank you for reporting

*** This bug has been marked as a duplicate of bug 191372 ***