<div dir="ltr">Thanks Dan!!<br><br><div class="gmail_quote"><div dir="ltr">On Wed, Nov 21, 2018 at 5:14 PM Dan Berindei &lt;<a href="mailto:dan.berindei@gmail.com">dan.berindei@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>I had to debug some JMX stuff today and I remembered that Gustavo wanted a guide for debugging ITs, so here goes:</div><div><br></div><div>1. Build the server<br></div><div><br></div><div>mvn install -DskipTests -am -pl server/integration/testsuite</div><div><br></div><div>2. Unpack the server in the testsuite module</div><div><br></div><div>mvn test -pl server/integration/testsuite</div><div><br></div><div>3. Try to run the IT from the IDE, it should fail because it can&#39;t find the server definition</div><div><br></div><div>4. Check the @RunningServer references at the top of the IT and search for them in arquillian.xml. E.g. JmxManagementIT uses &quot;jmx-management-1&quot;, which is defined under</div><div><br></div><div>&lt;group qualifier=&quot;suite-manual&quot;&gt;</div><div><br></div><div>5. Add -Darquillian.launch=&lt;group qualifier&gt; to your debug configuration</div><div><br></div><div>6. Your test should run now. I got an error about env.JAVA_HOME not being defined, I just added a JAVA_HOME environment variable in the debug configuration and it worked.</div><div><br></div><div>The Arquillian server configuration may need other system properties. IntelliJ automatically picks up the system properties set in the failsafe execution [1] when it imports the project, but you may have to set them manually in your debug configuration.</div><div><br></div><div>Now that the test runs, we can try to debug the server. <br></div><div><br></div><div>7. Define a remote debug configuration. Preferably is should be in listen mode: IntelliJ 2018.3.Beta1+ can automatically restart listening after a debug session is over, so you only have to start the remote debug configuration once.<br></div><div><br></div><div>8. Search for the server in arquillian.xml again and add the connection string from the remote debug configuration, e.g.</div><div><br></div><div>        &lt;container qualifier=&quot;jmx-management-1&quot; mode=&quot;manual&quot;&gt;<br>            &lt;configuration&gt;</div><div>                ...<br></div><div>                &lt;property name=&quot;javaVmArguments&quot;&gt;</div><div>                   ....<br>                   -agentlib:jdwp=transport=dt_socket,server=n,address=localhost:5005<br></div><div><br></div><div>9. Set a breakpoint in the server and start the test debug configuration. Your remote debug session should stop at the breakpoint.<br></div><div><br></div><div>HTH</div><div>Dan</div><div><br></div></div><div dir="ltr">[1]: <a href="https://github.com/infinispan/infinispan/blob/8fb4a6a9d168b0d4fb4d709f524585d8708242ac/server/integration/testsuite/pom.xml#L822" target="_blank">https://github.com/infinispan/infinispan/blob/8fb4a6a9d168b0d4fb4d709f524585d8708242ac/server/integration/testsuite/pom.xml#L822</a><br></div></div></div></div></div></div></div></div></div>
_______________________________________________<br>
infinispan-dev mailing list<br>
<a href="mailto:infinispan-dev@lists.jboss.org" target="_blank">infinispan-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a></blockquote></div></div>