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 170621

Summary: Create test ignores "Class Types"
Product: java Reporter: pribyl <pribyl>
Component: JUnitAssignee: Victor Vasilyev <vvg>
Status: RESOLVED FIXED    
Severity: blocker    
Priority: P3    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on: 165914    
Bug Blocks:    

Description pribyl 2009-08-19 13:50:20 UTC
Product Version: NetBeans IDE Dev (Build 200908171401)
Java: 1.6.0_15; Java HotSpot(TM) Client VM 14.1-b02
System: Windows XP version 5.1 running on x86; Cp1250; cs_CZ (nb)

I have a Java project with four classes in a package: public class, package private class, abstract class and Exception
class.
When I select the containing package and invoke Tools - Create JUnit test, no matter which options I check under the
"Class Types" I still get four tests generated. One for each class.

Maybe I just get it wrong. According to Help you should be able to select which class types to generate test classes
for. However it does not seem to work.
Comment 1 Victor Vasilyev 2009-11-11 17:38:03 UTC
It is valid issue.
All options "Code Generation / Class Types" in the "Create Tests" dialog do not work.
Comment 2 Victor Vasilyev 2010-04-14 14:22:28 UTC
It is regression after http://hg.netbeans.org/main/rev/1c5ab8f7d046

The statement 
http://hg.netbeans.org/main/file/1c5ab8f7d046/junit/src/org/netbeans/modules/junit/TestGeneratorSetup.java#l717
sets to zero all bits in the variable "result" excluding a bit returned by the method TestabilityResult.NO_TESTEABLE_METHODS.getReasonValue(), i.e 0x2.
Hence, all classes are testable if they have testable methods, and it doesn't depend on states of the checkboxes in the "Class Types" group of the "Create Tests" dialog.
Comment 3 Victor Vasilyev 2010-04-15 11:54:13 UTC
This bug a relation to the Bug 165914
Comment 4 Victor Vasilyev 2010-04-15 12:33:59 UTC
Fixed
http://hg.netbeans.org/main/rev/6ed2919e6def

See also bug 165914