Пример #1
0
  public void testEquality() throws DatabaseException {

    byte testTypeNum = LogEntryType.LOG_IN.getTypeNum();
    byte testVersion = LogEntryType.LOG_IN.getVersion();
    byte testProvisionalVersion = LogEntryType.setEntryProvisional(testVersion);

    /* Look it up by type name and version */
    LogEntryType foundType = LogEntryType.findType(testTypeNum, testVersion);
    assertEquals(foundType, LogEntryType.LOG_IN);
    assertTrue(foundType.getSharedLogEntry() instanceof com.sleepycat.je.log.entry.INLogEntry);

    /* Look it up by type name and provisional version */
    foundType = LogEntryType.findType(testTypeNum, testProvisionalVersion);
    assertEquals(foundType, LogEntryType.LOG_IN);
    assertTrue(foundType.getSharedLogEntry() instanceof com.sleepycat.je.log.entry.INLogEntry);

    /* Get a new entry object */
    LogEntry sharedEntry = foundType.getSharedLogEntry();
    LogEntry newEntry = foundType.getNewLogEntry();

    assertTrue(sharedEntry != newEntry);
  }
Пример #2
0
  public void testEquality() throws DatabaseException {

    byte testTypeNum = LogEntryType.LOG_IN.getTypeNum();

    /* Look it up by type */
    LogEntryType foundType = LogEntryType.findType(testTypeNum);
    assertEquals(foundType, LogEntryType.LOG_IN);
    assertTrue(foundType.getSharedLogEntry() instanceof com.sleepycat.je.log.entry.INLogEntry);

    /* Look it up by type */
    foundType = LogEntryType.findType(testTypeNum);
    assertEquals(foundType, LogEntryType.LOG_IN);
    assertTrue(foundType.getSharedLogEntry() instanceof com.sleepycat.je.log.entry.INLogEntry);

    /* Get a new entry object */
    LogEntry sharedEntry = foundType.getSharedLogEntry();
    LogEntry newEntry = foundType.getNewLogEntry();

    assertTrue(sharedEntry != newEntry);
  }