Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » SWTbot fails with RCP that takes arguments
SWTbot fails with RCP that takes arguments [message #644910] Tue, 14 December 2010 17:23 Go to next message
Fredrik Lindqvist is currently offline Fredrik LindqvistFriend
Messages: 13
Registered: November 2009
Junior Member
We have a RCP that can take command line arguments, if we get unknown arguments we throw an exception.

When we try to run SWTbot on the RCP we get that exception. Debugging show that our RCP get the following arguments:

[-keepalive, -version, 3, -port, 55255, -testLoaderClass, org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader, -loaderpluginname, org.eclipse.jdt.junit4.runtime, -classNames, BaseTest, -testApplication, app.gui.application, -testpluginname, MyTest]


Since these are unknown arguments, we get an exception.

The run configuration is pretty basic, instead of starting up the workbench, we start up the application. Like it has been suggested in all tutorials on the net.


Our code get the arguments from
org.eclipse.equinox.app.getArguments().get("application.args")


My guess: SWTBot adds application arguments but doesn't remove them before starting up the RCP application.
Re: SWTbot fails with RCP that takes arguments [message #645406 is a reply to message #644910] Fri, 17 December 2010 04:41 Go to previous messageGo to next message
Ketan Padegaonkar is currently offline Ketan PadegaonkarFriend
Messages: 873
Registered: July 2009
Senior Member
Hi Fred,

You'd likely get a different set of arguments based on whether you're
debugging or running normally, your version of junit, and other things.

Eclipse normally does not error out on arguments it does not
understand(primarily so that other plugins can read those arguments and
do something interesting with them). SWTBot continues to follow this
philosophy and I'd suggest that your app does too.

This effectively means that you leave room for other plugins(including
swtbot) to be able to do interesting things with those arguments :)

--
Ketan
ketan.padegaonkar.name | eclipse.org/swtbot | @ketanpkr

On 12/14/10 9:23 AM, Fred wrote:
> We have a RCP that can take command line arguments, if we get unknown
> arguments we throw an exception.
> When we try to run SWTbot on the RCP we get that exception. Debugging
> show that our RCP get the following arguments:
>
>
> [-keepalive, -version, 3, -port, 55255, -testLoaderClass,
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader,
> -loaderpluginname, org.eclipse.jdt.junit4.runtime, -classNames,
> BaseTest, -testApplication, app.gui.application, -testpluginname, MyTest]
>
>
> Since these are unknown arguments, we get an exception.
> The run configuration is pretty basic, instead of starting up the
> workbench, we start up the application. Like it has been suggested in
> all tutorials on the net.
>
> Our code get the arguments from
> org.eclipse.equinox.app.getArguments().get("application.args ")
>
> My guess: SWTBot adds application arguments but doesn't remove them
> before starting up the RCP application.
Re: SWTbot fails with RCP that takes arguments [message #645430 is a reply to message #645406] Fri, 17 December 2010 09:13 Go to previous message
Fredrik Lindqvist is currently offline Fredrik LindqvistFriend
Messages: 13
Registered: November 2009
Junior Member
Hi Ketan

Thanks for the reply, that confirms what we thought.

Since our RCP can be run in command line mode we need to be able to verify commands and warn the user when something is incorrect/misspelled. We will solve this with a property that will allow all arguments, this will let us run SWTbot.

Thanks,
Fred
Previous Topic:"getId" method?
Next Topic:CheckboxTreeViewer and grayedChecked
Goto Forum:
  


Current Time: Thu Apr 25 06:16:44 GMT 2024

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

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

Back to the top