Debug Partial Mock in JMockit

前端 未结 1 643
借酒劲吻你
借酒劲吻你 2021-01-06 00:39

Using JMockit 0.999.4 and JDK6, is it possible to debug into a partially mocked class?

Consider the following test:

@Test
public void testClass() {
          


        
相关标签:
1条回答
  • 2021-01-06 01:42

    Answered by Rogerio in the JMockit Google's discussion group.

    The JVM discards the breakpoints set on a class after it is redefined (which JMockit does whenever a class is mocked).

    To reset the breakpoints, stop the debugger at the test method, just before it enters the code under test. That is, set a breakpoint in the test method, on the line which calls into "SampleClass" in this example.

    0 讨论(0)
提交回复
热议问题