Search in sources :

Example 1 with INamespaceEntry

use of org.eclipse.ecf.storage.INamespaceEntry in project ecf by eclipse.

the class IDStoreTest method testGetLongIDEntries.

public void testGetLongIDEntries() throws Exception {
    final ID newLongID = IDFactory.getDefault().createLongID(1);
    idStore.store(newLongID);
    // Get namespace entry
    final INamespaceEntry namespaceEntry = idStore.getNamespaceEntry(newLongID.getNamespace());
    assertNotNull(namespaceEntry);
    final IIDEntry[] idEntries = namespaceEntry.getIDEntries();
    assertTrue(idEntries.length == 1);
    // Create LongID from idEntry
    final ID persistedLongID = idEntries[0].createID();
    assertNotNull(persistedLongID);
    assertTrue(persistedLongID.equals(newLongID));
}
Also used : IIDEntry(org.eclipse.ecf.storage.IIDEntry) INamespaceEntry(org.eclipse.ecf.storage.INamespaceEntry) ID(org.eclipse.ecf.core.identity.ID)

Example 2 with INamespaceEntry

use of org.eclipse.ecf.storage.INamespaceEntry in project ecf by eclipse.

the class IDStoreTest method testGetIDEntries.

public void testGetIDEntries() throws Exception {
    final ID newGUID = IDFactory.getDefault().createGUID();
    idStore.store(newGUID);
    // Get namespace entry
    final INamespaceEntry namespaceEntry = idStore.getNamespaceEntry(newGUID.getNamespace());
    assertNotNull(namespaceEntry);
    final IIDEntry[] idEntries = namespaceEntry.getIDEntries();
    assertTrue(idEntries.length == 1);
    // Create GUID from idEntry
    final ID persistedGUID = idEntries[0].createID();
    assertNotNull(persistedGUID);
    assertTrue(persistedGUID.equals(newGUID));
}
Also used : IIDEntry(org.eclipse.ecf.storage.IIDEntry) INamespaceEntry(org.eclipse.ecf.storage.INamespaceEntry) ID(org.eclipse.ecf.core.identity.ID)

Aggregations

ID (org.eclipse.ecf.core.identity.ID)2 IIDEntry (org.eclipse.ecf.storage.IIDEntry)2 INamespaceEntry (org.eclipse.ecf.storage.INamespaceEntry)2