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.
Mickael Istria Messages: 720 Registered: July 2009 Location: Grenoble, France
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.