# Building and Running the Team/CVS Tests using Ant

## Building the Team/CVS tests

To build the TEam/CVS test plugins, perform the following steps:

1. Import the following plugins using the Import External Plugins and Fragments wizard:
   1. org.eclipse.team.* plugins and all required plugins
   2. org.junit and any required plugins
2. Check out the following plug-ins from dev.eclipse.org:
   1. org.eclipse.core.tests.harness
   2. org.eclipse.team.tests.core
   3. org.eclipse.team.tests.cvs.core
3. In org.eclipse.team.tests.cvs.core, select the file build-tests.xml and choose Run Ant... from the popup menu. A zip archieve of the CVS test plugins is created in the org.eclipse.team.tests.cvs.core project.

## Setting up the Eclipse install to be used to run the tests

To run the tests built above, perform the following steps:

1. Install eclipse to you test directory.
2. Install the eclipse test harness plug-ins and fragments over the above install
3. Extract the team test plugin archive created above into the test Eclipse install.
4. The CVS tests require a repository to test with. Modify the repository.properties file in plug-in org.eclipse.team.tests.cvs.core to contain the information required to connect to your repository. Important fields in the repository properties file are:
   - repository - the location string that identifies your test repository. This string should be of the format ":method:user:password@host:/repo/path"
   - initrepo - true if you want to initialize the repository before beginning. It is not essential to initialize the repository, as the tests will create unique test project names.
   - rsh - the rsh (or ssh) client used to initialize the repository
     Note: Your repository must allow rsh connections from your userid and machine in order for the tests to run when initrepo is set to true. If ssh is used, it must be configured to connect when provided with the parameters "host -l username" (i.e. setup to use keys).

   There is a sample repository.properties file provided in org.eclipse.team.tests.cvs.core. The additional properties are for more in-depth tests.

   Note: If you want to keep a repositories.properties file in a separate directory, this directory can be provided to the test script run below as the "team-home" parameter.

5. Run the test.xml Ant script using the following command line from the eclipse directory:
   - For Team:
     java -cp startup.jar org.eclipse.core.launcher.Main -application org.eclipse.ant.core.antRunner -file plugins/org.eclipse.team.tests.core/test.xml run -dev bin -noupdate
   - For CVS:
     java -cp startup.jar org.eclipse.core.launcher.Main -application org.eclipse.ant.core.antRunner -file plugins/org.eclipse.team.tests.cvs.core/test.xml run -dev bin -noupdate