Automated Testing of GEF Builds

last updated: October 10, 2005

Description

This document describes how to run the GEF JUnit test plugins from the command line. This is the same mechanism used in GEF builds.

Click here for a description of the testing framework, and how it can be used outside of the setup described here.

If you simply wish to write and run JUnit tests interactively from an Eclipse workbench, try one of the links below:

JUnit Support in Eclipse
Using JUnit

Requirements

1. All test machines will require a java runtime environment (version 1.3 or higher) installed and optionally added to the path environment variable (see -vm parameter below).
2. Info-ZIP UnZip version 5.41 or later installed and added to the path.
3. The Automated Test feature from GEF. This contains the test framework plugins and the JUnit test plugins to run.
4. The GEF ALL zip file from the same build as the Automated Test feature.
5. An Eclipse SDK zip file. The URL and build name of the required Eclipse SDK are specified in the build.cfg file included in the Automated Test zip file.

Setup

1. Extract the GEF-Automated-Tests-<buildid>.zip. On Windows, extract this file close to the root of the drive to prevent some path names from exceeding the 255 character limit. This will create a top-level directory "gef-testing".
2. Place the Eclipse SDK and GEF ALL zip file in the gef-testing directory. Do not unzip these files. (The test scripts will take care of that.)

Running Tests

1. cd to the gef-testing directory
2. Run the following script:

runtests [-os <operating system>] [-ws <windowing system>] [-arch <architecture>] [-noclean] [<testTarget>][-properties <path>][-vm <path to java executable>]

All parameters and targets are optional on windows systems. Just running "runtests" will run ALL tests on Windows, installing a clean Eclipse SDK and GEF between each test target. On *nix systems, the os, ws and arch parameters must be specified.

Test results are placed in the gef-testing/results directory in xml and html format.

Parameters

Parameter Description
-os <operating system> The OS the tests are being run on. One of: aix, hpux, linux, qnx, solaris, win32. Default win32
-ws <windowing system> The windowing system the tests are being run on. One of: motif, gtk, photon, win32. Default win32
-arch <architecture> The architecture the tests are being run on. One of: ppc, PA_RISC, x86, sparc. Default x86
-noclean Run tests without installing Eclipse and GEF and tests between test targets. Default is to re-install these between test targets.
-properties Used to reference a properties file containing additional Ant properties used in running tests.Can be used to pass additional vm arguments to the Java virtual machine running the tests by adding the entry "extraVMargs=<the args to pass to the vm>" to the specified properties file.
-vm The full path to the java executable with which to run the tests. Use this to specify a specific virtual machine with which to run the tests. For example, "-vm c:\sun131\jre\bin\java". Default set to "java" (i.e. java executable on system path).
-Dtest.target=performance Runs the performance test suites only. When running tests on Windows, enclose this parameter in double quotes, ie. runtests "-Dtest.target=performance". If this parameter is not specified, only the regular, non-performance, junit tests will be run.

Test Targets

Specifies which ant target to run in the main test.xml. Typically this corresponds to a test project's tests. If you do not specify a test target then the all test target is run.

all Runs all the targets below.
gef Runs the JUnit plug-in tests in org.eclipse.gef.test
draw2d Runs the JUnit plug-in tests in org.eclipse.gef.draw2d.test
genHtml Converts xml test results in the "gef-testing/results" directory to html.

 

Appendix A- Supported os, ws, and arch value combinations

The following table contains the values that can be used with the -os, -ws, and -arch switches.

Operating System (os) Windowing System (ws) Architecture (arch)
aix motif ppc
hpux motif PA_RISC
linux gtk x86
linux motif x86
qnx photon x86
solaris motif sparc
win32 win32 x86