Search in sources :

Example 6 with MavenProducer

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());
}
Also used : MavenUniverse(org.jboss.galleon.universe.maven.MavenUniverse) MavenUniverseInstaller(org.jboss.galleon.universe.maven.MavenUniverseInstaller) MavenProducer(org.jboss.galleon.universe.maven.MavenProducer) Test(org.junit.Test)

Aggregations

MavenProducer (org.jboss.galleon.universe.maven.MavenProducer)6 Test (org.junit.Test)4 MavenUniverseException (org.jboss.galleon.universe.maven.MavenUniverseException)3 XMLStreamException (javax.xml.stream.XMLStreamException)2 MavenChannel (org.jboss.galleon.universe.maven.MavenChannel)2 MavenProducerInstaller (org.jboss.galleon.universe.maven.MavenProducerInstaller)2 MavenUniverse (org.jboss.galleon.universe.maven.MavenUniverse)2 MavenUniverseInstaller (org.jboss.galleon.universe.maven.MavenUniverseInstaller)2 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 ProvisioningException (org.jboss.galleon.ProvisioningException)1 Channel (org.jboss.galleon.universe.Channel)1 FeaturePackLocation (org.jboss.galleon.universe.FeaturePackLocation)1 MavenArtifact (org.jboss.galleon.universe.maven.MavenArtifact)1