[Building Sakai] Debugging unit tests in Eclispe

Bryan Holladay holladay at longsight.com
Tue Jul 16 14:00:50 PDT 2013


"mvn eclipse:eclipse" will bring in all that pom stuff, so the tests will
work.  I'm not sure why right clicking isn't bringing that option up.  It
does for Test classes (doesn't for non test classes).  I don't have any
other ideas or methods, I'll defer to someone on this list who has debugged
JUnit tests in another way.

-Bryan



On Tue, Jul 16, 2013 at 4:46 PM, Brian Jones <bjones86 at uwo.ca> wrote:

> Ya, I can see what you mean. But when I do that, my 'Debug as..' menu is
> empty, there's no option 'JUnit Test', or any other option for that matter.
> It just asks me to create a debug configuration.
>
> Also, I thought that we couldn't really just run them as JUnit tests
> because
> it loads beans up and other stuff that's found in the poms, etc.
>
> Brian Jones
> Applications Development
> Information Technology Services
> Support Services Building, Room 4326
> Western University
> (519) 661-2111 x86969
> bjones86 at uwo.ca
>
> From: Bryan Holladay [mailto:holladay at longsight.com]
> Sent: Tuesday, July 16, 2013 4:40 PM
> To: Brian Jones
> Cc: sakai-dev
> Subject: Re: [Building Sakai] Debugging unit tests in Eclispe
>
> I simply just right click in Eclipse the test I want to debug and choose
> "debug as...-> JUnit Test".  I'm not using maven or running tomcat through
> eclipse.  Tomcat doesn't even have to be started or maven compiling.
>
> On Tue, Jul 16, 2013 at 4:32 PM, Brian Jones <bjones86 at uwo.ca> wrote:
> Hey Bryan,
>
> My 'Debug as...' menu was empty. So I created a new Maven Build
> configuration with the goal of '-Dmaven.surefire.debug test'. But when I
> use
> this, it just waits for a socket attach on port 5005.
>
> When I attach my remote debugger to 5005, it just runs from start to finish
> without stopping on the breakpoints. Not sure if I'm missing something
> here,
> are there any instructions on this?
>
> Brian Jones
> Applications Development
> Information Technology Services
> Support Services Building, Room 4326
> Western University
> (519) 661-2111 x86969
> bjones86 at uwo.ca
> From: Bryan Holladay [mailto:holladay at longsight.com]
> Sent: Tuesday, July 16, 2013 4:20 PM
> To: Brian Jones
> Cc: sakai-dev
> Subject: Re: [Building Sakai] Debugging unit tests in Eclispe
>
> I've never tried it through socket attaches.  Using the normal Eclipse
> "Debug as..." button always worked for me.  I'm assuming this isn't an
> option and you have to connect to an external socket?
>
> On Tue, Jul 16, 2013 at 4:09 PM, Brian Jones <bjones86 at uwo.ca> wrote:
> Hello,
>
> Does anyone have any positive experience with debugging unit tests in
> Eclipse? I can get mvn in debug mode to listen for a socket attach, and I
> can attach my Eclipse debugger to it just fine, but it never respects the
> breakpoints I've set. Once it's attached, it just does the tests from start
> to finish without pausing on my breakpoitns.
>
> I've tried the following mvn commands:
>
>         - mvnDebug -DforkCount=0 test
>         - mvnDebug -DforkMode=never test
>
> Cheers,
>
> Brian Jones
> Applications Development
> Information Technology Services
> Support Services Building, Room 4326
> Western University
> (519) 661-2111 x86969
> bjones86 at uwo.ca
>
>
>
> _______________________________________________
> sakai-dev mailing list
> sakai-dev at collab.sakaiproject.org
> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>
> TO UNSUBSCRIBE: send email to
> sakai-dev-unsubscribe at collab.sakaiproject.org
> with a subject of "unsubscribe"
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20130716/85cb3451/attachment.html 


More information about the sakai-dev mailing list