<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 <<a href="mailto:dan.berindei@gmail.com">dan.berindei@gmail.com</a>> 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'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 "jmx-management-1", which is defined under</div><div><br></div><div><group qualifier="suite-manual"></div><div><br></div><div>5. Add -Darquillian.launch=<group qualifier> 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> <container qualifier="jmx-management-1" mode="manual"><br> <configuration></div><div> ...<br></div><div> <property name="javaVmArguments"></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>