@Test
 public void setLocalCatalogTest() {
   preferencesDialog.open();
   preferencesDialog.select(page);
   page.addLocalCatalog(path.getAbsolutePath(), LOCAL_CATALOG_DESCRIPTION);
   assertEquals(true, page.containsCatalog("Local: " + LOCAL_CATALOG_DESCRIPTION));
   page.removeCatalog("Local: " + LOCAL_CATALOG_DESCRIPTION);
   assertEquals(false, page.containsCatalog("Local: " + LOCAL_CATALOG_DESCRIPTION));
 }
 private static void setupMavenRepo() {
   String mvnConfigFileName = new File("target/classes/settings.xml").getAbsolutePath();
   WorkbenchPreferenceDialog preferenceDialog = new WorkbenchPreferenceDialog();
   preferenceDialog.open();
   MavenSettingsPreferencePage prefPage = new MavenSettingsPreferencePage();
   preferenceDialog.select(prefPage);
   prefPage.setUserSettingsLocation(mvnConfigFileName);
   preferenceDialog.ok();
   new WaitUntil(new JobIsRunning());
 }
 @Before
 public void setup() {
   WorkbenchPreferenceDialog wp = new WorkbenchPreferenceDialog();
   wp.open();
   wp.select("JBoss Tools", "Project Examples");
   new CheckBox("Show Project Ready wizard").toggle(false);
   new CheckBox("Show readme/cheatsheet file").toggle(false);
   new CheckBox("Show Quick Fix dialog").toggle(false);
   wp.ok();
 }
 @Test
 public void setRemoteCatalogNotVerifyTest() {
   preferencesDialog.open();
   preferencesDialog.select(page);
   assertEquals(
       "",
       page.addRemoteCatalog(REMOTE_CATALOG_FILE + "_test", REMOTE_CATALOG_DESCRIPTION, false));
   assertEquals(true, page.containsCatalog("Remote: " + REMOTE_CATALOG_DESCRIPTION));
   page.removeCatalog("Remote: " + REMOTE_CATALOG_DESCRIPTION);
   assertEquals(false, page.containsCatalog("Remote: " + REMOTE_CATALOG_DESCRIPTION));
 }
 @Test
 public void setRemoteCatalogTest() {
   preferencesDialog.open();
   preferencesDialog.select(page);
   assertNotEquals(
       EMPTY_CATALOG_MESSAGE,
       page.addRemoteCatalog(REMOTE_CATALOG_FILE, REMOTE_CATALOG_DESCRIPTION));
   assertEquals(true, page.containsCatalog("Remote: " + REMOTE_CATALOG_DESCRIPTION));
   page.removeCatalog("Remote: " + REMOTE_CATALOG_DESCRIPTION);
   assertEquals(false, page.containsCatalog("Remote: " + REMOTE_CATALOG_DESCRIPTION));
 }
 @Test
 public void editLocalCatalogTest() {
   String localCatalogName = "Local: " + LOCAL_CATALOG_DESCRIPTION;
   preferencesDialog.open();
   preferencesDialog.select(page);
   page.addLocalCatalog(path.getAbsolutePath(), LOCAL_CATALOG_DESCRIPTION);
   assertEquals(true, page.containsCatalog(localCatalogName));
   localCatalogName = localCatalogName + " test";
   page.editLocalCatalog(localCatalogName, path.getAbsolutePath(), localCatalogName);
   page.removeCatalog(localCatalogName);
   assertEquals(false, page.containsCatalog(localCatalogName));
 }
 protected static void disableSourceLookup() {
   // wait for some shell to get activated
   ShellLookup.getInstance().getActiveShell();
   String originalShellText = new DefaultShell().getText();
   WorkbenchPreferenceDialog preferenceDialog = new WorkbenchPreferenceDialog();
   preferenceDialog.open();
   SourceLookupPreferencePage sourceLookupPreferencePage = new SourceLookupPreferencePage();
   preferenceDialog.select(sourceLookupPreferencePage);
   sourceLookupPreferencePage.setSourceAttachment(
       SourceLookupPreferencePage.SourceAttachmentEnum.NEVER);
   preferenceDialog.ok();
   new WaitUntil(new ShellWithTextIsActive(originalShellText));
 }
 @Test
 public void editRemoteCatalogNotVerifyTest() {
   String remoteCatalogName = "Remote: " + REMOTE_CATALOG_DESCRIPTION;
   preferencesDialog.open();
   preferencesDialog.select(page);
   page.addRemoteCatalog(REMOTE_CATALOG_FILE, REMOTE_CATALOG_DESCRIPTION);
   assertEquals(true, page.containsCatalog(remoteCatalogName));
   remoteCatalogName = remoteCatalogName + " test";
   assertEquals(
       "",
       page.editRemoteCatalog(
           remoteCatalogName, REMOTE_CATALOG_FILE + "abc", remoteCatalogName, false));
   assertEquals(true, page.containsCatalog("Remote: " + remoteCatalogName));
   page.removeCatalog(remoteCatalogName);
   assertEquals(false, page.containsCatalog(remoteCatalogName));
 }
Beispiel #9
0
 @Test
 public void setPreferenceTest() {
   WorkbenchPreferenceDialog dialog = new WorkbenchPreferenceDialog();
   MavenSettingsPreferencePage page = new MavenSettingsPreferencePage();
   dialog.open();
   dialog.select(page);
   String location = page.getUserSettingsLocation();
   dialog.ok();
   String newLocation = location.replaceFirst(".xml", "_new.xml");
   Preferences.set(M2E_PLUGIN, M2E_USER_SETTINGS, newLocation);
   dialog.open();
   dialog.select(page);
   location = page.getUserSettingsLocation();
   dialog.ok();
   assertEquals(newLocation, location);
 }
Beispiel #10
0
 @Test
 public void setDefaultPreferenceTest() {
   WorkbenchPreferenceDialog dialog = new WorkbenchPreferenceDialog();
   MavenSettingsPreferencePage page = new MavenSettingsPreferencePage();
   dialog.open();
   dialog.select(page);
   String location = page.getUserSettingsLocation();
   page.setUserSettingsLocation(location.replaceFirst(".xml", "_new.xml"));
   dialog.ok();
   new WaitWhile(new JobIsRunning(), TimePeriod.NORMAL);
   Preferences.setDefault(M2E_PLUGIN, M2E_USER_SETTINGS);
   dialog.open();
   dialog.select(page);
   String newLocation = page.getUserSettingsLocation();
   dialog.ok();
   assertEquals(newLocation, location);
 }
 @After
 public void tearDown() {
   preferencesDialog.cancel();
 }