Hi All,
I was facing the same problem. Please note that;
1. Debugging works for the junit test class which creates the mock
objects.
2. However, the mocked classes failed.
Here is my observation;
This failed
MkDirExecutor mockDirExecutor = mock(MkDirExecutor.class);<<<<<<<
// mock step
Step mockStep = mock(Step.class);
Mkdir mockStepConfig = mock(Mkdir.class);
String testDir = "/testDir";
mockStepConfig.setPath(testDir);
mockStep.setMkdir(mockStepConfig);
mockDirExecutor.step = mockStep;
// mock env
GathererEnvironment mockEnv = mock(GathererEnvironment.class);
StatusManager mockManager = mock(StatusManager.class);
FileResult result = (FileResult)
mockDirExecutor.executeStep(mockStep,
mockEnv, mockManager);
assertNotNull("no result", result);
This could be debugged
MkDirExecutor mockDirExecutor = new MkDirExecutor();<<<<<<<
// mock step
Step mockStep = mock(Step.class);
Mkdir mockStepConfig = mock(Mkdir.class);
String testDir = "/testDir";
mockStepConfig.setPath(testDir);
mockStep.setMkdir(mockStepConfig);
mockDirExecutor.step = mockStep;
// mock env
GathererEnvironment mockEnv = mock(GathererEnvironment.class);
StatusManager mockManager = mock(StatusManager.class);
FileResult result = (FileResult)
mockDirExecutor.executeStep(mockStep,
mockEnv, mockManager);
assertNotNull("no result", result);
Spot the difference in the line marked with <<<<<<<
I have no clue why it behaves this way, but it worked for me. Please
enlighten.
On Jul 2, 12:58 am, szczepiq <
szcze...@gmail.com> wrote:
> Does debugging work fine on other classes, those that not use Mockito?
>
> Cheers,
> Szczepan
>
> On Thu, Jul 1, 2010 at 9:25 PM, Albert Wong <
alb...@scorebig.com> wrote:
> > Using Eclipse Java EE IDE for Web Developer Helios Release 20100617
>
> > Compiler
> > + Add variable attributes to generated class file
> > + Add line number attributes to generated class file
> > + Add source name to generated class file
> > + Preserve unused local variables
> > + Inline finally blocks
>
> > I didn't enable project specific compiler options.
>
> > On Thu, Jul 1, 2010 at 12:32 AM, Max <
maxon...@gmail.com> wrote:
>
> >> Do the same for Project specific settings.
>
> >> On Thu, Jul 1, 2010 at 8:31 AM, Max <
maxon...@gmail.com> wrote:
>
> >>> I never saw this problem before. Can you check what checkboxes do you
> >>> have ticked under "Classfile Generation" in
> >>> Window>Preferences>Java>Compiler.
>
> >>> On Thu, Jul 1, 2010 at 3:51 AM, AlbertTWong <
alb...@scorebig.com> wrote:
>
> >>>> I've got JUnit tests that run just fine. Added Mockito to my build and
> >>>> I try to put a breakpoint in my JUnit test that uses Mockito to mock
> >>>> out some of the public methods. When I try to run the debugger on the
> >>>> class, I get the error "unable to install breakpoint in XXX due to
> >>>> missing line number attributes. Modify compiler options to generate
> >>>> line number attributes." I checked my compiler and I generate line
> >>>> numbers is selected. I've googled for the obvious answers and I
> >>>> can't seem to find the solution. Anyone encounter this?
>
> >>>> --
> >>>> You received this message because you are subscribed to the Google
> >>>> Groups "mockito" group.
> >>>> To post to this group, send email to
moc...@googlegroups.com.
> >>>> To unsubscribe from this group, send email to
> >>>>
mockito+u...@googlegroups.com<
mockito%2Bunsu...@googlegroups.com>
> >>>> .
> >>
mockito+u...@googlegroups.com<
mockito%2Bunsu...@googlegroups.com>
> >> .
> >
mockito+u...@googlegroups.com<
mockito%2Bunsu...@googlegroups.com>
> > .