1 8 9 package com.sleepycat.je.recovery; 10 11 import java.util.Set ; 12 13 import junit.framework.TestCase; 14 15 import com.sleepycat.je.dbi.DatabaseId; 16 import com.sleepycat.je.tree.IN; 17 18 public class LevelRecorderTest extends TestCase { 19 20 public LevelRecorderTest() { 21 } 22 23 public void testRecording () { 24 LevelRecorder recorder = new LevelRecorder(); 25 26 DatabaseId id1 = new DatabaseId(1); 27 DatabaseId id5 = new DatabaseId(5); 28 DatabaseId id10 = new DatabaseId(10); 29 30 int level1 = IN.BIN_LEVEL; 31 int level2 = level1 + 1; 32 int level3 = level1 + 2; 33 int level4 = level1 + 3; 34 35 36 recorder.record(id10, level1); 37 recorder.record(id5, level3); 38 recorder.record(id5, level2); 39 recorder.record(id10, level1); 40 recorder.record(id1, level1); 41 recorder.record(id10, level1); 42 recorder.record(id1, level4); 43 44 48 Set reprocessSet = recorder.getDbsWithDifferentLevels(); 49 assertEquals(2, reprocessSet.size()); 50 assertTrue(reprocessSet.contains(id5)); 51 assertTrue(reprocessSet.contains(id1)); 52 assertFalse(reprocessSet.contains(id10)); 53 } 54 } 55 | Popular Tags |