Skip to content

SecureStorage

jbdevstudioqajenkins edited this page Aug 19, 2016 · 58 revisions

Secure Storage support

Red Deer supports handling Secure Storage dialogs. Current implementation allows you just to turn on/off the secure storage (it's mostly about disabling a prompt on master password which causes triggering secure storage) but later versions will provide much more convenient way to handle secure storage, handling passwords etc.

To disable secure storage, use following chunk of code:

package org.jboss.reddeer.snippet.test.example;

import org.jboss.reddeer.eclipse.equinox.security.ui.StoragePreferencePage;
import org.jboss.reddeer.workbench.ui.dialogs.WorkbenchPreferenceDialog;
import org.jboss.reddeer.swt.api.TableItem;
import org.junit.Test;

public class SecureStorageExample {

	@Test
	public void disableSecureStorage() {
		WorkbenchPreferenceDialog preferenceDialog = new WorkbenchPreferenceDialog();
		StoragePreferencePage storagePage = new StoragePreferencePage();

		preferenceDialog.open();

		preferenceDialog.select(storagePage);
		for (TableItem item : storagePage.getMasterPasswordProviders()) {
			item.setChecked(true);
		}

		storagePage.apply();
		preferenceDialog.ok();
	}
}

source code

Clone this wiki locally