@Test public void getPreferenceTest() { WorkbenchPreferenceDialog dialog = new WorkbenchPreferenceDialog(); MavenSettingsPreferencePage page = new MavenSettingsPreferencePage(); dialog.open(); dialog.select(page); String location = page.getUserSettingsLocation(); dialog.ok(); assertEquals(location, Preferences.get(M2E_PLUGIN, M2E_USER_SETTINGS)); dialog.open(); dialog.select(page); String newLocation = location.replaceFirst(".xml", "_new.xml"); page.setUserSettingsLocation(newLocation); dialog.ok(); new WaitWhile(new JobIsRunning(), TimePeriod.NORMAL); assertEquals(newLocation, Preferences.get(M2E_PLUGIN, M2E_USER_SETTINGS)); }
@Test public void getNonExistingPreferenceTest() { assertNull(Preferences.get(M2E_PLUGIN, "nonExistingKey")); }