Search in sources :

Example 1 with GalleyAPIWrapper

use of org.commonjava.maven.ext.io.resolver.GalleyAPIWrapper in project pom-manipulation-ext by release-engineering.

the class ModelResolverTest method resolveArtifactTest.

@Test(expected = ManipulationException.class)
@BMRule(name = "retrieve-first-null", targetClass = "ArtifactManagerImpl", targetMethod = "retrieveFirst(List<? extends Location> locations, ArtifactRef ref)", targetLocation = "AT ENTRY", action = "RETURN null")
public void resolveArtifactTest() throws Exception {
    final ManipulationSession 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);
    final ModelIO model = new ModelIO();
    FieldUtils.writeField(model, "galleyWrapper", wrapper, true);
    model.resolveRawModel(SimpleProjectVersionRef.parse("org.commonjava:commonjava:5"));
}
Also used : GalleyInfrastructure(org.commonjava.maven.ext.io.resolver.GalleyInfrastructure) ModelIO(org.commonjava.maven.ext.io.ModelIO) ManipulationSession(org.commonjava.maven.ext.core.ManipulationSession) GalleyAPIWrapper(org.commonjava.maven.ext.io.resolver.GalleyAPIWrapper) BMRule(org.jboss.byteman.contrib.bmunit.BMRule) Test(org.junit.Test)

Example 2 with GalleyAPIWrapper

use of org.commonjava.maven.ext.io.resolver.GalleyAPIWrapper 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);
}
Also used : GalleyInfrastructure(org.commonjava.maven.ext.io.resolver.GalleyInfrastructure) ManipulationSession(org.commonjava.maven.ext.core.ManipulationSession) GalleyAPIWrapper(org.commonjava.maven.ext.io.resolver.GalleyAPIWrapper) Properties(java.util.Properties) Before(org.junit.Before)

Aggregations

ManipulationSession (org.commonjava.maven.ext.core.ManipulationSession)2 GalleyAPIWrapper (org.commonjava.maven.ext.io.resolver.GalleyAPIWrapper)2 GalleyInfrastructure (org.commonjava.maven.ext.io.resolver.GalleyInfrastructure)2 Properties (java.util.Properties)1 ModelIO (org.commonjava.maven.ext.io.ModelIO)1 BMRule (org.jboss.byteman.contrib.bmunit.BMRule)1 Before (org.junit.Before)1 Test (org.junit.Test)1