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 50595 - No test methods are generated
Summary: No test methods are generated
Status: CLOSED DUPLICATE of bug 50591
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 4.x
Hardware: All All
: P1 blocker (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-19 10:09 UTC by Jiri Skrivanek
Modified: 2007-09-26 09:14 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Skrivanek 2004-10-19 10:09:24 UTC
From build 20041018-1530 test methods are not
generated after action "Create Tests". Commit log
says there were changes in templates, so this is
probably cause of problem.
It also breaks the commit validation suite.
To reproduce:

- create a java project
- create a java class with public, protected,
default and private methods
- generate test by action "Tools|JUnit
Tests|Create Tests"
- only testMain method is generated but not tests
for other methods.

Build 20041018-2324, JDK1.5.0, WindowsXP.
Comment 1 Marian Petras 2004-10-19 10:26:39 UTC
Fixed - I rollbacked the change which caused this bug.
Comment 2 Ondrej Rypacek 2004-10-19 11:51:19 UTC
The bug was not caused by the last commit to JUnit. It is probably
outside the module.
a) I tried it before I commited, including commit-validation tests and
it worked. 
b) I just checked-out all other sources, thus, with the changes to
templates still in, tried it out and it didn't work.

I'm reopening it. I'll investigate the real cause and reassign to the
responsible module.
Comment 3 Ondrej Rypacek 2004-10-19 13:05:17 UTC
The bug is in java-jmi. The problem is that the class doesn't appear
to contain the methods (obtained through JavaClass.getFeatures) until
after IDE restart. 

After restart, it works fine - the methods are there. 
It is not enough to explicitly save the file. It is not enough to
close and reopen the project, the ide must be restarted. 
Comment 4 Jiri Skrivanek 2004-10-19 13:12:44 UTC
Maybe issue 50590 is also related.
Comment 5 Ondrej Rypacek 2004-10-19 13:18:57 UTC
Good point! It looks very much like it. In issue 50590, Hanz says:

> Looks like problem is caused by src hierarchy.
> The piece of code
[snip]
> returns SourceElement in place of MethodElement!

In JUnit, I filter all features returned by JavaClass.getFeatures and
only MethodElement instances are processed further. 
Comment 6 Martin Matula 2004-10-19 14:42:57 UTC
Fixed.

*** This issue has been marked as a duplicate of 50591 ***
Comment 7 Jiri Skrivanek 2004-10-20 08:09:39 UTC
Verified in build 20041019-2335.