[
http://jira.codehaus.org/browse/SUREFIRE-427?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Cory Prowse updated SUREFIRE-427:
---------------------------------
Attachment: SUREFIRE-427_Test.zip
Sorry, that was an obvious oversight of mine.
I have attached an example Maven project which exhibits this bug with minimal
code. There are only four java classes, the absolute minimum, but the numerous
files in the resource directories are required unfortunately.
I cleaned out my local maven repo (rm -rf ~/.m2) to ensure I was working off a
clean install.
What was interesting is that I then needed to then run the following command
TWICE!
mvn -up clean test
Note that I am forcing maven to check for updated releases of plugins.
In the first run Maven only picks up version 2.3 of Surefire which gives the
NoSuchMethodError from TestNG.
In the second run it correctly picks up Surefire 2.4, which is required by
TestNG, and the tests run (although they don't pass due to the original reason
for this bug report).
(a lot of other updates are downloaded as well)
The error I then get is again:
"There is no default persistence unit in this deployment."
So it still appears that JBoss Embedded is only picking up the persistence.xml
file from the main classpath and ignoring completely the one in the test
classpath.
I am more than happy to help further to track down this issue.
> persistence.xml being ignored in test path when in test/resources/META-INF
> --------------------------------------------------------------------------
>
> Key: SUREFIRE-427
> URL: http://jira.codehaus.org/browse/SUREFIRE-427
> Project: Maven Surefire
> Issue Type: Bug
> Components: classloading, TestNG support
> Affects Versions: 2.4
> Environment: Ubuntu Linux 7.10 (Gutsy Gibbon)
> Java 1.5.0_11
> Maven 2.0.8
> TestNG 5.7 (jdk5)
> Reporter: Cory Prowse
> Priority: Blocker
> Attachments: seamMavenExample-20080104.tar.bz2, SUREFIRE-427_Test.zip
>
>
> The file
> src/test/resources/META-INF/persistence.xml
> is not included in the test path.
> When this file is moved to
> src/main/resources/META-INF/persistence.xml
> then it is loaded correctly.
> The attached application will fail to build, complaining about no default
> persistence unit in the deployment
> I'm confused why it isn't working as the META-INF directory in the test
> resources does contain another file that IS picked up during the test by
> JBoss Embedded (file: components.xml).
> This is using Maven 2.0.8 which explicitly states in its release notes:
> "MNG-3118 - Test-classes should come before classes in the classpath.
> This may slightly alter behavior of tests. The test-classes is now
> included first in the classpath to allow test resources to override
> normal runtime ones."
> I have emailed the users list and not received a response. Is there anything
> I could try to help?
--
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