use of org.commonjava.maven.ext.core.ManipulationSession in project pom-manipulation-ext by release-engineering.
the class ResolveArtifactTest method testResolveArtifacts.
@Test
public void testResolveArtifacts() throws Exception {
final ManipulationSession session = new ManipulationSession();
// Locate the PME project pom file.
final File projectroot = new File(TestUtils.resolveFileResource("properties/", "").getParentFile().getParentFile().getParentFile().getParentFile(), "pom.xml");
PomIO pomIO = new PomIO();
List<Project> projects = pomIO.parseProject(projectroot);
Set<ArtifactRef> artifacts = RESTCollector.establishAllDependencies(session, projects, null);
// NB If this test fails then check if PME deps/plugins have changed...
assertTrue(artifacts.size() == 59);
}
use of org.commonjava.maven.ext.core.ManipulationSession in project pom-manipulation-ext by release-engineering.
the class ProjectInheritanceTest method testVerifyProjectVersion.
@Test
public void testVerifyProjectVersion() throws Exception {
final ManipulationSession session = new ManipulationSession();
final File projectroot = new File(TestUtils.resolveFileResource(RESOURCE_BASE, "").getParentFile().getParentFile().getParentFile().getParentFile(), "integration-test/src/it/project-inheritance/pom.xml");
PomIO pomIO = new PomIO();
List<Project> projects = pomIO.parseProject(projectroot);
for (Project p : projects) {
if (p.getPom().equals(projectroot)) {
HashMap<ArtifactRef, Dependency> deps = p.getResolvedManagedDependencies(session);
for (ArtifactRef a : deps.keySet()) {
assertFalse(a.getVersionString().contains("project.version"));
}
deps = p.getResolvedDependencies(session);
assertTrue(deps.size() == 1);
for (ArtifactRef a : deps.keySet()) {
assertFalse(a.getVersionString().contains("project.version"));
}
assertFalse(deps.containsKey("org.mockito:mockito-all:jar:*"));
deps = p.getAllResolvedDependencies(session);
assertTrue(deps.size() == 3);
for (ArtifactRef a : deps.keySet()) {
assertFalse(a.getVersionString().contains("project.version"));
if (a.getGroupId().equals("org.mockito")) {
assertTrue(a.getVersionString().contains("*"));
}
}
assertTrue(deps.containsKey(SimpleArtifactRef.parse("org.mockito:mockito-all:jar:*")));
}
}
}
use of org.commonjava.maven.ext.core.ManipulationSession in project pom-manipulation-ext by release-engineering.
the class PropertyInterpolatorTest method testResolveProjectDependencies.
@Test
public void testResolveProjectDependencies() throws Exception {
final Model model = TestUtils.resolveModelResource(RESOURCE_BASE, "infinispan-bom-8.2.0.Final.pom");
final Project project = new Project(model);
HashMap<ArtifactRef, Dependency> deps = project.getResolvedManagedDependencies(new ManipulationSession());
assertTrue(deps.size() == 66);
}
Aggregations