Disabling POJO tests - Problem with parametrized constructors
-------------------------------------------------------------
Key: SUREFIRE-309
URL: http://jira.codehaus.org/browse/SUREFIRE-309
Project: Maven Surefire
Issue Type: Wish
Components: classloading
Affects Versions: 2.3
Reporter: Daniel Lindner
If you include a class that matches the test class pattern but is a regular
class (e.g. a helper or mock implementation of a production type) to the test
directories, the surefire plugin attempts to run POJO-tests on it. This fails
if there is no non-argument default constructor. The failure breaks the test
cycle.
There are three ways to resolve the effect:
- Move the POJO class away or rename it. Both is only needed because surefire
lacks support
- Adjust the test class pattern. This is probably possible.
- Make surefire aware of the problem. Either make it configurable or do not
attempt to POJO-test classes without default constructor. At least, do not fail
the tests if this situation occurs.
The third way of handling the issue is my suggestion. I would prefer the
solution "by convention" that POJO tests need a default constructor and other
classes will be ignored.
To recreate the problem, add a class named TestThisPOJONot to your test classes
and give it a constructor with parameters.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira