Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Debugging RQM JUnit Selenium Adatper

I'm trying to debug the adapter from Eclipse.  The challenge is that the adapter spawns a new java process to execute the test.  Is there a way to debug/step through the process that was spawned?  The best I've been able to do so far is to invoke (and debug) that Java process separately, but that doesn't give me what I really want, which is  to be able to debug the entire process  (from start to finish) of the adapter receiving the execution request, executing the test and then doing everything after the execution of the test completes.

0 votes



2 answers

Permanent link

You can put breakpoint in every thread. If it is library code, you may not be able to debug it.

0 votes


Permanent link

It's not that simple.  I figured it out.  You can't just put a breakpoint since the JUnit test runs in a separate process (created with ProcessBuilder), not a separate thread in the command line adapter's 'main' process.  You need to create a remote debug connection to the process that runs the JUnit tests.

What I did was:

1.  In CommandLindAdapter.runTest(), added the argument to start the new java process in debug mode:
commandLine.append(args[0] + " -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000 ");

2.  Put breakpoint in QMCommandLindAdapter.main() so that I could debug the main adapter process as soon as it starts.

3.  In JUnitLauncher.main(), put a 10-second sleep to give me time to connect to the java process after it has been spawned by the adapter's main process.

4.  Put a breakpoint in JUnitListener.main() right after the sleep

5.  Ran the adapter in debug mode (from Eclipse)

6.  Kicked off the test from QM and then connected to the java process by launching a remote debug connection from Eclipse.

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,938

Question asked: Mar 27 '18, 9:38 a.m.

Question was seen: 2,046 times

Last updated: Apr 03 '18, 8:26 a.m.

Confirmation Cancel Confirm