コード例 #1
0
ファイル: TestHashStore.java プロジェクト: jkreps/valencia
 @Test
 public void testOverwrite() throws IOException {
   assertNull("Should find no previous record", store.put(record));
   assertEquals("Should find the record by key.", record, this.store.get(key));
   assertEquals("Should find the record by key.", record, this.store.put(record2));
   assertEquals("Should find the record by key.", record2, this.store.get(key));
 }
コード例 #2
0
ファイル: TestHashStore.java プロジェクト: jkreps/valencia
 @Test
 public void testPutGetDelete() throws IOException {
   assertEquals("Empty store", 0, store.count());
   assertNull("Should find no previous record", store.put(record));
   assertEquals("Empty store", 1, store.count());
   assertEquals("Should find the record by key.", record, this.store.get(key));
   assertEquals("Should delete the record and return previous", record, this.store.delete(key));
   assertEquals("Empty store", 0, store.count());
   assertNull("Should not find the record by key.", this.store.get(key));
 }