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 121540 - [67cat] Add checkboxes for @Before(After)Class methods
Summary: [67cat] Add checkboxes for @Before(After)Class methods
Status: RESOLVED WORKSFORME
Alias: None
Product: java
Classification: Unclassified
Component: JUnit (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker with 1 vote (vote)
Assignee: Theofanis Oikonomou
URL:
Keywords:
: 161025 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-11-09 08:50 UTC by Jiri Vagner
Modified: 2013-09-04 15:06 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
class-setup-and-teardown.jpg (45.61 KB, image/jpeg)
2007-11-09 09:01 UTC, Jiri Vagner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Vagner 2007-11-09 08:50:41 UTC
Maybe there should be settings for jUnit4 "setUp" and "tearDown" class methods, for classees with @Before(After)Class
annotation. See the screenshot. Something like two new checkboxes "Class Test Initialize" and "Class Test Finalizer"?
Now every generated test with disabled initializer and finalizer checkboxes contains empty class setUp and class
tearDown methods.
Comment 1 Jiri Vagner 2007-11-09 09:01:32 UTC
Created attachment 52779 [details]
class-setup-and-teardown.jpg
Comment 2 fommil 2008-09-05 11:13:01 UTC
Please consider adding this support to 6.5... the needless creation of 2 static methods every time I create a new JUnit case is driving me mad.
Comment 3 Alexei Mokeev 2009-03-27 11:08:07 UTC
*** Issue 161025 has been marked as a duplicate of this issue. ***
Comment 4 fommil 2009-09-08 17:20:13 UTC
Is there a workaround for this? i.e. Is there some way to set the 'classSetUp' and 'classTearDown' variables 'false' by default? Going to "New" -> "JUnit Test" 
still gives me the boilerplate for

	@BeforeClass
	public static void setUpClass() throws Exception {
	}

	@AfterClass
	public static void tearDownClass() throws Exception {
	}

plus the imports

import org.junit.AfterClass;
import org.junit.BeforeClass;
Comment 5 Theofanis Oikonomou 2013-09-04 15:06:56 UTC
The two checkboxes are present in latest builds. Please try one. Closing this one. Thank you for reporting