[jboss-user] [JBoss Tools] - Debugging Arquillian tests - JBoss Java Project Source Container

Snjezana Peco do-not-reply at jboss.com
Fri Mar 15 07:19:31 EDT 2013


Snjezana Peco [https://community.jboss.org/people/snjeza] modified the blog post:

"Debugging Arquillian tests - JBoss Java Project Source Container"

To view the blog post, visit: https://community.jboss.org/community/tools/blog/2013/03/15/debugging-arquillian-tests--jboss-java-project-source-container

--------------------------------------------------------------
When debugging an Arquillian test using a remote container, we usually do the following steps:

* create a project
* add the Arquillian support
* create a test
* configure Maven profiles
* create a JBoss server
* start the server in the debug mode
* start the test in the debug mode

We can debug the classes from the project's source by adding the Eclipse Java Project source container to the Source Lookup. 
However, if we want to debug some Arquillian code in a server (remote) JVM, adding the Eclipse container won't be enough. The Arquillian classes aren't included in a JBoss server and the Java Project source container searches only the project's source folders.

If we can deploy the project, the JBoss Source Lookup plugin will solve all the classes from a mavenized archive so that we can debug the classes from such a project.

If we can't (or don't want to) deploy the project, we can use *the JBoss Java Project Source Container* from the arquillian eclipse plugin.

*The JBoss Java Project Source Container* is similar to the Java Project source container. The differ is that it searches classes from the project's classpath. The container solves source files for all the classes from a mavenized library included in the classpath. 
The project can, but doesn't have to be a Maven project.

Test case:

* create a JBoss AS Server
* import the JBoss Central Java EE project (don't deploy it)
* set a breakpoint in the org.jboss.arquillian.junit.Arquillian.methodInvoker(FrameworkMethod, Object) method (at line 270 in Arquillian 1.0.3)
* start the server in the debug mode
* debug MemberRegistrationTest

The Eclipse won't open the Arquillian source file, which happens because this method is called from within the server's JVM that doesn't know anything about the Java EE project.
Adding the Eclipse Java Project source container won't help because it adds only source folders. 

* install the Arquilian eclipse plugin from  http://snjeza.github.com/arquillian-eclipse http://snjeza.github.com/arquillian-eclipse (JBoss Tools nightly build is required -  http://download.jboss.org/jbosstools/updates/nightly/trunk/ http://download.jboss.org/jbosstools/updates/nightly/trunk/) 
* add *the JBoss Java Project Source Container* to the Source Lookup

You will be able to debug any class from the project.

It is possible to create different helper projects and add the container to different remote launch configurations.

*The JBoss Java Project Source Container* isn't related to the arquillian-eclipse feature and/or JBoss servers and can be added to any launch configuration. The container probably has to be moved to the JBoss Source Lookup plugin.

See
--------------------------------------------------------------

Comment by going to Community
[https://community.jboss.org/community/tools/blog/2013/03/15/debugging-arquillian-tests--jboss-java-project-source-container]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20130315/97a00b0d/attachment-0001.html 


More information about the jboss-user mailing list