Search in sources :

Example 1 with ModelIO

use of org.commonjava.maven.ext.io.ModelIO 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)

Aggregations

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