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 124648 - Generate simple implementation of abstract classes in tests
Summary: Generate simple implementation of abstract classes in tests
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: JUnit (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Marian Petras
URL:
Keywords: REGRESSION
Depends on:
Blocks:
 
Reported: 2008-01-03 16:01 UTC by Marian Petras
Modified: 2009-02-19 21:20 UTC (History)
1 user (show)

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 Marian Petras 2008-01-03 16:01:31 UTC
If a source file contains abstract classes, generated test cannot test them without providing simple implementations of
these abstract classes. Apparently, this ability used to be available but was removed during transition to the new Java
infrastructure (i.e. NB 6.0 M5 and later).
Comment 1 Marian Petras 2008-01-03 16:04:28 UTC
Ability to generate subclasses of abstract classes was last available in revision 1.61 of class
org.netbeans.modules.junit.TestCreator.
Comment 2 Marian Petras 2008-10-31 17:10:22 UTC
Fixed.

Changeset Id:
9088a9fcc2c7
(http://hg.netbeans.org/main/rev/9088a9fcc2c7)
Comment 3 Quality Engineering 2008-11-01 05:14:11 UTC
Integrated into 'main-golden', will be available in build *200811010201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/9088a9fcc2c7
User: Marian Petras <mpetras@netbeans.org>
Log: fixed bug #124648 - "Generate simple implementation of abstract classes in tests"
Comment 4 Marian Petras 2008-11-03 02:14:15 UTC
I have found a small issue with the fix: If the test class already contains multiple nested classes extending the
abstract source class (to be tested), the default test method bodies always use instances of the first such a nested
class, ignoring its name and names of the other nested class. I will change it such that if any of the nested classes is
named <src-class-name>Impl, that one will be used.
Comment 5 Quality Engineering 2008-11-04 16:24:58 UTC
Integrated into 'main-golden', will be available in build *200811041401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/48ba7223ea4c
User: Marian Petras <mpetras@netbeans.org>
Log: improved fix of bug #124648 - if possible, choose the nested class having the default name