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 213781 - [72cat] Inconsistency between executing Test Suites in Java SE and Maven projects
Summary: [72cat] Inconsistency between executing Test Suites in Java SE and Maven proj...
Status: RESOLVED WONTFIX
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 7.2
Hardware: PC Windows 7 x64
: P4 normal (vote)
Assignee: Milos Kleint
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-07 21:30 UTC by crazyjavahacking
Modified: 2012-06-11 12:08 UTC (History)
3 users (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 crazyjavahacking 2012-06-07 21:30:15 UTC
It is weird, that exactly the same code will be tested and executed differently for Java SE and Maven Java SE project.

If you will generate tests according to http://wiki.netbeans.org/TS_72_UnitTesting#Test_suite:_Different_project_types, the test suite will not be executed as part of Java SE application, but will be executed as Maven Java SE application.

Is there any good reason to do so?


NetBeans Dev 201206070001, JDK 7u2 32bit
Comment 1 Theofanis Oikonomou 2012-06-08 13:26:12 UTC
I am not sure what you mean. Could you please describe the steps you followed in order to reproduce the issue? Thank you
Comment 2 crazyjavahacking 2012-06-08 14:14:40 UTC
Sorry for not be clear enough.

To reproduce:
1.) Open JUnitSampleProject and create tests for "teststorun" package
2.) Test the Ant Java SE project (ALT + F6)
=> the result will be 9 tests failed and 1 error

3.) Create empty Maven project and copy the content of "teststorun" package into source packages
4.) Create tests for that package
5.) Test the Maven Java SE project (ALT + F6)
=> the result woll be 18 tests failed and 2 errors

this is because Maven project will execute also the test suite file and the Ant project will not
Comment 3 Theofanis Oikonomou 2012-06-08 15:28:03 UTC
I can now reproduce. Thank you. Milos any idea why maven executes both the individual test classes and the test suite resulting in reporting all test results twice? Did something change lately? BTW it does not happen in 7.1
Comment 4 Milos Kleint 2012-06-11 12:08:24 UTC
(In reply to comment #2)
> 
> 3.) Create empty Maven project and copy the content of "teststorun" package
> into source packages
> 4.) Create tests for that package
> 5.) Test the Maven Java SE project (ALT + F6)
> => the result woll be 18 tests failed and 2 errors
> 
> this is because Maven project will execute also the test suite file and the Ant
> project will not

That's a feature/fault of maven surefire plugin. in the Create tests.. action's dialog you have the option to omit the creation of suite files. or you can configure the surefire plugin to run just the suite files or to omit executing them... In general it's not worth the effort to synchronize behaviour of IDE-generated Ant build scripts and Maven. 


Closing as won't fix. The maven behaviour appears to be maven standard, user can configure POM or omit generating/delete the suite file.