use of org.apache.maven.plugins.dependency.testUtils.DependencyArtifactStubFactory in project maven-plugins by apache.
the class TestResolveMarkerFileFilter method setUp.
protected void setUp() throws Exception {
super.setUp();
outputFolder = new File("target/markers/");
DependencyTestUtils.removeDirectory(outputFolder);
assertFalse(outputFolder.exists());
this.fact = new DependencyArtifactStubFactory(outputFolder, false);
artifacts = fact.getReleaseAndSnapshotArtifacts();
}
use of org.apache.maven.plugins.dependency.testUtils.DependencyArtifactStubFactory in project maven-plugins by apache.
the class TestClassifierTypeTranslator method setUp.
protected void setUp() throws Exception {
super.setUp("classifiertype-translator", false);
artifactHandlerManager = new DefaultArtifactHandlerManager();
this.setVariableValueToObject(artifactHandlerManager, "artifactHandlers", new HashMap());
artifactFactory = new DefaultArtifactFactory();
this.setVariableValueToObject(artifactFactory, "artifactHandlerManager", artifactHandlerManager);
artifactRepository = new StubArtifactRepository(null);
DependencyArtifactStubFactory factory = new DependencyArtifactStubFactory(null, false);
artifacts = factory.getMixedArtifacts();
repoManager = lookup(RepositoryManager.class);
MavenSession session = newMavenSession(new MavenProjectStub());
buildingRequest = session.getProjectBuildingRequest();
DefaultRepositorySystemSession repoSession = (DefaultRepositorySystemSession) session.getRepositorySession();
repoSession.setLocalRepositoryManager(new SimpleLocalRepositoryManager(stubFactory.getWorkingDir()));
}
use of org.apache.maven.plugins.dependency.testUtils.DependencyArtifactStubFactory in project maven-dependency-plugin by apache.
the class AbstractDependencyMojoTestCase method setUp.
protected void setUp(String testDirStr, boolean createFiles, boolean flattenedPath) throws Exception {
// required for mojo lookups to work
super.setUp();
testDir = new File(getBasedir(), "target" + File.separatorChar + "unit-tests" + File.separatorChar + testDirStr + File.separatorChar);
DependencyTestUtils.removeDirectory(testDir);
assertFalse(testDir.exists());
stubFactory = new DependencyArtifactStubFactory(this.testDir, createFiles, flattenedPath);
}
use of org.apache.maven.plugins.dependency.testUtils.DependencyArtifactStubFactory in project maven-plugins by apache.
the class TestAnalyzeDepMgt method setUp.
protected void setUp() throws Exception {
mojo = new AnalyzeDepMgt();
MavenProject project = new DependencyProjectStub();
stubFactory = new DependencyArtifactStubFactory(new File(""), false);
Set<Artifact> allArtifacts = stubFactory.getMixedArtifacts();
Set<Artifact> directArtifacts = stubFactory.getClassifiedArtifacts();
exclusionArtifact = stubFactory.getReleaseArtifact();
directArtifacts.add(exclusionArtifact);
ex = new Exclusion();
ex.setArtifactId(exclusionArtifact.getArtifactId());
ex.setGroupId(exclusionArtifact.getGroupId());
exclusion = new Dependency();
exclusion.setArtifactId(exclusionArtifact.getArtifactId());
exclusion.setGroupId(exclusionArtifact.getGroupId());
exclusion.setType(exclusionArtifact.getType());
exclusion.setClassifier("");
exclusion.setVersion("3.0");
exclusion.addExclusion(ex);
List<Dependency> list = new ArrayList<Dependency>();
list.add(exclusion);
depMgt = new DependencyManagement();
depMgt.setDependencies(list);
project.setArtifacts(allArtifacts);
project.setDependencyArtifacts(directArtifacts);
mojo.setProject(project);
}
use of org.apache.maven.plugins.dependency.testUtils.DependencyArtifactStubFactory in project maven-plugins by apache.
the class TestDestFileFilter method setUp.
protected void setUp() throws Exception {
super.setUp();
outputFolder = new File("target/markers/");
DependencyTestUtils.removeDirectory(outputFolder);
assertFalse(outputFolder.exists());
this.fact = new DependencyArtifactStubFactory(outputFolder, false);
artifacts = fact.getReleaseAndSnapshotArtifacts();
}
Aggregations