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 147793 - Unit Test Runner does not include package name of the class
Summary: Unit Test Runner does not include package name of the class
Status: RESOLVED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-20 20:35 UTC by cyrill
Modified: 2011-03-17 09:52 UTC (History)
1 user (show)

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 cyrill 2008-09-20 20:35:15 UTC
By running a unit test (clicking with the right mouse button on the class in the project tree) the executed maven command is missing the package 
information:

-Dtest=DependencyHandlerTest instead of -DTest=com.mycompany.web.tests.DependencyHandlerTest

The current behaviour is, that all classes with the same name are executed instead of only the one in the package you have selected.
Comment 1 Milos Kleint 2008-09-22 09:55:33 UTC
it should be possible to overload on individual project level, by using <test>${packageClassName}</test> instead of    
<test>${className}</test>. 

I'm not sure I want to do it globally right now, it seems the packaged version will only work with surefire plugin
version 2.4+, older versions might not work (2.4 released in Jan 2008)

Something to do in netbeans.next (not for 6.5)
Comment 2 Jesse Glick 2010-07-28 15:15:39 UTC
Reproducible and seems like it ought to be fixed. If a pre-2.4 version of surefire is still listed as an explicit dep of the project, perhaps there can be a warning somewhere. In Maven 2.1.x, 2.4.3 is the managed version of surefire in the superpom; 2.0.x doesn't seem to mention surefire in the superpom so I guess it just uses the latest one?
Comment 3 Jesse Glick 2011-03-16 16:52:29 UTC
core-main #07afd02eb328
Comment 4 Quality Engineering 2011-03-17 09:52:05 UTC
Integrated into 'main-golden', will be available in build *201103170400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/07afd02eb328
User: Jesse Glick <jglick@netbeans.org>
Log: #147793: Unit Test Runner does not include package name of the class
Surefire 2.4 has long been released and should be default for new projects.
Any old projects using 2.3 or earlier can simply adjust the action mapping (anyway only affects projects not using CoS for tests).
Otherwise would need to introduce a new token which expanded to either className or packageClassName
based on PluginPropertyUtils.getPluginVersion(..., GROUP_APACHE_PLUGINS, PLUGIN_SUREFIRE) and ComparableVersion, which seems overkill.