1 8 9 package com.sleepycat.je.log; 10 11 import junit.framework.TestCase; 12 13 import com.sleepycat.je.DatabaseException; 14 import com.sleepycat.je.log.entry.LogEntry; 15 16 18 public class LogEntryTest extends TestCase { 19 20 public void testEquality() 21 throws DatabaseException { 22 23 byte testTypeNum = LogEntryType.LOG_IN.getTypeNum(); 24 byte testVersion = LogEntryType.LOG_IN.getVersion(); 25 byte testProvisionalVersion = 26 LogEntryType.setProvisional(testVersion); 27 28 29 LogEntryType foundType = LogEntryType.findType(testTypeNum, 30 testVersion); 31 assertEquals(foundType, LogEntryType.LOG_IN); 32 assertTrue(foundType.getSharedLogEntry() instanceof 33 com.sleepycat.je.log.entry.INLogEntry); 34 35 36 foundType = LogEntryType.findType(testTypeNum, 37 testProvisionalVersion); 38 assertEquals(foundType, LogEntryType.LOG_IN); 39 assertTrue(foundType.getSharedLogEntry() instanceof 40 com.sleepycat.je.log.entry.INLogEntry); 41 42 43 LogEntry sharedEntry = foundType.getSharedLogEntry(); 44 LogEntry newEntry = foundType.getNewLogEntry(); 45 46 assertTrue(sharedEntry != newEntry); 47 } 48 } 49 | Popular Tags |