logos
free software

JUnitGenerator V2.0

Products: IntelliJ IDEA

Vendor: Bell Tracy, Ltd.

Email:

Website: http://code.google.com/p/junit-generator-v2

Bugtracker page

Forum page

Description:

This plugin generates JUnit tests from right click 'Generate...' menu while focused on a java class. The unit test output code can be customized using a provided velocity template to format the code based on the origin class.

If a unit test is created where one already exists, the user is prompted for overwrite or merge operation. The merge operation allows the user to selectively create the target file content.

A future revision will allow the user to generate their own test case macros.

Downloads: 25380
Rating:
Participated in rating: 8
Version Since Build Until Build File/URL Size (Kb) Date Details
2.0.10. 80.8000. . Download 83.57 2013-03-05 17:37:52 details
2.0.7. 40.2233. . Download 51.08 2008-07-21 05:55:44 details
. .
3 updates are hidden show all updates

Recent change notes:

This revision contains the following updates to issues:


Previous release notes:

Revision 2.0.9 contains the following updates:
  • Upgraded to newest version of the open api
  • Added project and application settings areas
  • Fixed an issue when overwriting an existing test case
  • The configuration now uses a form based swing dialog
  • Multiple templates can be selected from the menu
  • Various other improvements and code enhancements

General usage instructions:

This plugin was originally written by: Alex Nazimok. I have updated JUnit Generator and made it much more customizable.

This plugin allows users to generate customized test-case skeletons in a specified directory, which it will create if the directory does not already exist.

A velocity template is used to generate these test cases which can be customized as needed. These templates have access to a large amount of metadata making the generated tests very dynamic.

Several options are allowed, including the ability to decide whether or not to generate tests for all overloads of a method and how to name them. Also, for all private methods boiler plate reflection access and invocation code is created.

A test can be easily generated by pressing Alt+Ins and selecting JUnit Test or you can optionally add a keybinding to it under the keymap part of the IntelliJ settings page.

This plugin runs out of the box for IntelliJ 7, and will run fine in IntelliJ 6.x, however since there are version issues between the IntelliJ IDEA 6 and IntelliJ IDEA 7 SDK's, I have uploaded two versions, 2.0.6 and 2.0.7 respectively. If you download this plugin through IntelliJ you will get the 2.0.7 Version which runs on IntelliJ 7.x, however if you download the 2.0.6 version here, you only need to extract the junitgen.jar from the zip file and place it in the IntelliJ plugins folder, located under the config folder in 'Documents and Settings' in order to run this on IntelliJ 6.x

I have added JUnitGeneratorV2.0 as a project on Google Code. There you will be able to find the IntelliJ 6 version and a version compiled specifically to run on a Macs. I have also uploaded the source code and instructions to compile it. You can find the Google Project here: http://code.google.com/p/junit-generator-v2/

Also, feel free to leave any comments or suggestions.

***Google Code Website: http://code.google.com/p/junit-generator-v2/

Comments:

123>
jonnio
Rated:
2012-01-09 21:34:16
Just updated for newest version. Please download and have a look.
.
QwertGold
2011-11-08 16:11:30
Quick question, where is the verlocity template stored. And is there any way to configure which folder the test will be generated into?
.
Anonymous
Rated:
2010-08-28 04:08:01
Love it. Works great with IntelliJ 9 ultimate ed. Only issue is that my module test dir is set to src/test/java, but the test is created in src/src/test/java.

Any ideas?
.
camerojo
Rated:
2010-02-03 04:39:58
Sorry about my earlier rating - I don't seem to be able to delete it - so I have posted again giving 5 stars.

I am the formerly anonymous poster who was getting class version errors.

I then noticed that you have a special build for Mac's (my OS). I downloaded that and installed and it fixed the problem.

Still a little confused why Mac's need a separate build - but happy that it is now working and happy with your plugin in general.
.
camerojo
Rated:
2010-02-03 04:17:48
Looks like nobody is supporting this any more. Doesn't work with later versions of Intellij.
See other comments below on class version errors.
.
gilbertw1
2010-02-02 04:38:02
I'll check it out tomorrow...what OS are you running?
.
Anonymous
2010-02-02 03:17:11
Doesn't appear to work with latest Intellij. Get class version errors when starting Intellij.
.
cboettcher
Rated:
2009-12-31 06:53:32
I like how the plugin provides skeleton code for private methods using introspection. Also, relatively easy to configure. Only criticisms involve the mess it makes in the ~/.IntelliJIdea90/config/plugins directory and the lack of access via the GUI (another shortcut to learn).
.
gilbertw1
2009-03-31 18:31:28
Great! I'm glad you got it sorted out. I'll add the instructions ASAP.
.
Anonymous
2009-03-31 18:01:07
Sorry, typo in instructions (wrong directory). Fixed below.
---
1. Install/Enable JUnitGenerator V2.0 in IDEA plugins preferences.
2. Quit IntelliJ.
3. Place contents of zip file in ~/Library/Application Support/IntelliJIDEA80
(Overwrite any existing junitgen.jar and resources/ folder)
4. Restart IntelliJ
---
.
Anonymous
2009-03-31 17:59:53
Sorry, typo in instructions.
The directory is ~/Library/Application Support/IntelliJIDEA80

.
Anonymous
2009-03-31 17:58:45
woo-hoo. It works. Here\'s what you have to do:
---
1. Install/Enable JUnitGenerator V2.0 in IDEA plugins preferences.
2. Quit IntelliJ.
3. Place contents of zip file in ~/Application Support/IntelliJIDEA80
(Overwrite any existing junitgen.jar and resources/ folder)
4. Restart IntelliJ
---
Voila. No startup errors, and you can generate a JUnit test.

Please add this to the instructions. Thank you.

PS: Thanks for making this plugin - and fix - available. I use JUnitGenerator a *lot*, saves me a ton of time.

.
gilbertw1
2009-03-30 23:26:22
After googling around I found this:

On Mac OS X the plugins directory is ~/Library/Application Support/IntelliJIDEA80

Hopefully that is the correct location. If it is let me know and I'll add it into the description.
.
gilbertw1
2009-03-30 23:12:28
Hi, It has always worked properly for me by just dropping the files in the plugin folder. IntelliJ automatically recognizes that new plugins have been added on startup. There is no global plugins listing located anywhere.

Now barring a major discontinuity between the windows and linux version, and the mac version, do you think its a possibility that you are looking in the incorrect plugins folder? On both filesystems, I've found this location to be /.IntelliJIdea70/config/pluins, albeit the root was entirely different. Maybe you could try searching for something along those lines.

Btw, I just downloaded and tried this with intelliJ 8 on windows and this method worked correctly, however I had to create the plugins folder under config, since no other plugins were installed.

Hope that helps,
Bryan
.
Anonymous
2009-03-30 22:39:32
on my Leopard system, it's /Applications/IntelliJ IDEA 8.1.app/plugins

I unzipped the contents of the file into this location and started up IntelliJ. Nothing happened - i.e. there's no "generate Junit test" and so on menu items.

How does the plugin "register" with IntelliJ? Since this is a manual install, IntelliJ presumably has no idea that this library should be used at startup.


.
123>