Of course.
My process is a
little bit different than invoking the tests like a JUnit test using PDE. As I have described in some other threads, my RCP application has very tight (ie, not going to change) restrictions on acceptable and consumable command line parameters that are passed into the application. I first noticed this when I was testing the product in my IDE, and my application code was rejecting
-version and
-port parameters (and the others) when trying to run a PDE test. Therefore, I have written a "test runner" utility that is designed to accept in the name of my test plug-in (ie, a plug-in that contains my recorded WindowTester Pro JUnit classes) and name of the class contained in this plug-in that I want to invoke, and then launch them. My plug-in is an extension of the
org.eclipse.ui.startup extension point, and so the test runner utility code is invoked immediately after my workbench is initialized. The code parses for custom vmarg parameters that I have passed in, and then launches the test using the
junit.framework package.
I first packaged up the WindowTester pro execution environment plug-ins (minus the GEF ones) that were designed to run on Eclipse 3.6 applications:
- com.windowtester.runtime
- com.windowtester.runtime
- com.windowtester.swing.runtime
- com.windowteser.swt.runtime.win32.win32.x86
- com.windowtester.swt.runtime
- All 5 of the com.instantiations.* plugins
I then packaged up my test runner plug-in (along with some other plug-ins that are required by the com.windowtester.usageprofiler plug-in that are missing in my application under test):
- my.custom.plugin (the test runner that I wrote)
- org.hamcrest.core
- org.junit
- org.eclipse.core.filesystem
- org.eclipse.core.resources
Both of these are installed in a deployed RCP application by placing the plug-ins in a separate folder (ie, c:\extsite), and then editing the
eclipse/configuration/org.eclipse.update/platform.xml file to include an additional site, pointing to this external directory. I confirmed using the OSGi framework console that these plug-ins are visible in the RCP application, and that their status is <<resolved>> instead of just <<installed>> (According to eclipse.org, the "installed" state just means that OSGi is aware of a bundle, but that the bundle has missing dependencies, or that something is missing).
I then install my plug-in containing my window tester pro tests via the same method as the other collection of plug-ins.
Once everything is installed, I then invoke my RCP application, and pass in the custom -vmargs parameters that my test runner utility is searching for. My code is then launched after my RCP workbench is visible on the desktop.
This process seems to work great on Windows: my test is playable, and the report file that I generate contains a complete record of actions that are performed (including Exceptions if an exception is thrown during the execution of the test). However, this process does not seem to work in Linux.
I am suspecting that the
org.windowtester.swt.runtime.* plug-in that is suited for the win32-win32-x86 environment needs to be replaced with its Linux-equivalent ...