PIT Eclipse Plugin (Alpha)

575 views
Skip to first unread message

Phil Glover

unread,
Jun 28, 2012, 10:05:47 AM6/28/12
to pitu...@googlegroups.com
Hi,

Over recent weeks, I have been working on an Eclipse plugin for PIT, provisionally titled Pitclipse.  I cannot emphasise enough that it is certainly lacking a lot of bells and whistles, but hopefully with time it will become a lot more polished and better integrated into the IDE.

Once installed, you should have a new menu item "PIT Mutation Test" on the "Run As" menu.  Selecting this will launch PIT against the select test and displays the html results in a browser view.


What it supports:
Running PIT against an individual unit test
Mutates the project/module containing the test only
Results displayed in a browser window within Eclipse
Java unit tests only (JUnit & TestNG)
PIT version 0.27
The absolute latest/up to date version of all Eclipse 3.7 JDT plugin.  You will have to update your installation prior to installing Pitclipse.

What it does not support:
Running PIT against multiple unit tests
Mutating accross all open projects in the workspace
Integration between the html results & the source
Earlier versions of Eclipse (should be possible to support 3.5 upwards - will need a little time to verify)


I'm going to be offline next week and have limited connectivity the week after, so apoligies if I may be a little slow in responding to any queries.  But please play around with it, and feedback would be welcomely received.



Regards,
Phil

Henry Coles

unread,
Jun 28, 2012, 10:47:05 AM6/28/12
to pitu...@googlegroups.com
Thanks Phil,
 
It's great to finally have some IDE support. It may be quite basic at the moment, but it does do just enough to be actually useful.
 
Cheers
 
Henry

Vadim Lysenko

unread,
Jun 29, 2012, 10:41:22 AM6/29/12
to pitu...@googlegroups.com
Hello!

Firstly I'd like to thank you for great job! 
Secondly I'd like to report a problem with that plugin: it won't run mutation tests when project name is differs from the directory this project lives in. This scenario is quite common when maven projects are imported into the workspace after launching eclipse:eclipse goal as eclipse plugin for maven produces name as maven "groupId" +"."+ artifactId. PIT trying to run test in C:/workspace/mvn.group.id.artifact-id/src/test/java where real path is C:/workspace/artifact-id/src/test/java



On Thursday, June 28, 2012 5:47:05 PM UTC+3, Henry Coles wrote:
Thanks Phil,
 
It's great to finally have some IDE support. It may be quite basic at the moment, but it does do just enough to be actually useful.
 
Cheers
 
Henry

Phil Glover

unread,
Jun 29, 2012, 12:05:50 PM6/29/12
to pitu...@googlegroups.com
Hi Vadim,

Thanks for trying it out.  It's strange as I have run this against maven projects and even maven projects checked out from github.  The latter projects are located under my git directory - completely different location to the workplace.

Unfortunately, I've been forbidden from bringing my laptop on holiday so I can't make any changes this week.  What would be helpful would if you could open the Eclipse "Error View".  You should then see the classpath and the args - this might give a clearer view.

Thanks,
Phil



Sent from Samsung Mobile

Vadim Lysenko

unread,
Jun 29, 2012, 1:45:20 PM6/29/12
to pitu...@googlegroups.com, Phil Glover
Thank you for such immediate response.

I'm not sure you was asking for this but here it is Error Log entry:
--------------------------------------------------------------------------------------------------
eclipse.buildId=2.9.2.201205071000-RELEASE
java.version=1.6.0_30
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=lt_LT
Framework arguments:  -product com.springsource.sts.ide
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product com.springsource.sts.ide -data d:\Users\IDE

This is a continuation of log file D:\Users\IDE\.metadata\.bak_3.log
Created Time: 2012-06-29 15:53:46.039

Error
Fri Jun 29 19:41:58 EEST 2012
An internal error occurred during: "Launching ClassUnderTheTestNameTest (1)".

org.pitest.pitclipse.pitrunner.PITOptions$PITLaunchException: Directory does not exist: D:\Users\source\modules\mvn.group.id.mvn-artifact-id\src\test\java
at org.pitest.pitclipse.pitrunner.PITOptions$PITOptionsBuilder.validateSourceDir(PITOptions.java:146)
at org.pitest.pitclipse.pitrunner.PITOptions$PITOptionsBuilder.build(PITOptions.java:116)
at org.pitest.pitclipse.ui.launch.PITLaunchConfigurationDelegate.launch(PITLaunchConfigurationDelegate.java:76)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:854)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:703)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:937)
at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1141)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
-------------------------------------------------------------------------------------------------- 

On Friday, June 29, 2012 7:05:50 PM UTC+3, Phil Glover wrote:
Hi Vadim,

Thanks for trying it out.  It's strange as I have run this against maven projects and even maven projects checked out from github.  The latter projects are located under my git directory - completely different location to the workplace.

Unfortunately, I've been forbidden from bringing my laptop on holiday so I can't make any changes this week.  What would be helpful would if you could open the Eclipse "Error View".  You should then see the classpath and the args - this might give a clearer view.

Thanks,
Phil



Sent from Samsung Mobile

Phil Glover

unread,
Jun 29, 2012, 4:11:54 PM6/29/12
to pitu...@googlegroups.com
Ah ok, I think I see the issue.  It should be easy to recreate hopefully.  I'll drop you a line in 10 days or so when i've had chance to look closer.

When I mentioned the Error View, I didn't mean the log file.  However, the fact there was an exception would have meant that it didn't get as far as logging the parameters anyway!  The stack trace Is much more helpful in your circumstance.

For future reference, the error view is an eclipse window.  I think it's found under Window  -> Show View.  It's under the General category  I think (sorry - doing this from memory).  It might be called Error Log.... anyway  in this case there would be no entry, but may be of use in the future.

Kind regards,
Phil







Sent from Samsung Mobile

Vadim Lysenko

unread,
Jun 30, 2012, 4:01:29 PM6/30/12
to pitu...@googlegroups.com, Phil Glover
>  would have meant that it didn't get as far as logging the parameters anyway! 
>
It looks like that it didn't indeed. I was unable to found any PIT call arguments.

> For future reference, the error view is an eclipse window
>
The content I had sent was taken exactly from the "Error Log" view :)

>  I'll drop you a line in 10 days or so when i've had chance to look closer
>
Thank you again for the support. I will be waiting in impatience as I really want to try to live with PIT in everyday work.


On Friday, June 29, 2012 11:11:54 PM UTC+3, Phil Glover wrote:
Ah ok, I think I see the issue.  It should be easy to recreate hopefully.  I'll drop you a line in 10 days or so when i've had chance to look closer.

When I mentioned the Error View, I didn't mean the log file.  However, the fact there was an exception would have meant that it didn't get as far as logging the parameters anyway!  The stack trace Is much more helpful in your circumstance.

For future reference, the error view is an eclipse window.  I think it's found under Window  -> Show View.  It's under the General category  I think (sorry - doing this from memory).  It might be called Error Log.... anyway  in this case there would be no entry, but may be of use in the future.

Kind regards,
Phil







Sent from Samsung Mobile

Vadim Lysenko wrote:

Phil Glover

unread,
Jul 19, 2012, 5:35:55 PM7/19/12
to pitu...@googlegroups.com, Phil Glover
Hi Vadim,

Sorry for the delay in getting back to you.  This issue is now fixed in version 0.27.1 - available from the update site.

Kind regards,
Phil

Vadim Lysenko

unread,
Jul 20, 2012, 6:07:03 AM7/20/12
to pitu...@googlegroups.com, Phil Glover
Hi, Phil! 
 
Hooray! Now it works! 
Thank you for the bugfix now the problem I was reported is solved. Additionally I was seen that plugin produces several info log messages :)
Reply all
Reply to author
Forward
0 new messages