use of org.jboss.galleon.universe.maven.MavenUniverseException in project galleon by wildfly.
the class MavenUniverseLocationTestCase method testUniverseVersion.
@Test
public void testUniverseVersion() throws Exception {
final MavenArtifact universeArt = new MavenArtifact().setGroupId(GROUP_ID).setArtifactId("universe1-artifact").setVersion("1.0.0.Final");
Path path = resolver.resolve(FeaturePackLocation.fromString("producer1@" + MavenUniverseFactory.ID + '(' + universeArt.getCoordsAsString() + "):5/alpha"));
Assert.assertEquals(fpArt.getArtifactFileName(), path.getFileName().toString());
try {
universeArt.setPath(null);
resolver.resolve(FeaturePackLocation.fromString("producer2@" + MavenUniverseFactory.ID + '(' + universeArt.getCoordsAsString() + "):5/alpha"));
Assert.fail("producer2 is not in this universe version");
} catch (MavenUniverseException e) {
Assert.assertEquals(MavenErrors.producerNotFound("producer2").getLocalizedMessage(), e.getLocalizedMessage());
}
universeArt.setPath(null);
universeArt.setVersion("1.0.1.Final");
path = resolver.resolve(FeaturePackLocation.fromString("producer2@" + MavenUniverseFactory.ID + '(' + universeArt.getCoordsAsString() + "):5/alpha"));
Assert.assertEquals(fpArt.getArtifactFileName(), path.getFileName().toString());
}
Aggregations