Search in sources :

Example 6 with DefaultFileMarkerHandler

use of org.apache.maven.plugins.dependency.utils.markers.DefaultFileMarkerHandler in project maven-plugins by apache.

the class TestMarkerFileFilter method testMarkerRelease.

public void testMarkerRelease() throws IOException, ArtifactFilterException, MojoExecutionException {
    DefaultFileMarkerHandler handler = new DefaultFileMarkerHandler(fact.getReleaseArtifact(), outputFolder);
    handler.setMarker();
    MarkerFileFilter filter = new MarkerFileFilter(false, false, false, new DefaultFileMarkerHandler(outputFolder));
    Set<Artifact> result = filter.filter(artifacts);
    assertEquals(1, result.size());
    filter.setOverWriteReleases(true);
    result = filter.filter(artifacts);
    assertEquals(2, result.size());
    assertTrue(handler.clearMarker());
    DependencyTestUtils.removeDirectory(outputFolder);
    assertFalse(outputFolder.exists());
}
Also used : DefaultFileMarkerHandler(org.apache.maven.plugins.dependency.utils.markers.DefaultFileMarkerHandler) Artifact(org.apache.maven.artifact.Artifact)

Aggregations

DefaultFileMarkerHandler (org.apache.maven.plugins.dependency.utils.markers.DefaultFileMarkerHandler)6 Artifact (org.apache.maven.artifact.Artifact)5 File (java.io.File)1 HashSet (java.util.HashSet)1 DependencyArtifactStubFactory (org.apache.maven.plugins.dependency.testUtils.DependencyArtifactStubFactory)1 DependencyStatusSets (org.apache.maven.plugins.dependency.utils.DependencyStatusSets)1