Just set a breakpoint to 
org.apache.sling.testing.tools.jarexec.JarExecutor.start() and then start the 
debugging on the client side (also documented at 
https://sling.apache.org/documentation/development/sling-testing-tools.html).
You should see now which JVM options are used to start the instance.
The problem usually is, that Surefire itself forks Maven and therefore does not 
inherit the original system properties. Just set the configuration option 
forkCount from 
http://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html to 0 to 
prevent forking. Otherwise you have to set the jar.executor.vm.options through 
the configuration option args.

Remember that this does only work, if you provision a new server instance, but 
not if your a connecting to an already running server.
Konrad
 
> On 06 Oct 2015, at 10:59, Dominik Süß <dominik.su...@gmail.com> wrote:
> 
> Hi everybody,
> 
> I currently want to hook in a debugger to the implementation of the
> installer when running the corresponding ITs as I want to inspect the
> implementation behavior and see if I could add a patch that helps in
> upgrade scenarios.
> 
> Yet I had no success getting the IT start in a way that I could hook in a
> remote debugger.
> If I get the documentation right it should be
> 
> mvn test
> -Djar.executor.vm.options="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8000"
> 
> (picked up from
> https://sling.apache.org/documentation/development/sling-testing-tools.html)
> 
> Yet the tests just run through (and just fyi failed for
> BundleInstallStressTest.testSemiRandomInstall) without waiting for a remote
> connection.
> 
> Cheers
> 
> Dominik

Reply via email to