Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2008-05-13 15:08:28 -0400
committerslewis2008-05-13 15:08:28 -0400
commit9a81a3ff9f6bf10ea57121b7260a56deff9b57fc (patch)
tree1f0a1e4492a1d3b5adc33a04d17e21ab1ed95c55
parentb81430f896205b82ca568dbdfd0da5acc4bfdfc5 (diff)
downloadorg.eclipse.ecf-9a81a3ff9f6bf10ea57121b7260a56deff9b57fc.tar.gz
org.eclipse.ecf-9a81a3ff9f6bf10ea57121b7260a56deff9b57fc.tar.xz
org.eclipse.ecf-9a81a3ff9f6bf10ea57121b7260a56deff9b57fc.zip
Refactoring of IIDStore API
-rwxr-xr-xtests/bundles/org.eclipse.ecf.tests.storage/src/org/eclipse/ecf/tests/securestorage/IDStoreTest.java30
1 files changed, 16 insertions, 14 deletions
diff --git a/tests/bundles/org.eclipse.ecf.tests.storage/src/org/eclipse/ecf/tests/securestorage/IDStoreTest.java b/tests/bundles/org.eclipse.ecf.tests.storage/src/org/eclipse/ecf/tests/securestorage/IDStoreTest.java
index 1b26c7341..fd1afac81 100755
--- a/tests/bundles/org.eclipse.ecf.tests.storage/src/org/eclipse/ecf/tests/securestorage/IDStoreTest.java
+++ b/tests/bundles/org.eclipse.ecf.tests.storage/src/org/eclipse/ecf/tests/securestorage/IDStoreTest.java
@@ -17,7 +17,9 @@ import org.eclipse.ecf.core.identity.ID;
import org.eclipse.ecf.core.identity.IDCreateException;
import org.eclipse.ecf.core.identity.IDFactory;
import org.eclipse.ecf.internal.tests.securestorage.Activator;
+import org.eclipse.ecf.storage.IIDEntry;
import org.eclipse.ecf.storage.IIDStore;
+import org.eclipse.ecf.storage.INamespaceEntry;
import org.eclipse.equinox.security.storage.ISecurePreferences;
/**
@@ -36,9 +38,9 @@ public class IDStoreTest extends TestCase {
}
protected void clearStore() {
- final ISecurePreferences[] namespaces = idStore.getNamespaceNodes();
+ final INamespaceEntry[] namespaces = idStore.getNamespaceEntries();
for (int i = 0; i < namespaces.length; i++) {
- namespaces[i].removeNode();
+ namespaces[i].delete();
}
}
@@ -55,18 +57,18 @@ public class IDStoreTest extends TestCase {
assertNotNull(idStore);
}
- protected ISecurePreferences addGUID() throws IDCreateException {
+ protected IIDEntry addGUID() throws IDCreateException {
final ID newGUID = IDFactory.getDefault().createGUID();
- return idStore.getNode(newGUID);
+ return idStore.getEntry(newGUID);
}
- protected ISecurePreferences addStringID(String value) throws IDCreateException {
+ protected IIDEntry addStringID(String value) throws IDCreateException {
final ID newID = IDFactory.getDefault().createStringID(value);
- return idStore.getNode(newID);
+ return idStore.getEntry(newID);
}
public void testStoreGUID() throws Exception {
- final ISecurePreferences prefs = addGUID();
+ final ISecurePreferences prefs = addGUID().getPreferences();
assertNotNull(prefs);
}
@@ -77,29 +79,29 @@ public class IDStoreTest extends TestCase {
}
public void testListEmptyNamespaces() throws Exception {
- final ISecurePreferences[] namespaces = idStore.getNamespaceNodes();
+ final INamespaceEntry[] namespaces = idStore.getNamespaceEntries();
assertNotNull(namespaces);
}
public void testOneNamespace() throws Exception {
testStoreGUID();
testStoreGUID();
- final ISecurePreferences[] namespaces = idStore.getNamespaceNodes();
+ final INamespaceEntry[] namespaces = idStore.getNamespaceEntries();
assertTrue(namespaces.length == 1);
}
public void testTwoNamespace() throws Exception {
testStoreGUID();
addStringID("1");
- final ISecurePreferences[] namespaces = idStore.getNamespaceNodes();
+ final INamespaceEntry[] namespaces = idStore.getNamespaceEntries();
assertTrue(namespaces.length == 2);
}
public void testGetNamespaceNode() throws Exception {
final ID newGUID = IDFactory.getDefault().createGUID();
- idStore.getNode(newGUID);
- final ISecurePreferences prefs = idStore.getNamespaceNode(newGUID.getNamespace());
- assertNotNull(prefs);
- assertTrue(prefs.name().equals(newGUID.getNamespace().getName()));
+ idStore.getEntry(newGUID);
+ final ISecurePreferences namespacePrefs = idStore.getNamespaceEntry(newGUID.getNamespace()).getPreferences();
+ assertNotNull(namespacePrefs);
+ assertTrue(namespacePrefs.name().equals(newGUID.getNamespace().getName()));
}
}

Back to the top