Skip to content

SecureStorage

jbdevstudioqajenkins edited this page Jun 22, 2015 · 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.eclipse.jdt.ui.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