Remote Execution Tutorial

The continuous testing plugin supports remote execution of both normal and plugin JUnit tests. Remote execution improves performance by reducing CPU load on developers' machines. The basic idea is to run a test server on a machine that is not in heavy use, dispatch all JUnit tests to that machine over the network, and return the results to the developer's workstation. Currently, remote execution requires a workspace on a shared network drive that is named identically on both machines.

There are two methods that can be used to execute tests remotely.

Recommended Method

  1. Download the remote execution server jar file
  2. Download the suggested java.policy file. If you encounter access exceptions, modify the above file or use the all-permission java policy file.
  3. Launch the executable jar on the remote machine. The arguments -Djava.security.policy=policy_file and -Djava.security.manager must be passed in at the command line. By default, the server runs on port 1100, but an optional integer argument can be passed to the jar to change this port. For example, java -Djava.security.policy=~/java.policy -Djava.security.manager -jar ~/ctremote_1_1_5.jar 12345.
  4. Turn on remote execution in Eclipse on the continuous testing preference page which can be found by clicking on Window > Preferences. Enter the hostname or ip address and port on which the test server are running in the text fields. The full pathname to a suitable java policy file is also required.
  5. The tests should now run remotely, but the results will still be displayed in the JUnit view.

Alternative Method

Alternatively, Eclipse can be started on the remote machine and the test server can be run from within Eclipse. First, the continuous testing source must be imported into your workspace. Create and run a launch configuration by clicking on Run > Run... for org.eclipse.jdt.internal.junit.launcher.remote.RemoteExecutorService. Once again, the VM arguments -Djava.security.policy=policy_file and -Djava.security.manager must be added to the launch configuration. Proceed with step 4 from above.