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 - JUnit test skeletons - New instance generation
Summary: JUnit test skeletons - New instance generation
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: JUnit (show other bugs)
Version: 7.3
Hardware: PC All
: P3 normal (vote)
Assignee: Theofanis Oikonomou
URL:
Keywords:
Depends on:
Blocks: 79352
  Show dependency tree
 
Reported: 2013-03-11 20:10 UTC by theshadow27
Modified: 2013-03-11 20:10 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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});