Artifact snap = fileFact.getSnapshotArtifact();
Artifact release = fileFact.getReleaseArtifact();
Set<Artifact> tempArtifacts = new HashSet<Artifact>();
tempArtifacts.add( snap );
tempArtifacts.add( release );
DefaultFileMarkerHandler handler = new DefaultFileMarkerHandler( snap, outputFolder );
handler.setMarker();
snap.getFile().setLastModified( snap.getFile().lastModified() + 1500 );
MarkerFileFilter filter = new MarkerFileFilter( false, false, true, new DefaultFileMarkerHandler( outputFolder ) );
Set<Artifact> result = filter.filter( tempArtifacts );
assertEquals( 2, result.size() );
// update marker; filter won't include snapshot because timestamps equal
handler.setMarker();
result = filter.filter( tempArtifacts );
assertEquals( 1, result.size() );
// filter won't include snapshot because it is older than marker
snap.getFile().setLastModified( snap.getFile().lastModified() - 10000 );
result = filter.filter( tempArtifacts );
assertEquals( 1, result.size() );
assertTrue( handler.clearMarker() );
assertFalse( handler.isMarkerSet() );
snap.getFile().delete();
release.getFile().delete();
DependencyTestUtils.removeDirectory( outputFolder );
assertFalse( outputFolder.exists() );
}