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 122560 - Test First could use a little more "hints"
Summary: Test First could use a little more "hints"
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-22 00:03 UTC by rlhicks
Modified: 2013-09-02 14:20 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 rlhicks 2007-11-22 00:03:14 UTC
I have created a simple test:

public void testBook() {
        Book b1 = new Book();
        assertEquals("Great Expectation", b1.title);
        assertEquals("unknown author", b1.author);
}

The IDE tells me that Book, b1.title and b1.author do not exist. That 
 is what I would expect. When I use the quick fix feature on Book, it 
creates a Book.java file in the "Test Packages" hierarchy when it 
should really create it in the "Source Packages" hierarchy.

> I am not sure this is always the required behaviour. Maybe it should ask 
> you where to put the new class to.
 
Now I have to deal with b1.title and b1.author as the IDE (correctly) 
says those methods don't exists in the Book class. When I do alt+ins 
and choose to create the method it creates it in the test file when it 
should create the method in the Book class in the Book.java file in 
the "Source Packages" hierarchy.

> This looks like a bug. Please file a bug report to IssueZilla

So I am...
Comment 1 Jan Lahoda 2007-12-06 09:38:32 UTC
Two separate issues here:
1. creating Book class in test folder rather than in sources folder - this sounds more like an enhancement to me.
2. re b1.title and b1.author: what you actually want to do is to create fields in Book class names title and author, not
methods. Unfortunately, the Create Element hint in 6.0 does not work in such cases - it is covered by issue #71951. The
Alt-Insert (Generate Code) is not meant to fix such errors, it always generates code into the current code.
Comment 2 rlhicks 2007-12-08 14:48:27 UTC
So can this be turned into an enhancement issue then? It would be nice if hints were able to do what I described. eclipse does it and I want Netbeans to be 
better than eclipse!  : )