@Test
public void testFailureMode_MalformedLastTransactionInLastFile()
  throws Exception
{

  final Logger log = Logger.getLogger("TestTrailFilePositionSetter.testFailureMode_MalformedLastTransactionInLastFile");
  log.info("starting");
  File dir = createTempDir();
  // first SCN is hardcoded always to be 100
  createTrailFiles(dir.getAbsolutePath(), TRAIL_FILENAME_PREFIX, 150 /* numTxns, 24 lines and 2 SCNs each */,
                   1250 /* numLinesPerFile */, 1 /* numLinesPerNewline */, "\n", 0,
                   399 /* corrupt last SCN in 3rd file */, "quux", false, "");
  TrailFilePositionSetter posSetter = new TrailFilePositionSetter(dir.getAbsolutePath(), TRAIL_FILENAME_PREFIX);
  GGXMLTrailTransactionFinder finder = new GGXMLTrailTransactionFinder();
  FilePositionResult res;
  // corruption at SCN 399 => should get 398 back (same transaction, but again, regexQuery() doesn't fully validate)
  res = posSetter.locateFilePosition(TrailFilePositionSetter.USE_LATEST_SCN, finder);
  assertFilePositionResult(res, dir, 398, FilePositionResult.Status.FOUND);
  log.info(DONE_STRING);
}