Package dijjer.io.store

Examples of dijjer.io.store.HashStore


 
  protected void setUp() throws Exception {
    _index = File.createTempFile("dijjer-hstest", ".dat");
    _index.deleteOnExit();
   
    _hs = new HashStore(_index, HS_SIZE);
  }
View Full Code Here


   
    _hs.close();
   
    assertEquals("File length doesn't correspond to HashStore size", _index.length(), HS_SIZE*40);
   
    _hs = new HashStore(_index, HS_SIZE);
   
    VeryLongInteger v = _hs.getHash(new VeryLongIntegerKey(2,2));
    assertEquals("Retrieved VLI was not as expected", v, new VeryLongInteger(4,4));

    // This shouldn't be in there any more as it should have been displayed
    v = _hs.getHash(new VeryLongIntegerKey(0,0));
    assertNull("Object should have been deleted, but wasn't", v);
   
    _hs.put(new VeryLongIntegerKey(20, 20), new VeryLongInteger(400, 400));
   
    v = _hs.getHash(new VeryLongIntegerKey(3,3));
    assertNull("Object should have been deleted, but wasn't", v);
   
    v = _hs.getHash(new VeryLongIntegerKey(2,2));
   
    assertNotNull("Object should have been retained, but wasn't", v);
    assertEquals("Retrieved VLI was not as expected", v, new VeryLongInteger(4,4));
   
    _hs.close();
   
    _hs = new HashStore(_index, HS_SIZE);
   
    v = _hs.getHash(new VeryLongIntegerKey(4,4));
    assertNotNull("Failed to retrieve hash", v);
    assertEquals("Retrieved VLI is not as expected", v, new VeryLongInteger(16, 16));
   
    v = _hs.getHash(new VeryLongIntegerKey(3,3));
    assertNull(v);
   
    _hs.delete(new VeryLongIntegerKey(4,4));
    assertNull(_hs.getHash(new VeryLongIntegerKey(4,4)));
   
    _hs.close();
   
    _hs = new HashStore(_index, HS_SIZE);
   
    assertNull(_hs.getHash(new VeryLongIntegerKey(4,4)));
   
    v = _hs.getHash(new VeryLongIntegerKey(2,2));
   
View Full Code Here

TOP

Related Classes of dijjer.io.store.HashStore

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.