|PDE Junit Test runner forwarding args to Eclipse application [message #648385]
||Wed, 12 January 2011 16:36
| Adam Betz
Registered: July 2009
I have an application that I am trying to execute WindowTester Pro JUnits on. WTPro is a tool that allows you to execute functional GUI tests against an RCP application. It records these tests as simple JUnit classes, and so you execute them just like you would a JUnit Plug-in test from your IDE, or through the normal set of arguments from Ant or the command line.|
My application under test is fairly restrictive and picky about the additional command line arguments you pass to it when it starts, b/c certain application-specific arguments will tell the application to do something different than if it had been started normally (For example, I can pass "-verbose" to my app to print debug statements to std.err). When the application starts, a parser component analyzes all of the command line arguments for acceptable parameters. If an argument is not an accepted parameter, then it will print a message to std.err, and return a GUI dialog window stating that an unknown parameter has been passed. The application then shuts down. Standard Eclipse arguments (-os, -arch, -ws, -consoleLog, -keyring, etc.) are OK, since these have meaning to the underlying Eclipse runtime.
When I am running my JUnits from the command line, I pass in a bunch of Eclipse parameters to invoke the test, including -ws, -os, -arch, -consoleLog, -version, -port, testLoaderClass -loaderpluginname, -classNames -testpluginname. While debugging my application, I see that the PDE test runner is invoked correctly. Right before it invokes the UITestApplication.start method call, I looked at the args array list, and see that all of the eclipse parameters have been stripped away (-ws, -os, etc.) However, those test runner arguments (-testLoaderClass, -pluginname, etc.) have not been stripped away. Instead, they get forwarded to the target runtime, which as I stated above complains when additional or non-consumable parameters get passed to it.
Is there a way that I can tell the PDE test runner not to forward these arguments, or strip them away some how? I imagine I might be able to do this via an extension or wrapper class somewhere, but I have no clue how to do this. The only other alternative that I can think of at this point is to have the application specifically ignore this set of parameters, but that seems kludgey. Any ideas?
I appreciate the feedback!
Powered by FUDForum
. Page generated in 0.02308 seconds