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 227316

Summary: JUnit test skeletons - New instance generation
Product: java Reporter: theshadow27 <theshadow27>
Component: JUnitAssignee: Theofanis Oikonomou <theofanis>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 7.3   
Hardware: PC   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:
Bug Depends on:    
Bug Blocks: 79352    

Description theshadow27 2013-03-11 20:10:05 UTC
per Bug 79352 :
Please describe/specify the skeletons you want to be generated:


Current: IDE guesses at how to create the instance variable. If there is no public constructor, it sets it to null, otherwise, it guesses at constructor arguments

Example:
        MyObject instance = new MyObject(); 

Enhancement: Allow user to specify how object is created. 

Examples:
        MyObject instance = getInstance();

        MyObject instance = getInstance(${testName});

        Mockery mockery = new Junit4Mockery(); // Template per Bug 227315
        MyObject instance = mockery.mock(MyObject.class);
        ... etc... 

Implementation suggestion: This can be addressed in the template: 

        ${SimpleName} instance = getInstance(); 
        
        ${SimpleName} instance = new ${SimpleName}(${GuessConstructorArguments});