Exemple #1
0
 @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));
 }
Exemple #2
0
 @Test
 public void getNonExistingPreferenceTest() {
   assertNull(Preferences.get(M2E_PLUGIN, "nonExistingKey"));
 }