
How to install JUnitDoclet as external tool into Eclipse



This file describes, how you can install JUnitDoclet as
external tool. Please note, that this is not an integration
as smooth as with a plugin.

The benefit of this way is the independence from _all_ IDEs,
so you can change your IDE during development or develop in
a team with other people using different IDEs.

This installation procedure is just an example. There may be
much better ways to write the scripts. Anyway they will get
you started and that's the primary goal.

The batch/script files are generic. They are not specific to
Eclipse. So they don't use all the features of Eclipse. In fact
almost everything is defined by settings in
run_junitdoclet_setenv.(bat|sh).


1. Copy the following five files to a single directory which is
   in the path.
 
     JUnitDoclet.jar
     packagelister.jar
     run_junitdoclet_setenv.bat    or run_junitdoclet_setenv.sh
     run_junitdoclet.bat           or run_junitdoclet.sh
     run_junitdoclet_recursive.bat or run_junitdoclet_recursive.sh

   If you are working on a Unix System, don't forget to make the
   scripts readable and executable ( chmod +rx run_junitdoclet* ).

   Make sure the scripts are in the path. Please double check that.
 
2. Adapt the custom area in run_junitdoclet_setenv.(bat|sh)
   Especially the INSTALL_DIRECTORY needs to be set. With Eclipse
   some of the other defaults may need some attention too.

   The scripts will start in the project directory, so make
   the other pathes relative to project home.

3. Start Eclipse and open the dialog
   "Run -> External Tools -> Configure ..."

4. Create a new tool entry with these settings:

     Name                  :JUnitDoclet: Generate single TestCase
     Tool Location         :run_junitdoclet.bat
     Tool Arguments        :${resource_loc}
     Working Directory     :${project_loc}
     After running, refresh:Current Project

   On Unix systems please write <INSTALL_DIRECTORY>/run_junitdoclet.sh
   as "Tool Location" where <INSTALL_DIRECTORY> is the path to
   the script.
 
5. Create a new tool entry with these settings:

     Name                  :JUnitDoclet: Generate all TestSuites and TestCases
     Tool Location         :run_junitdoclet_recursive.bat
     Tool Arguments        :
     Working Directory     :${project_loc}
     After running, refresh:Current Project

   On Unix systems please write
     <INSTALL_DIRECTORY>/run_junitdoclet_recursive.sh
   as "Tool Location" where <INSTALL_DIRECTORY> is the path to
   the script.
   Because we didn't find an easy way to pass the package
   name of a file to the command line, we decided to generate
   all TestSuites and TestCases all the time.
 
6. Enjoy regenerating the TestSuites and TestCases as part of
   Refactoring your application, but don't forget to write
   the tests. Still, this is your job, JUnitDoclet is "only"
   supporting you. ;-)
