Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » PDE Junit Test runner forwarding args to Eclipse application(My application I am running JUnits on cannot accept "extra" command line args ... is there a way to filter these out, or make my target runtime ignore them?)
PDE Junit Test runner forwarding args to Eclipse application [message #648385] Wed, 12 January 2011 16:36 Go to next message
Adam Betz is currently offline Adam BetzFriend
Messages: 2
Registered: July 2009
Junior Member
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!
Re: PDE Junit Test runner forwarding args to Eclipse application [message #648430 is a reply to message #648385] Wed, 12 January 2011 22:00 Go to previous messageGo to next message
Adam Betz is currently offline Adam BetzFriend
Messages: 2
Registered: July 2009
Junior Member
To be a little more specific ...

The PDE launcher launches my IApplication without stripping away those PDE framework arguments, and so they are getting consumed by the Eclipse runtime.

Is there a way, like in a .properties file somewhere, that I can tell the PDE framework to filter out or strip away certain command line parameters so that they are not passed to the target Eclipse runtime?
Re: PDE Junit Test runner forwarding args to Eclipse application [message #793665 is a reply to message #648430] Wed, 08 February 2012 12:10 Go to previous message
Lilia Ghachem is currently offline Lilia GhachemFriend
Messages: 1
Registered: February 2012
Junior Member
Hi Adam,

Any hint on this topic since that? I have the same issue ...

Thanks.
Lilia
Previous Topic:can i use a specific port in my help plugin??
Next Topic:Disabling Menubar Icon
Goto Forum:
  


Current Time: Fri Mar 29 10:34:50 GMT 2024

Powered by FUDForum. Page generated in 0.02065 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top