再试试:
To enable an SWT application for testing, the following code should be called from the UI thread of the application. Typically this is the code that first creates the application Shell. We currently do NOT support testing multiple Displays within a single application. Should someone have a need for testing multiple Displays please ask for such support from the product management team.
Here is the code:
try
{
// Self-enable this application. The object passed to
// enableSwtUi must be an object or class whose classLoader
// has access to the SWT classes.
// enableSwtUi() must be called from the SWT UI Thread.
// If the JRE in which the application is running is enabled
// by IBM Rational Functional Tester it will then be testable.
// If the JRE is not enabled, a ClassNotFoundException will
// be caught here and the application will load as usual but
// it will not be testable.
com.rational.test.ft.bootstrap.Bootstrap.enableSwtUi(this);
}
catch (Throwable e) {}