use of org.eclipse.reddeer.eclipse.equinox.security.ui.storage.StoragePreferencePage 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();
}
use of org.eclipse.reddeer.eclipse.equinox.security.ui.storage.StoragePreferencePage 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();
}
use of org.eclipse.reddeer.eclipse.equinox.security.ui.storage.StoragePreferencePage 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();
}
}
use of org.eclipse.reddeer.eclipse.equinox.security.ui.storage.StoragePreferencePage in project jbosstools-openshift by jbosstools.
the class SecureStorage method verifySecureStorageOfPassword.
/**
* Verifies whether state of password storage for specified user is in correct
* state.
*
* @param username
* @param server
* URL of OpenShift server without https prefix
* @param shouldExist
* if true, password should be present in secure storage, if false,
* there should be no password in secure storage for specified
* connection
* @param serverType
* OpenShift v2 or v3 server
*/
public static void verifySecureStorageOfPassword(String username, String server, boolean shouldExist) {
WorkbenchPreferenceDialog workbenchPreferenceDialog = new WorkbenchPreferenceDialog();
StoragePreferencePage secureStoragePreferencePage = new StoragePreferencePage(workbenchPreferenceDialog);
new WorkbenchShell().setFocus();
workbenchPreferenceDialog.open();
new WorkbenchPreferenceDialog().select(secureStoragePreferencePage);
secureStoragePreferencePage.selectContentTab();
boolean exists = secureStoragePreferencePage.passwordExists("[Default Secure Storage]", getPluginId(), server, username);
workbenchPreferenceDialog.ok();
assertTrue(shouldExist ? "Password wasn't present in secure storage while it should." : "Password was present in secure storage but it shouldn't.", shouldExist == exists);
}
use of org.eclipse.reddeer.eclipse.equinox.security.ui.storage.StoragePreferencePage in project jbosstools-openshift by jbosstools.
the class GetOpenShiftIOTokenTest method checkPluginInSecureStorage.
private void checkPluginInSecureStorage() {
WorkbenchPreferenceDialog preferences = new WorkbenchPreferenceDialog();
preferences.open();
StoragePreferencePage storagePreferencePage = new StoragePreferencePage(preferences);
preferences.select(storagePreferencePage);
storagePreferencePage.selectContentTab();
DefaultTreeItem account = new DefaultTreeItem(new DefaultTree(storagePreferencePage, 1), "[Default Secure Storage]", "org.jboss.tools.openshift.io.core", "accounts", "OpenShift.io", DatastoreOS3.OPENSHIFT_IO_USERNAME);
account.select();
assertNotNull("Account does not exists in secure storage", account);
preferences.ok();
}
Aggregations