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 171057 - Maven project cannot handle junit test suites
Summary: Maven project cannot handle junit test suites
Status: RESOLVED WORKSFORME
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Milos Kleint
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-28 09:49 UTC by pribyl
Modified: 2009-08-28 12:07 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Test results (29.98 KB, image/png)
2009-08-28 09:49 UTC, pribyl
Details

Note You need to log in before you can comment on or make changes to this bug.
Description pribyl 2009-08-28 09:49:26 UTC
Product Version: NetBeans IDE Dev (Build 200908270201)
Java: 1.6.0_15; Java HotSpot(TM) Client VM 14.1-b02
System: Windows XP version 5.1 running on x86; Cp1250; cs_CZ (nb)

I have a package with some java classes in Maven project (Quickstart Archtype).
I created junit tests for the whole package (invoked 'Tools > Create JUnit Tests' on the package node). Test suite was
also generated (it is checked by default in the "Create Tests" dialog).

Now there are two problems:
1, The test suite cannot be run as the 'Run File' is disabled for all test files
2, If I test the whole project (invoke 'Test' on the project's root node or press Alt+F6), it does not ignore the suite
(like in case of simple J2SE project) and mixes up the test methods from individual test files and the suite.
The result of it is quite confusing, the Results window shows ... well, nonsenses :)   [see attached screen]
Comment 1 pribyl 2009-08-28 09:49:53 UTC
Created attachment 86773 [details]
Test results
Comment 2 Milos Kleint 2009-08-28 11:20:12 UTC
1. not a bug. Since 6.7 running tests is done via "Test file" not "run file". Test file works on suites.

2. doesn't sound like a bug to me either. The "Test" execution is done via Maven's surefire plugin. I assume you need to
configure it what to run, otherwise it runs everything, including suites.
see http://maven.apache.org/plugins/maven-surefire-plugin (currently down for me)

please reopen if I have missed something obvious in 2.
Comment 3 pribyl 2009-08-28 12:07:21 UTC
ad1- Yes, I agree. I realized that 'Test File' works, but too late :) This is OK
ad2- I see. I was just used to test Java applications (not using Maven), where the suite file was automatically ignored
during testing of the whole project. So I was not expecting that I have to modify something manually. And the result
really surprised me :) 
But OK, I agree this is not a bug either. Thanks for explaining