use of org.jboss.tools.openshift.internal.common.core.security.SecureStore in project jbosstools-openshift by jbosstools.
the class Connection method load.
protected String load(String id) {
String value = null;
SecureStore store = getSecureStore(getHost(), getUsername());
if (store != null) {
try {
value = store.get(id);
} catch (SecureStoreException e) {
OpenShiftCoreActivator.pluginLog().logError(e.getMessage(), e);
}
}
return value;
}
use of org.jboss.tools.openshift.internal.common.core.security.SecureStore in project jbosstools-openshift by jbosstools.
the class SecureStorageTest method setUp.
@BeforeClass
public static void setUp() throws CoreException {
key = new OpenShiftSecureStorageKey("org.jboss.tools.openshift.test", "localhost", "foobar");
store = new SecureStore(key);
}
use of org.jboss.tools.openshift.internal.common.core.security.SecureStore in project jbosstools-openshift by jbosstools.
the class SecureStorageTest method shouldRemoveNode.
@Test
public void shouldRemoveNode() throws SecureStoreException {
// pre-condition
IStoreKey key = new OpenShiftSecureStorageKey("org.jboss.tools.openshift.test", "localhost", "foobar");
SecureStore store = new SecureStore(key);
store.put("password", "chocolate");
assertTrue(SecurePreferencesFactory.getDefault().nodeExists(key.getKey()));
// operation
store.removeNode();
// verification
assertFalse(SecurePreferencesFactory.getDefault().nodeExists(key.getKey()));
}
Aggregations