Search in sources :

Example 1 with PasswordProvider

use of org.eclipse.reddeer.eclipse.equinox.security.ui.storage.PasswordProvider in project jbosstools-openshift by jbosstools.

the class StoreConnectionTest method cleanUp.

@AfterClass
public static void cleanUp() {
    WorkbenchPreferenceDialog preferences = new WorkbenchPreferenceDialog();
    preferences.open();
    StoragePreferencePage storagePreferencePage = new StoragePreferencePage(preferences);
    preferences.select(storagePreferencePage);
    storagePreferencePage.selectPasswordsTab();
    List<PasswordProvider> masterPasswordProviders = storagePreferencePage.getMasterPasswordProviders();
    for (PasswordProvider tableItem : masterPasswordProviders) {
        tableItem.setEnabled(true);
    }
    preferences.ok();
}
Also used : WorkbenchPreferenceDialog(org.eclipse.reddeer.workbench.ui.dialogs.WorkbenchPreferenceDialog) PasswordProvider(org.eclipse.reddeer.eclipse.equinox.security.ui.storage.PasswordProvider) StoragePreferencePage(org.eclipse.reddeer.eclipse.equinox.security.ui.storage.StoragePreferencePage) AfterClass(org.junit.AfterClass)

Example 2 with PasswordProvider

use of org.eclipse.reddeer.eclipse.equinox.security.ui.storage.PasswordProvider in project jbosstools-openshift by jbosstools.

the class StoreConnectionTest method setupClass.

@BeforeClass
public static void setupClass() {
    WorkbenchPreferenceDialog preferences = new WorkbenchPreferenceDialog();
    preferences.open();
    StoragePreferencePage storagePreferencePage = new StoragePreferencePage(preferences);
    preferences.select(storagePreferencePage);
    storagePreferencePage.selectPasswordsTab();
    List<PasswordProvider> masterPasswordProviders = storagePreferencePage.getMasterPasswordProviders();
    for (PasswordProvider tableItem : masterPasswordProviders) {
        // The second part of this if is because https://issues.jboss.org/browse/JBIDE-24567
        if (tableItem.getDescription().contains("UI Prompt") || tableItem.getDescription().contains("secureStorageProvider.name")) {
            tableItem.setEnabled(true);
        } else {
            tableItem.setEnabled(false);
        }
    }
    preferences.ok();
}
Also used : WorkbenchPreferenceDialog(org.eclipse.reddeer.workbench.ui.dialogs.WorkbenchPreferenceDialog) PasswordProvider(org.eclipse.reddeer.eclipse.equinox.security.ui.storage.PasswordProvider) StoragePreferencePage(org.eclipse.reddeer.eclipse.equinox.security.ui.storage.StoragePreferencePage) BeforeClass(org.junit.BeforeClass)

Example 3 with PasswordProvider

use of org.eclipse.reddeer.eclipse.equinox.security.ui.storage.PasswordProvider in project jbosstools-openshift by jbosstools.

the class DisableSecureStorageRequirement method setSecureStorageMasterPasswords.

private void setSecureStorageMasterPasswords(boolean checked) {
    WorkbenchPreferenceDialog preferenceDialog = new WorkbenchPreferenceDialog();
    StoragePreferencePage storagePage = new StoragePreferencePage(preferenceDialog);
    preferenceDialog.open();
    preferenceDialog.select(storagePage);
    try {
        new WaitUntil(new WidgetIsFound(org.eclipse.swt.custom.CLabel.class, new WithMnemonicTextMatcher("Secure Storage")), TimePeriod.DEFAULT);
        log.info("Getting master password providers");
        List<PasswordProvider> items = storagePage.getMasterPasswordProviders();
        for (PasswordProvider item : items) {
            log.info("Uncheking table item: " + item.getDescription());
            item.setEnabled(checked);
        }
        new WaitUntil(new JobIsRunning(), TimePeriod.DEFAULT, false);
        storagePage.apply();
    } catch (WaitTimeoutExpiredException exc) {
        log.error("Secure Storage preferences page has timed out");
        log.error(exc.getMessage());
    } finally {
        preferenceDialog.ok();
    }
}
Also used : WithMnemonicTextMatcher(org.eclipse.reddeer.core.matcher.WithMnemonicTextMatcher) WidgetIsFound(org.eclipse.reddeer.core.condition.WidgetIsFound) WorkbenchPreferenceDialog(org.eclipse.reddeer.workbench.ui.dialogs.WorkbenchPreferenceDialog) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) PasswordProvider(org.eclipse.reddeer.eclipse.equinox.security.ui.storage.PasswordProvider) StoragePreferencePage(org.eclipse.reddeer.eclipse.equinox.security.ui.storage.StoragePreferencePage)

Aggregations

PasswordProvider (org.eclipse.reddeer.eclipse.equinox.security.ui.storage.PasswordProvider)3 StoragePreferencePage (org.eclipse.reddeer.eclipse.equinox.security.ui.storage.StoragePreferencePage)3 WorkbenchPreferenceDialog (org.eclipse.reddeer.workbench.ui.dialogs.WorkbenchPreferenceDialog)3 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)1 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)1 WidgetIsFound (org.eclipse.reddeer.core.condition.WidgetIsFound)1 WithMnemonicTextMatcher (org.eclipse.reddeer.core.matcher.WithMnemonicTextMatcher)1 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)1 AfterClass (org.junit.AfterClass)1 BeforeClass (org.junit.BeforeClass)1