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 52083 - JUnit checks class attributes even if just a single class is selected
Summary: JUnit checks class attributes even if just a single class is selected
Status: CLOSED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: JUnit (show other bugs)
Version: 4.x
Hardware: All All
: P3 blocker with 1 vote (vote)
Assignee: Ondrej Rypacek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-05 23:47 UTC by ulfzibis
Modified: 2006-03-24 12:48 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 ulfzibis 2004-12-05 23:47:42 UTC
Context Menu  Tools->JUnit Tests->Create Tests.

Trying to create JUnit Tests on an existing class
fails with "Class ... was skipped." if this class
ist not public.
Comment 1 Marian Petras 2004-12-06 14:11:03 UTC
Reproduced on Linux, too. Accepted.
Comment 2 Marian Petras 2004-12-07 13:17:51 UTC
I think the core problem here is that JUnit checks class attributes
even if just a single class is selected (and test class to be created
for). If the class is package-private and package-private classes are
skipped (see issue #52153 - "Do not skip package-private classes by
default"), JUnit skips the only (selected) class, which is the bug
that will be discussed here.

The remaining problem is the confusing message which is to be solved
separately (see bug #51972 - "No reasonable message when test
generation is skipped").
Comment 3 ulfzibis 2004-12-07 14:49:10 UTC
Work around: Set the desired class temporarily to public (not
possible, if you don't have the java source). Then create the JUnit
Tests. Set the class back to package-private. Begin testing, and all
works fine...
Comment 4 Marian Petras 2005-01-18 07:34:49 UTC
Fixed in the trunk.

Modified files:

    junit/src/org/netbeans/modules/junit/:
            CreateTestAction.java   (1.43)
            JUnitCfgOfCreate.java   (1.32)
    junit/src/org/netbeans/modules/junit/wizards/:
            SimpleTestCaseWizardIterator.java   (1.11)
Comment 5 Ondrej Rypacek 2005-02-18 13:37:14 UTC
Probably as a result of this fix, test creation now ignores the
"Package Private Classes" checkbox and creates tests for package
private classes always, even if the action is invoked on a whole
package and the checkbox is unchecked. 

Comment 6 Ondrej Rypacek 2005-02-18 14:24:54 UTC
Fixed.

Checked in:
junit/src/org/netbeans/modules/junit/TestCreator.java, rev 1.40
Comment 7 Max Sauer 2006-03-24 12:48:32 UTC
This is not reproducible both inside nb 5.0fcs and nb6.0 dev 200603141900.
(FIXED && TM==4.1) => CLOSED