use of org.jumpmind.symmetric.model.FileTrigger in project symmetric-ds by JumpMind.
the class FileTriggerTrackerTest method testTakeFullSnapshotNonRecursive.
@Test
public void testTakeFullSnapshotNonRecursive() throws Exception {
FileTrigger fileTrigger = new FileTrigger(directory.getAbsolutePath(), false, null, null);
Router router = new Router();
FileTriggerRouter fileTriggerRouter = new FileTriggerRouter(fileTrigger, router);
FileTriggerTracker tracker = new FileTriggerTracker(fileTriggerRouter, null, null, false, null);
DirectorySnapshot snapshot = new DirectorySnapshot(fileTriggerRouter);
tracker.takeFullSnapshot(snapshot);
assertEquals(2, snapshot.size());
}
use of org.jumpmind.symmetric.model.FileTrigger in project symmetric-ds by JumpMind.
the class FileTriggerTrackerTest method testTakeFullSnapshotIncludes.
@Test
public void testTakeFullSnapshotIncludes() throws Exception {
FileTrigger fileTrigger = new FileTrigger(directory.getAbsolutePath(), false, "*.txt", null);
Router router = new Router();
FileTriggerRouter fileTriggerRouter = new FileTriggerRouter(fileTrigger, router);
FileTriggerTracker tracker = new FileTriggerTracker(fileTriggerRouter, null, null, false, null);
DirectorySnapshot snapshot = new DirectorySnapshot(fileTriggerRouter);
tracker.takeFullSnapshot(snapshot);
assertEquals(1, snapshot.size());
assertEquals(snapshot.get(0).getFileName(), FileSyncUtils.getRelativePath(fileInDirectory1, directory));
}
use of org.jumpmind.symmetric.model.FileTrigger in project symmetric-ds by JumpMind.
the class FileTriggerTrackerTest method testTakeFullSnapshotExcludes.
@Test
public void testTakeFullSnapshotExcludes() throws Exception {
FileTrigger fileTrigger = new FileTrigger(directory.getAbsolutePath(), false, null, "*.txt");
Router router = new Router();
FileTriggerRouter fileTriggerRouter = new FileTriggerRouter(fileTrigger, router);
FileTriggerTracker tracker = new FileTriggerTracker(fileTriggerRouter, null, null, false, null);
DirectorySnapshot snapshot = new DirectorySnapshot(fileTriggerRouter);
tracker.takeFullSnapshot(snapshot);
assertEquals(1, snapshot.size());
assertEquals(snapshot.get(0).getFileName(), FileSyncUtils.getRelativePath(fileInDirectory2, directory));
}
Aggregations