JUnit 4 Synchronizer

Compatible with  IntelliJ IDEA
02.01.2007
12 319
Creates JUnit 4 test classes/methods for source methods annotated with the @Testable annotation. The test classes are created in a 'test' package, inside which the application package structure is duplicated. The 'test' package will be created if it does not already exist. The @Testable annotation is created automatically in the 'test' package the first time the synchronizer is run. @Testable currently has a single attribute whereby you can override the name of the test method to be created. For example, @Testable("testIntegerAddition") would create a test method named 'testIntegerAddition'. If no name attribute is specified a default name will be created that consists of the name of the annotated method prefixed with 'test'. Test classes will only be created for those source classes with at least one method annotated with @Testable. This plugin is available from the 'Tools' menu or from the project view popup menu as 'Synchronize JUnit Tests'. Instructions: #1 - RunSynchronize JUnit Tests once to create the @Testable annotation. #2 - Annotate desired source methods with @Testable annotation. #3 - Run Synchronize JUnit Tests to create test methods. #4 - Repeat steps 2 and 3 as often as desired to create new unit tests. Note 1: If you have a multi-module project simply copy the @Testable annotation from the first module (as created during step 1 above) into 'test' packages in the additional modules and proceed with steps 2 thru 4 to create the unit tests for these modules. Note 2: An enhancement request has been submitted to JUnit.org (via SourceForge.net) to include the @Testable annotation in the JUnit 4 framework.

Download plugin

General usage instructions

This plugin is available from the \'Tools\' menu or from the project view popup menu as \'Synchronize JUnit Tests\'. Run the plugin once to create the necessary @Testable annotation. Once this annotation is created you can use it to annotate the methods you want to create test units/methods for. Once you have annotated your methods run the plugin from one of the menus to create the appropriate test methods/classes.
Anonymous
04.03.2010
Have just tried using this on a new install of IntelliJ - and get the same error as mentioned below, i.e.:

java.lang.NoSuchMethodError: com.intellij.openapi.project.Project.getAllScope()Lcom/intellij/psi/search/GlobalSearchScope;

What is the issue here?
Anonymous
13.01.2010
I'm getting the same error... I wonder why this plugin is part of the IntelliJ help pages for IDEA9.0
Anonymous
27.09.2009
any solution to the NoSuchMethodError?

Error during dispatching of java.awt.event.MouseEvent[MOUSE_RELEASED,(86,503),absolute(196,669),button=1,modifiers=Button1,clickCount=1] on ###overrideRedirect###: com.intellij.openapi.project.Project.getAllScope()Lcom/intellij/psi/search/GlobalSearchScope;
java.lang.NoSuchMethodError: com.intellij.openapi.project.Project.getAllScope()Lcom/intellij/psi/search/GlobalSearchScope;
at com.rjackson.intellij.plugin.junit.JUnitGeneratorAction.init(JUnitGeneratorAction.java:209)
Anonymous
02.07.2009
I get the same exception too:

rror during dispatching of java.awt.event.MouseEvent[MOUSE_RELEASED,(59,169),absolute(472,215),button=1,modifiers=Button1,clickCount=1] on ###overrideRedirect###: com.intellij.openapi.project.Project.getAllScope()Lcom/intellij/psi/search/GlobalSearchScope;
java.lang.NoSuchMethodError: com.intellij.openapi.project.Project.getAllScope()Lcom/intellij/psi/search/GlobalSearchScope;
at com.rjackson.intellij.plugin.junit.JUnitGeneratorAction.init(JUnitGeneratorAction.java:209)
Anonymous
17.03.2009
I can't get it to work in 8.1 I get the following the first and every time i run it:
java.lang.NoSuchMethodError: com.intellij.openapi.project.Project.getAllScope()Lcom/intellij/psi/search/GlobalSearchScope;
at com.rjackson.intellij.plugin.junit.JUnitGeneratorAction.init(JUnitGeneratorAction.java:209)
at com.rjackson.intellij.plugin.junit.JUnitGeneratorAction.actionPerformed(JUnitGeneratorAction.java:58)
at
Anonymous
03.01.2009
Can anyone send me how to configure,create,run tests using junit 4 synchronizer??
or give me any link related to this??
I am using IntelliJ IDEA 6.0.4 .
Anonymous
12.02.2008
Can anyone send me how to configure,create,run tests using junit 4 synchronizer??
or give me any link related to this??
I am using IntelliJ IDEA 7.0.2 .
But the annotation @Testable is not working in test methods..
Anonymous
12.02.2008
Can anyone send me how to configure,create,run tests using junit 4 synchronizer??
or give me any link related to this??
I am using IntelliJ IDEA 7.0.2 .
But the annotation @Testable is not working in test methods..
Anonymous
25.01.2008
Same as above, you're forcing me to use your chosen test directory structure making this effectively unusable. I never intermingle tests with my src, that's why we have different directories in idea for them and the ability to classify each separately.

Too bad had potential.
Anonymous
21.11.2007
What on earth is an "annotation"?
Anonymous
18.10.2007
Nifty idea, but how do I change the default test directory and package? I was going to put my test classes under a "test" dir and/or use a standard maven structure. Doesn't seem to be a way to handle it.
Please  sign in  to leave a comment.