Indeed, it looks like something is missing here. We added the JMockit support at the request of another user, but as we aren't ourselves using JMockit, we based our template solely on her example.
Unfortunately we haven't worked hard on MoreUnit this year. But this surely something we could integrate in a future version. Meanwhile, you can add you own template for JMockit, see http://moreunit.sourceforge.net/#doc-mocksupport (at the very bottom of the page, sorry for the succint documentation).
Regards,
Nicolas
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I finally had a look at your template: it works perfectly for me. That said, I don't know how you tested it: did you build MoreUnit with that change, or did you put the template in your <workspace>/.metadata/.plugins/org.moreunit.mock/templates directory ? In the later case, be sure to give the template a different id, or it will be rejected (normally with an error in a popup window).
It should work if you put a .xml file in the previously mentioned directory, with the following content :
<?xml version="1.0" encoding="UTF-8" ?>
You can then either restart Eclipse or click on Preferences > MoreUnit > Java > Mock Generation > Reload templates, and then choose the template JMockit > Using JUnit's @RunWith
Also, I will include your template in the next version of MoreUnit, as another JMockit template named "Using JUnit's @RunWith", in order to let the default template aligned with what seems to be JMockit's default way of configuring it.
As an aside: unfortunately we have been very bad at answering MoreUnit's users for one year... I shall be more available now, at the very least until mid-September, so don't hesitate to ask for more help if needed.
Nicolas
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Conversely, users used to the current behavior might be surprised!
That said, given the magic needed for JMockit to work without @RunWith, it's likely better to follow your advice and make it the default, with another profile called "Without JUnit's @RunWith" for people liking the current behavior.
Many thanks for your help!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi dear Alchemist :-)
I apologize for the very late answer :-\
Indeed, it looks like something is missing here. We added the JMockit support at the request of another user, but as we aren't ourselves using JMockit, we based our template solely on her example.
Unfortunately we haven't worked hard on MoreUnit this year. But this surely something we could integrate in a future version. Meanwhile, you can add you own template for JMockit, see http://moreunit.sourceforge.net/#doc-mocksupport (at the very bottom of the page, sorry for the succint documentation).
Regards,
Nicolas
I submitted a pull request, but I'm not sure why it doesn't work. Any ideas, Nicolas?
Hi Alchemist,
sorry for the late answer (again).
At the moment we are both very busy with our personal lives...
We hope to give you some feedback soon.
Vera
Hi Alchemist,
I finally had a look at your template: it works perfectly for me. That said, I don't know how you tested it: did you build MoreUnit with that change, or did you put the template in your <workspace>/.metadata/.plugins/org.moreunit.mock/templates directory ? In the later case, be sure to give the template a different id, or it will be rejected (normally with an error in a popup window).
It should work if you put a .xml file in the previously mentioned directory, with the following content :
<?xml version="1.0" encoding="UTF-8" ?>
You can then either restart Eclipse or click on Preferences > MoreUnit > Java > Mock Generation > Reload templates, and then choose the template JMockit > Using JUnit's @RunWith
Also, I will include your template in the next version of MoreUnit, as another JMockit template named "Using JUnit's @RunWith", in order to let the default template aligned with what seems to be JMockit's default way of configuring it.
As an aside: unfortunately we have been very bad at answering MoreUnit's users for one year... I shall be more available now, at the very least until mid-September, so don't hesitate to ask for more help if needed.
Nicolas
@Nicolas: I tested it by running MoreUnit as an Eclipse application (Run As -> Eclipse Application/PlugIn; I forget which one exactly).
Thanks for including it!
May I suggest making it the default if "JMockit" is selected? Otherwise, it might not work properly and people might blame MoreUnit. :(
Conversely, users used to the current behavior might be surprised!
That said, given the magic needed for JMockit to work without @RunWith, it's likely better to follow your advice and make it the default, with another profile called "Without JUnit's @RunWith" for people liking the current behavior.
Many thanks for your help!
No problem, thanks for the great piece of software!
Ready to ship: @RunWith(JMockit.class) is now the default. And some more documentation has been written, and there is now an XSD.
Last edit: Nicolas Demengel 2015-01-21