score:2

You could always change the value of the class that is about to have a method called to a Mock version of it.

You can do this by right clicking on it in the Variables panel and selecting Change Value. In the window you can then enter something like:

new SomeClassMock()

Of course this assumes that you have Mock classes already in your classpath (and it sounds like you don't.) However you could certainly create a JAR full of the Mock classes that you need and shove it in the Tomcat shared lib so that you can access it. Not sure if this works but you get the idea.

score:4

You can set breakpoint conditions that will determine whether or not this breakpoint will stop or will continue on. I don't know of any way for you to tell it to skip the next few line without changing the code to something like:

if ( !skip ) {
  // contents to be skipped 
}

and then at the breakpoint set skip to true.

For the breakpoint conditions, if you return true will stop and return false will continue. In here you can actually execute code and do whatever you want (including setting the value of skip).

score:4

I had a similar problem in that I wanted skip some code so that I can get the result of the method call happening later in the code. I forgot that when you are debugging, you can create expressions and evaluate them at anytime. In Eclipse there is an "Expression" tab where you can enter any expressions (i.e. method calls) that you want evaluated.

This meant that I did not have to skip the lines, as I was able to evaluate what I wanted as soon as I entered the appropriate method.

score:14

If you are debugging, you can comment out the line you want to skip and then recompile, which will hotswap the code and keep you within the method you are currently in, allowing you to skip the line.

Depending on what you want to have happen, you could simply execute the line after the one you want to skip, select the code and choose Display from the r-click menu. This will execute the selected code and provide the result in a popup.


Related Query

More Query from same tag