The purpose of the document is to describe the configuration required in order to successfully debug CTP streams using Eclipse.

First you need to setup debugging on the RI Java project using this link. Link

Second you need to have atelite installed and running with the RI using this link. Link

At this point you should be able to set a breakpoint somewhere in RI code that will execute during a test, deliver the stream to the RI via atelite, connect the debugger to the RI and have the application thread stop on that line.

However if you want to trace all the way from the beginning of the CTP test, or are not exactly sure where in the RI code to begin then you need to do the following.

The main issue is getting the CTP test code recognized properly in Eclipse.

CTP test code lives in two places. First in the CTP stream <testname>.d/src directory there are one or more source files. Also utility & rules source is in the atelite/testsuite/util directory. The problem is that these source locations do not conform to the standard package directory structure required by the Java debugger. So I copy the source I want into my own directory structure that conforms to the packages src/org/ocaptest/tset.... src/org/ocaptest/util.

I then create a Java project in Eclipse called "ocap-test" and change the Contents option to "Create project from existing source" and point it to my top level src directory.

As part of my normal Eclipse configuration I already had a Java project that points to the stubs directory called "ocap-stubs". I made my ocap-test project dependent on the ocap-stubs project. You could also just add the stubs jar file as an External Library under the Build Path option for the ocap-test project.

At this point you should be able to open the test source and set a breakpoint at the beginning of the test. Use atelite and atec adp <test stream> to send the CTP stream to the RI. Attach the Eclipse debugger to the RI process and wait for the first line to turn green. As of 2009 the CTP test files are built with line number debugging, but no symbols so variables will not show up. However the utility classes and the RI should have full symbolic debugging support.

An addition to this process would be to just create symbolic links in the src directory you move the test files too. This way when you update the CTP test source the new files will be reflected in the debugger and not require a new copy.

  • No labels