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 227315 - JUnit test skeletons - Method Declaration Generation
Summary: JUnit test skeletons - Method Declaration 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:03 UTC by theshadow27
Modified: 2013-03-11 20:03 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:03:23 UTC
per Bug 79352 :
Please describe/specify the skeletons you want to be generated:

JUnit support should allow customized method declaration generation. 

Current: all tests begin with:
    @Test
    public void testGetCode() {
        System.out.println("getCode");
        ...}

Enhancement: Allow custom method declaration generation. For example, it is cleaner/easier to use a
    @Rule
    public TestName testName = new TestName();

    @Before
    public void printName() {
        System.out.println(testName.getMethodName());
        ...}

    @Test
    public void testGetCode() {
        // name of test printed automatically during printName() so this line is not generated
        ...}


and this behavior should be configurable by the user. This could be done with a template. Example, the current one might look like:
   @Test
   public void test${MethodUnderTestName}(){
        System.out.println("${MethodUnderTestName}");
        ... 
   }