Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 171057 - Maven project cannot handle junit test suites
Maven project cannot handle junit test suites
Status: RESOLVED WORKSFORME
Product: projects
Classification: Unclassified
Component: Maven
6.x
All All
: P3 (vote)
: 6.x
Assigned To: Milos Kleint
issues@platform
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-08-28 09:49 UTC by pribyl
Modified: 2009-08-28 12:07 UTC (History)
0 users

See Also:
Issue Type: DEFECT
:


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


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo