Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorslewis2008-05-12 03:10:10 -0400
committerslewis2008-05-12 03:10:10 -0400
commit97a7fc5d19acba7322f140f8debbc55643e00893 (patch)
tree101cc1bdea454494ad1344bd95d776f603e65a99 /tests
parent552af6a32d5a5d071222d3a0fb2fbaa4da1ef5b2 (diff)
downloadorg.eclipse.ecf-97a7fc5d19acba7322f140f8debbc55643e00893.tar.gz
org.eclipse.ecf-97a7fc5d19acba7322f140f8debbc55643e00893.tar.xz
org.eclipse.ecf-97a7fc5d19acba7322f140f8debbc55643e00893.zip
Added to API and implementation
Diffstat (limited to 'tests')
-rwxr-xr-xtests/bundles/org.eclipse.ecf.tests.storage/src/org/eclipse/ecf/tests/securestorage/IDStoreTest.java28
1 files changed, 26 insertions, 2 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 f899d19ad..be4f03f42 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
@@ -14,6 +14,7 @@ package org.eclipse.ecf.tests.securestorage;
import junit.framework.TestCase;
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.IIDStore;
@@ -34,11 +35,19 @@ public class IDStoreTest extends TestCase {
idStore = Activator.getDefault().getIDStore();
}
+ protected void clearStore() {
+ final ISecurePreferences[] namespaces = idStore.getNamespaceNodes();
+ for (int i = 0; i < namespaces.length; i++) {
+ namespaces[i].removeNode();
+ }
+ }
+
/* (non-Javadoc)
* @see junit.framework.TestCase#tearDown()
*/
protected void tearDown() throws Exception {
super.tearDown();
+ clearStore();
idStore = null;
}
@@ -46,9 +55,24 @@ public class IDStoreTest extends TestCase {
assertNotNull(idStore);
}
- public void testStoreGUID() throws Exception {
+ protected ISecurePreferences addGUID() throws IDCreateException {
final ID newGUID = IDFactory.getDefault().createGUID();
- final ISecurePreferences prefs = idStore.getNode(newGUID);
+ return idStore.getNode(newGUID);
+ }
+
+ public void testStoreGUID() throws Exception {
+ final ISecurePreferences prefs = addGUID();
assertNotNull(prefs);
}
+
+ public void testStoreGUIDs() throws Exception {
+ testStoreGUID();
+ testStoreGUID();
+ testStoreGUID();
+ }
+
+ public void testListNamespaces() throws Exception {
+ final ISecurePreferences[] namespaces = idStore.getNamespaceNodes();
+ assertNotNull(namespaces);
+ }
}

Back to the top