[ http://jira.codehaus.org/browse/SUREFIRE-38?page=all ]
     
Brett Porter closed SUREFIRE-38:
--------------------------------

      Assign To: Brett Porter  (was: Jason van Zyl)
     Resolution: Won't Fix
    Fix Version:     (was: 2.0)

this is a result of some pretty poort error handling in JBoss, AFAICT.

I've fixed the NPE when the lines are changed so the actual exception is 
reported that was later shown, but going back to the original lines....

The reason this doesn't work out of the box, as the JBoss Javadoc says, is that 
 scanClasspath scans java.class.path, which just isn't set in an embedded test. 
You need to fork. So I added:

<forkMode>pertest</forkMode><childDelegation>false</childDelegation>

This still failed, without giving much reason except that it couldn't find 
something. I compared the compilation output of eclipse and Maven and found 
that Eclipse didn't have all the source and test classes mixed together, as 
Maven did due to misconfiguration in the POM, so I added these to the compiler 
plugin:

<excludes><exclude>**/Embedded*</exclude></excludes>
<testExcludes><testExclude>**/Customer*</testExclude></testExcludes>

It now works just fine. The latter would be simpler if the two test and src 
trees were separate instead.

> Surefire Maven2 Plugin fails to run EJB3 Embeddable Container (but mvn 
> eclipse:eclipse succeeds)
> ------------------------------------------------------------------------------------------------
>
>          Key: SUREFIRE-38
>          URL: http://jira.codehaus.org/browse/SUREFIRE-38
>      Project: surefire
>         Type: Bug

>     Versions: 1.5.2
>  Environment: maven 2.0.3
>     Reporter: Dan Greening
>     Assignee: Brett Porter
>     Priority: Critical
>  Attachments: jboss-ejb3-embeddable-test-with-junit.tar.gz
>
>
> JBoss's EJB3 embeddable container, which is very handy for unit testing EJB's 
> without using an application server, will not work under surefire in Maven2.  
> It works fine under Maven1.  Furthermore, it ALSO works using the Maven2 
> eclipse-plugin generated .project/.classpath in Eclipse.
> Here's a complete set of instruction to reproduce it.
> This is a test showing that surefire does not properly handle the JBoss EJB3
> embeddable container.
> The instructions are a bit complex, because you have to download a package of
> JARs from JBoss.  (They make the test file too big to attach in JIRA.)
> To confirm,
> 1. cd /tmp
> 2. Surf to 
> http://sourceforge.net/project/showfiles.php?group_id=22866&package_id=132063
> 3. Download jboss-EJB-3.0_Embeddable_ALPHA_5.zip.  Put it in /tmp.  This is
>    the latest EJB3 embeddable system.
> 4. unzip jboss-EJB-3.0_Embeddable_ALPHA_5.zip
> 5. Download jboss-ejb3-embeddable-test-with-junit.tar.gz (it is an attachment
>    to this JIRA ticket).
> 6. tar xvfz jboss-ejb3-embeddable-test-with-junit.tar.gz
> 7. cd jboss-ejb3-embeddable-test-with-junit
> 8. cp -pR ../jboss-EJB-3.0_Embeddable_ALPHA_5/lib lib
> 9. ./deploy-jars.perl
> 10. type "mvn test".
> 11. Note that the test fails.
> 12. Type "mvn eclipse:eclipse"
> 13. Import the jboss-ejb3-embeddable-test-with-junit directory into Eclipse 
> as an "existing project".
> 14. Set M2_REPO build variable to your .m2/repository folder.
> 15. Run the EmbeddedEjb3TestCase as a JUnit test in Eclipse.  It works.

-- 
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

Reply via email to