Ejemplo n.º 1
0
 @Test
 public void testSize() throws Exception {
   int sizeBefore = testedTable.size();
   testedTable.put("abcdef1", "1");
   testedTable.put("abcdef2", "2");
   testedTable.put("abcdef1", "3");
   Assert.assertEquals(testedTable.size(), sizeBefore + 2);
 }
Ejemplo n.º 2
0
 @Test
 public void testRollback() throws Exception {
   testedTable.put("abc1", "1");
   testedTable.remove("abc1");
   testedTable.put("abc1", "2");
   Assert.assertEquals(testedTable.rollback(), 1);
   Assert.assertNull(testedTable.get("abc1"));
 }
Ejemplo n.º 3
0
 @Test
 public void testComplex() throws Exception {
   testedTable.put("testkey", "testvalue");
   Assert.assertEquals(testedTable.get("testkey"), "testvalue");
   testedTable.put("testkey", "testvalue2");
   Assert.assertEquals(testedTable.remove("testkey"), "testvalue2");
   Assert.assertNull(testedTable.get("abcd"));
   Assert.assertNull(testedTable.remove("abcd"));
 }
Ejemplo n.º 4
0
 @Test
 public void testCommit() throws Exception {
   testedTable.put("abcd1", "1");
   testedTable.put("abcd2", "2");
   Assert.assertEquals(testedTable.commit(), 2);
   Assert.assertEquals(testedTable.get("abcd1"), "1");
   testedTable.remove("abcd1");
   testedTable.remove("abcd2");
   Assert.assertEquals(testedTable.commit(), 2);
   Assert.assertNull(testedTable.get("abcd2"));
 }