Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » Load saved workspace preferences at SWTBot test launch
Load saved workspace preferences at SWTBot test launch [message #1232665] Fri, 17 January 2014 08:03 Go to next message
Surdeanu Mihai is currently offline Surdeanu Mihai
Messages: 1
Registered: January 2014
Junior Member
Hello!

I am using SWTBot to test an Eclipse application with a special plugin incorporated. That plugin have some preferences kept into .metadata/.plugins directory of each workspace used. For each SWTBot test launched, I want to load automatically these preferences. For that, I have tried to copy that .prefs files (where preferences are stored) into SWTBot debug workspace. But every time I start a SWTBot test these files added are removed automatically.

I also tried to copy these files into eclipse/configuration/.settings Eclipse directory, but I get the same answer.

Is there a chance to load automatically some plugin preferences (saved into a workspace) when a SWTBot test it is launched?

Eclipse Classic 4.2.1 it is the version used by me.

Thanks for your help. Smile
Re: Load saved workspace preferences at SWTBot test launch [message #1232700 is a reply to message #1232665] Fri, 17 January 2014 09:25 Go to previous message
Mickael Istria is currently offline Mickael Istria
Messages: 738
Registered: July 2009
Location: Grenoble, France
Senior Member
FYI, what you described is not related to SWTBot in particular, it's a
pure JUnit in Eclipse issue.

That said, preference files are not meant to be copied or moved like
that. A JUnit test has to be autonomous, and is responsible of
configuring the application as necessary (and cleaning it after).
Instead of assuming things about the application, you should modify the
preferences in the @Before or @BeforeClass method of the test, so are
sure that the preferences are set as you expect whenever the test run.

--
Mickael Istria
My job: http://www.jboss.org/tools
My blog: http://mickaelistria.wordpress.com
My Tweets: http://twitter.com/mickaelistria
Previous Topic:SWTBot with Tycho in Travis CI
Next Topic:Help to Click on SWT Element
Goto Forum:
  


Current Time: Thu Jul 31 23:57:51 EDT 2014

Powered by FUDForum. Page generated in 0.01631 seconds