use of org.jboss.galleon.universe.maven.MavenProducer in project galleon by wildfly.
the class MavenUniverseExtendAndInstallTestCase method testMain.
@Test
public void testMain() throws Exception {
MavenUniverseInstaller universeInstaller = new MavenUniverseInstaller(repo, universe100Artifact);
universeInstaller.addProducer("producer1", GROUP_ID, "producer1", "[1.0.0,2.0.0)");
universeInstaller.addProducer("producer2", GROUP_ID, "producer2", "[3.0.0,4.0.0)");
universeInstaller.install();
universeInstaller = new MavenUniverseInstaller(repo, universe101Artifact);
universeInstaller.extendUniverse(universe100Artifact);
universeInstaller.addProducer("producer3", GROUP_ID, "producer3", "[2.0.0,3.0.0)");
universeInstaller.removeProducer("producer2");
universeInstaller.install();
universe101Artifact.setPath(null);
final MavenUniverse universe = new MavenUniverse(repo, universe101Artifact);
Assert.assertTrue(universe.hasProducer("producer1"));
MavenProducer producer = universe.getProducer("producer1");
Assert.assertEquals(GROUP_ID, producer.getArtifact().getGroupId());
Assert.assertEquals("producer1", producer.getArtifact().getArtifactId());
Assert.assertEquals("[1.0.0,2.0.0)", producer.getArtifact().getVersionRange());
Assert.assertFalse(universe.hasProducer("producer2"));
Assert.assertEquals(2, universe.getProducers().size());
Assert.assertTrue(universe.hasProducer("producer3"));
producer = universe.getProducer("producer3");
Assert.assertEquals(GROUP_ID, producer.getArtifact().getGroupId());
Assert.assertEquals("producer3", producer.getArtifact().getArtifactId());
Assert.assertEquals("[2.0.0,3.0.0)", producer.getArtifact().getVersionRange());
}
Aggregations