2.4. Debugging Exemplars and JUnits

Automatic background execution of Exemplars and JUnits gives you instant results, but doesn’t allow you to view the console to see System.outs, or to use the Eclipse debugger to step through your code as the test runs.

For this reason, the UC Engine can be launched in “standalone mode” to execute both JUnit tests and Exemplars within a separate process. To do this, simply right-click within the source editor and select Run As->Sureassert UC or Debug As->Sureassert UC. Additionally, you can select multiple files to run, or a whole project, by selecting files or a project within Project Explorer, and selecting the same options from the right-click menu.

If you wish you may also all projects in your workspace by using the “Sureassert UC Workspace Runner” launch under the Run Configurations menu.

Running standalone launches Sureassert UC in a headless container and executes any Exemplars or JUnits in the selected files. The Eclipse console will report execution progress and any console output from the tested methods will be output here as usual.

You can step through Exemplars, look at variables, execute debug expressions etc using the Eclipse debugger. To debug your Exemplars, make sure you’ve added a breakpoint somewhere in the method under test. Note you may inadvertently step into Sureassert instrumented code – if this happens just step back out with F7 and continue.

Previous Page   |   Next Page   |   Table of Contents

Comments are closed.