Skip to main content
summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorslewis2008-05-13 05:58:23 +0000
committerslewis2008-05-13 05:58:23 +0000
commitb81430f896205b82ca568dbdfd0da5acc4bfdfc5 (patch)
treef4cccd96002b5ca5dcb407793be336f8d9af208c /tests
parent1e956d6f0dbbd04b0a93adbe63a863f08ad561d8 (diff)
downloadorg.eclipse.ecf-b81430f896205b82ca568dbdfd0da5acc4bfdfc5.tar.gz
org.eclipse.ecf-b81430f896205b82ca568dbdfd0da5acc4bfdfc5.tar.xz
org.eclipse.ecf-b81430f896205b82ca568dbdfd0da5acc4bfdfc5.zip
more tests added
Diffstat (limited to 'tests')
-rwxr-xr-xtests/bundles/org.eclipse.ecf.tests.storage/src/org/eclipse/ecf/tests/securestorage/IDStoreTest.java29
1 files changed, 28 insertions, 1 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 be4f03f42..1b26c7341 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
@@ -60,6 +60,11 @@ public class IDStoreTest extends TestCase {
return idStore.getNode(newGUID);
}
+ protected ISecurePreferences addStringID(String value) throws IDCreateException {
+ final ID newID = IDFactory.getDefault().createStringID(value);
+ return idStore.getNode(newID);
+ }
+
public void testStoreGUID() throws Exception {
final ISecurePreferences prefs = addGUID();
assertNotNull(prefs);
@@ -71,8 +76,30 @@ public class IDStoreTest extends TestCase {
testStoreGUID();
}
- public void testListNamespaces() throws Exception {
+ public void testListEmptyNamespaces() throws Exception {
final ISecurePreferences[] namespaces = idStore.getNamespaceNodes();
assertNotNull(namespaces);
}
+
+ public void testOneNamespace() throws Exception {
+ testStoreGUID();
+ testStoreGUID();
+ final ISecurePreferences[] namespaces = idStore.getNamespaceNodes();
+ assertTrue(namespaces.length == 1);
+ }
+
+ public void testTwoNamespace() throws Exception {
+ testStoreGUID();
+ addStringID("1");
+ final ISecurePreferences[] namespaces = idStore.getNamespaceNodes();
+ 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()));
+ }
}

Back to the top