final Logger log = Logger.getLogger("TestTrailFilePositionSetter.testTrailFileComparator");
log.info("starting");
String prefix = "x4";
File dir = new File("/tmp");
FileFilter f = new TrailFilePositionSetter.FileFilter(dir,prefix);
//isTrailFile Check
Assert.assertFalse(f.isTrailFile(null),"Null trail file");
Assert.assertFalse(f.isTrailFile(dir),"Dir as trail file");
Assert.assertFalse(f.isTrailFile(new File("")),"Empty trail file name");
Assert.assertFalse(f.isTrailFile(new File("/tmp/x12222")),"trail file with different prefix");
Assert.assertFalse(f.isTrailFile(new File("/tmp/42222")),"trail file with different prefix");
Assert.assertFalse(f.isTrailFile(new File("/tmp/x412222.xml")),"trail file with bad suffix");
Assert.assertFalse(f.isTrailFile(new File("/tmp/x412222x")),"trail file with bad suffix");
Assert.assertTrue(f.isTrailFile(new File("/tmp/x4122222")),"correct trail file");
Assert.assertTrue(f.isTrailFile(new File("x4122222")),"correct trail file");
//compareTo Check
Assert.assertEquals(-1, f.compareFileName(new File("/tmp/x400001"), new File("/tmp/x400002")));
Assert.assertEquals(-1, f.compareFileName(new File("/tmp/x400001"), new File("/tmp/x400002"))); // DUPLICATE?
Assert.assertEquals(1, f.compareFileName(new File("/tmp/x410001"), new File("/tmp/x400002")));
Assert.assertEquals(1, f.compareFileName(new File("/tmp/x410009"), new File("/tmp/x410003")));
Assert.assertEquals(0, f.compareFileName(new File("/tmp/x410009"), new File("/tmp/x410009")));
//isNextFileInSeq
Assert.assertFalse(f.isNextFileInSequence(new File("/tmp/x400000"), new File("/tmp/x400000")));
Assert.assertFalse(f.isNextFileInSequence(new File("/tmp/x410000"), new File("/tmp/x400000")));
Assert.assertFalse(f.isNextFileInSequence(new File("/tmp/x400001"), new File("/tmp/x400000")));
Assert.assertTrue(f.isNextFileInSequence(new File("/tmp/x400000"), new File("/tmp/x400001")));
log.info(DONE_STRING);
}