<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    Debugging Arquillian tests - JBoss Java Project Source Container
</h3>
<span style="margin-bottom: 10px;">
    modified by <a href="https://community.jboss.org/people/snjeza">Snjezana Peco</a> in <i>JBoss Tools</i> - <a href="https://community.jboss.org/community/tools/blog/2013/03/15/debugging-arquillian-tests--jboss-java-project-source-container">View the full blog post</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>When debugging an Arquillian test using a remote container, we usually do the following steps:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><ul><li style="text-align: start;">create a project</li><li style="text-align: start;">add the Arquillian support</li><li style="text-align: start;">create a test</li><li style="text-align: start;">configure Maven profiles</li><li style="text-align: start;">create a JBoss server</li><li style="text-align: start;">start the server in the debug mode</li><li style="text-align: start;">start the test in the debug mode</li></ul><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>We can debug the classes from the project's source by adding the Eclipse Java Project source container to the Source Lookup. </p><p>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.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>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.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>If we can't (or don't want to) deploy the project, we can use <strong>the JBoss Java Project Source Container</strong> from the arquillian eclipse plugin.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><strong>The JBoss Java Project Source Container</strong> 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. </p><p>The project can, but doesn't have to be a Maven project.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Test case:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><ul><li style="text-align: start;">create a JBoss AS Server</li><li style="text-align: start;">import the JBoss Central Java EE project (don't deploy it)</li><li style="text-align: start;">set a breakpoint in the org.jboss.arquillian.junit.Arquillian.methodInvoker(FrameworkMethod, Object) method (at line 270 in Arquillian 1.0.3)</li><li style="text-align: start;">start the server in the debug mode</li><li style="text-align: start;">debug MemberRegistrationTest</li></ul><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>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.</p><p>Adding the Eclipse Java Project source container won't help because it adds only source folders. </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><ul><li style="text-align: start;"><span>install the Arquilian eclipse plugin from </span><a class="jive-link-external-small" href="http://snjeza.github.com/arquillian-eclipse" rel="nofollow" target="_blank">http://snjeza.github.com/arquillian-eclipse</a><span> (JBoss Tools nightly build is required - </span><a class="jive-link-external-small" href="http://download.jboss.org/jbosstools/updates/nightly/trunk/" target="_blank">http://download.jboss.org/jbosstools/updates/nightly/trunk/</a><span>) </span></li><li style="text-align: start;">add <strong>the JBoss Java Project Source Container</strong> to the Source Lookup</li></ul><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>You will be able to debug any class from the project.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>It is possible to create different helper projects and add the container to different remote launch configurations.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><strong>The JBoss Java Project Source Container</strong> 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.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span>See </span></p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Comment by <a href="https://community.jboss.org/community/tools/blog/2013/03/15/debugging-arquillian-tests--jboss-java-project-source-container">going to Community</a></p>

</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>