Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » How do I automatically set preferences for a test?
How do I automatically set preferences for a test? [message #806447] Fri, 24 February 2012 19:59 Go to next message
Eclipse UserFriend
I have an SWTBot test plug-in which requires setting:

org.eclipse.ui.ide/SWITCH_PERSPECTIVE_ON_PROJECT_CREATION=always

I tried setting the preference using the Preferences view via SWTBot itself, but there is some glitch where the setting is made via SWTBot, but it is not set properly and this later breaks my tests.

Now, my tests work fine with the setting above in a plugin_customization.ini file which I have to specify via a -pluginCustomization argument in the Run dialog for my particular test.

I would like to make the test automatically do this for anyone who checks out the test plug-in from the repository without forcing them to set up the -pluginCustomization option. (i.e. just right-click and Run as..-> SWTBot test).

What would be the best way to do this?

I would also like to do this for Junit tests as well.
Re: How do I automatically set preferences for a test? [message #809110 is a reply to message #806447] Tue, 28 February 2012 08:44 Go to previous message
Eclipse UserFriend
You can do this programmatically. Get hold of the right
org.eclipse.jface.preference.IPreferenceStore and then set the value for
the right preference key via
org.eclipse.jface.preference.IPreferenceStore.setValue(String, boolean)

--
Deepak Azad
http://wiki.eclipse.org/JDT/FAQ
Previous Topic:Views order
Next Topic:Proposal: Jump to middle of current line - new key shortcut
Goto Forum:
  


Current Time: Tue Jul 15 20:26:05 EDT 2025

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

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

Back to the top