use of org.commonjava.maven.ext.core.ManipulationSession in project pom-manipulation-ext by release-engineering.
the class DistributionEnforcingManipulatorTest method before.
@Before
public void before() throws Exception {
userCliProperties = new Properties();
session = new ManipulationSession();
final GalleyInfrastructure galleyInfra = new GalleyInfrastructure(session.getTargetDir(), session.getRemoteRepositories(), session.getLocalRepository(), session.getSettings(), session.getActiveProfiles(), null, null, null, temp.newFolder("cache-dir"));
final GalleyAPIWrapper wrapper = new GalleyAPIWrapper(galleyInfra);
manipulator = new DistributionEnforcingManipulator();
FieldUtils.writeField(manipulator, "galleyWrapper", wrapper, true);
}
use of org.commonjava.maven.ext.core.ManipulationSession in project pom-manipulation-ext by release-engineering.
the class PropertiesUtilsTest method testUpdateNestedProperties2.
@Test
public void testUpdateNestedProperties2() throws Exception {
Project pP = getProject();
ManipulationSession session = createUpdateSession();
assertTrue(updateProperties(session, pP, false, "version.hibernate.osgi", "5.0.4.Final-redhat-1") == PropertiesUtils.PropertyUpdate.FOUND);
assertFalse(updateProperties(session, pP, false, "version.scala", "2.11.7") == PropertiesUtils.PropertyUpdate.FOUND);
}
use of org.commonjava.maven.ext.core.ManipulationSession in project pom-manipulation-ext by release-engineering.
the class PropertiesUtilsTest method testResolvePluginsProject.
@Test
public void testResolvePluginsProject() throws Exception {
final Model modelChild = TestUtils.resolveModelResource(RESOURCE_BASE, "inherited-properties.pom");
ManipulationSession session = createUpdateSession();
Project pC = new Project(modelChild);
assertTrue(pC.getResolvedPlugins(session).size() == 0);
assertTrue(pC.getResolvedManagedPlugins(session).size() == 0);
}
use of org.commonjava.maven.ext.core.ManipulationSession in project pom-manipulation-ext by release-engineering.
the class PropertiesUtilsTest method createUpdateSession.
private ManipulationSession createUpdateSession() throws Exception {
ManipulationSession session = new ManipulationSession();
session.setState(new DependencyState(p));
session.setState(new VersioningState(p));
session.setState(new CommonState(p));
final MavenExecutionRequest req = new DefaultMavenExecutionRequest().setUserProperties(p).setRemoteRepositories(Collections.<ArtifactRepository>emptyList());
final PlexusContainer container = new DefaultPlexusContainer();
final MavenSession mavenSession = new MavenSession(container, null, req, new DefaultMavenExecutionResult());
session.setMavenSession(mavenSession);
return session;
}
use of org.commonjava.maven.ext.core.ManipulationSession in project pom-manipulation-ext by release-engineering.
the class PropertiesUtilsTest method testCheckStrictValue.
@Test
public void testCheckStrictValue() throws Exception {
ManipulationSession session = createUpdateSession();
assertFalse(PropertiesUtils.checkStrictValue(session, null, "1.0"));
assertFalse(PropertiesUtils.checkStrictValue(session, "1.0", null));
assertFalse(PropertiesUtils.checkStrictValue(session, "1.0.0.Final", "1.0.0.redhat-1"));
assertTrue(PropertiesUtils.checkStrictValue(session, "1.0.0", "1.0.0.redhat-1"));
assertTrue(PropertiesUtils.checkStrictValue(session, "1.0.0-SNAPSHOT", "1.0.0.redhat-1"));
assertFalse(PropertiesUtils.checkStrictValue(session, "1.0.Final-SNAPSHOT", "1.0.0.redhat-1"));
assertTrue(PropertiesUtils.checkStrictValue(session, "1.0-SNAPSHOT", "1.0.0.redhat-1"));
}
Aggregations