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 139069 - Ability to edit default method body for JUnit tests
Summary: Ability to edit default method body for JUnit tests
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: JUnit (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Theofanis Oikonomou
URL: http://www.nabble.com/JUnit-4-is-ther...
Keywords: UI
Depends on:
Blocks:
 
Reported: 2008-07-04 22:15 UTC by fommil
Modified: 2011-11-04 12:08 UTC (History)
0 users

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 fommil 2008-07-04 22:15:29 UTC
At this time it is not possible to edit the default text that is entered as part of a method body in an automatically generated JUnit 4 @Test. It would be 
incredibly useful to be able to customise this. Also, it would be very helpful if the JUnit generator provided options to create the @BeforeClass and 
@AfterClass methods... I do not tend to use them and it is irritating to have to delete them after creating each test unit.
Comment 1 Peter Pis 2008-07-06 13:07:10 UTC
Reassigning to "junit".
Comment 2 Marian Petras 2008-07-07 11:06:11 UTC
This might be possible with the FreeMarker template system.

I will not have time to make it to NB 6.5. Because no real milestones for post-6.5 releases are present yet and because
there is no plan for post-6.5 release, I set the target milestone to "future".
Comment 3 Marian Petras 2008-07-07 11:07:32 UTC
The problem with creating the @BeforeClass and @AfterClass is also tracked as issue #121540.
Comment 4 Alexei Mokeev 2009-03-27 08:14:43 UTC
The question is where to show an editor for default test method body. 
Should it be "Create Tests" dialog (every time)
or some Options (once for every project)
Comment 5 fommil 2009-05-17 13:06:04 UTC
The reason why I want to be able to edit the default body is because it tries to be too smart by creating some fake test. This is silly and useless IMHO. It'd be 
much more helpful if the default body were something simple like

 fail("test not written");
Comment 6 fommil 2009-09-08 17:21:40 UTC
Please somebody in junit consider looking at this!