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 71862 - Include super.setUp() and super.tearDown() calls in generated code
Summary: Include super.setUp() and super.tearDown() calls in generated code
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: JUnit (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: Marian Petras
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-25 16:10 UTC by ats37
Modified: 2007-01-08 00:04 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ats37 2006-01-25 16:10:55 UTC
When generating a JUnit test case from a class and selectecting to include
generated setup and teardown methods, it would be useful if the template
included calls to the super methods.  I just wasted the best part of a day
figuring out that the reason my Cocoon components' test cases (which I'd changed
to extend org.apache.cocoon.SitemapComponentTestCase rather than
junit.framework.TestCase) were failing was not because my .xtest configuration
file was wrong, but because SitemapComponentTestCase sets up the component
manager in its setUp() method and my own test's setUp was never calling it...
Even when extending TestCase directly there's no harm in calling the super
methods, and it helps protect against stupidity ;-)
Comment 1 Marian Petras 2006-07-10 08:33:01 UTC
Accepted.
Comment 2 Marian Petras 2007-01-08 00:04:17 UTC
Fixed in the trunk, together with bug #89820.

Added and modified files:
   ide/golden/deps.txt   (1.416)
   junit/manifest.mf   (1.47)
   junit/nbproject/project.properties   (1.12)
   junit/nbproject/project.xml   (1.22)
   junit/src/org/netbeans/modules/junit/:
                                    Bundle.properties   (1.78)
                                    ClassMap.java   (1.1 - new)
                                    CreateTestAction.java   (1.55)
                                    DefaultPlugin.java   (1.8)
                                    GoToOppositeAction.java   (1.11)
                                    GuiUtils.java   (1.6)
                                    JUnitCfgOfCreate.java   (1.40)
                                    JUnitSettingsBeanInfo.java   (1.22)
                                    JUnitSettings.java   (1.24)
                                    OpenTestAction.java   (1.26)
                                    TestabilityJudge.java   (1.1 - new)
                                    TestabilityResult.java   (1.1 - new)
                                    TestAction.java   (1.5)
                                    TestCreator.java   (1.63)
                                    TestUtil.java   (1.37)
                                    TopClassFinder.java   (1.1 - new)
   junit/src/org/netbeans/modules/junit/plugin/:
                                    JUnitPlugin.java   (1.5)
   junit/src/org/netbeans/modules/junit/resources/:
                                    layer.xml   (1.46)
   junit/src/org/netbeans/modules/junit/resources/templates/:
                                    EmptyJUnitTest.java.template   (1.1 - new)
                                    TestSuite.java.template   (1.1 - new)
   junit/src/org/netbeans/modules/junit/wizards/:
                                    EmptyTestCaseWizardIterator.java   (1.17)
                                    SimpleTestCaseWizardIterator.java   (1.20)
                                    SimpleTestStepLocation.java   (1.21)
                                    TestSuiteWizardIterator.java   (1.14)
                                    Utils.java   (1.21)

(See issue #89820 for the links to CVS diffs.)