// GoldenGateTransactionSCNFinder finder = new GoldenGateTransactionSCNFinder();
GGXMLTrailTransactionFinder finder = new GGXMLTrailTransactionFinder();
posSetter = new TrailFilePositionSetter(dir.getAbsolutePath(), TRAIL_FILENAME_PREFIX);
// SCN 100 is not found because this is the first SCN in the trail file.
FilePositionResult res = posSetter.locateFilePosition(100, finder);
Assert.assertEquals(res.getStatus(),
FilePositionResult.Status.ERROR,
"Result Status for SCN: " + 100 + ", Result: " + res);
// SCN 101 is found
res = posSetter.locateFilePosition(101, finder);
Assert.assertEquals(res.getStatus(), FilePositionResult.Status.FOUND, "Result Status");
Assert.assertEquals(res.getTxnPos().getFile(), "x302", "File found");
Assert.assertEquals(res.getTxnPos().getFileOffset(), 0, "File offset found");
Assert.assertEquals(res.getTxnPos().getLineNumber(), 1, "File line number found");
Assert.assertEquals(res.getTxnPos().getMinScn(), 101, "MinScn check");
Assert.assertEquals(res.getTxnPos().getMaxScn(), 101, "MinScn check");
Assert.assertEquals(res.getTxnPos().getTxnRank(), 10, "Txn Rank");
// SCN 102 is found
res = posSetter.locateFilePosition(102, finder);
Assert.assertEquals(res.getStatus(), FilePositionResult.Status.FOUND, "Result Status");
Assert.assertEquals(res.getTxnPos().getFile(), "x304", "File found");
Assert.assertEquals(res.getTxnPos().getFileOffset(), 0, "File offset found");
Assert.assertEquals(res.getTxnPos().getLineNumber(), 1, "File line number found");
Assert.assertEquals(res.getTxnPos().getMinScn(), 102, "MinScn check");
Assert.assertEquals(res.getTxnPos().getMaxScn(), 102, "MinScn check");
Assert.assertEquals(res.getTxnPos().getTxnRank(), 10, "Txn Rank");
// SCN 103 is found
res = posSetter.locateFilePosition(103, finder);
Assert.assertEquals(res.getStatus(), FilePositionResult.Status.FOUND, "Result Status");
Assert.assertEquals(res.getTxnPos().getFile(), "x306", "File found");
Assert.assertEquals(res.getTxnPos().getFileOffset(), 0, "File offset found");
Assert.assertEquals(res.getTxnPos().getLineNumber(), 1, "File line number found");
Assert.assertEquals(res.getTxnPos().getMinScn(), 103, "MinScn check");
Assert.assertEquals(res.getTxnPos().getMaxScn(), 103, "MinScn check");
Assert.assertEquals(res.getTxnPos().getTxnRank(), 10, "Txn Rank");
// SCN 104 is found
res = posSetter.locateFilePosition(104, finder);
Assert.assertEquals(res.getStatus(), FilePositionResult.Status.FOUND, "Result Status");
Assert.assertEquals(res.getTxnPos().getFile(), "x308", "File found");
Assert.assertEquals(res.getTxnPos().getFileOffset(), 0, "File offset found");
Assert.assertEquals(res.getTxnPos().getLineNumber(), 1, "File line number found");
Assert.assertEquals(res.getTxnPos().getMinScn(), 104, "MinScn check");
Assert.assertEquals(res.getTxnPos().getMaxScn(), 104, "MinScn check");
Assert.assertEquals(res.getTxnPos().getTxnRank(), 10, "Txn Rank");
}