Search in sources :

Example 96 with FeaturePackLocation

use of org.jboss.galleon.universe.FeaturePackLocation in project galleon by wildfly.

the class FeatureContainers method fromFeaturePackId.

public static FeatureContainer fromFeaturePackId(PmSession session, FPID fpid, String name) throws ProvisioningException, IOException {
    if (fpid.getBuild() == null) {
        FeaturePackLocation loc = session.getUniverse().resolveLatestBuild(fpid.getLocation());
        fpid = loc.getFPID();
    }
    FeatureContainer fp = Caches.getFeaturePackInfo(fpid);
    if (fp != null) {
        return fp;
    }
    try (ProvisioningRuntime rt = buildFullRuntime(fpid, session)) {
        fp = new FeaturePackInfo(name, fpid, rt.getProvisioningConfig());
        populateFeatureContainer(fp, session, rt, true);
        Caches.addFeaturePackInfo(fpid, fp);
    }
    return fp;
}
Also used : ProvisioningRuntime(org.jboss.galleon.runtime.ProvisioningRuntime) FeaturePackLocation(org.jboss.galleon.universe.FeaturePackLocation)

Example 97 with FeaturePackLocation

use of org.jboss.galleon.universe.FeaturePackLocation in project galleon by wildfly.

the class FeaturePackLocationStringTestCase method testProducerUniverseFactoryLocationFrequencyBuildFromString.

@Test
public void testProducerUniverseFactoryLocationFrequencyBuildFromString() throws Exception {
    final FeaturePackLocation parsedSrc = FeaturePackLocation.fromString("producer@factory(location)/frequency#build");
    Assert.assertNotNull(parsedSrc);
    Assert.assertEquals(new UniverseSpec("factory", "location"), parsedSrc.getUniverse());
    Assert.assertEquals("producer", parsedSrc.getProducerName());
    Assert.assertNull(parsedSrc.getChannelName());
    Assert.assertEquals("frequency", parsedSrc.getFrequency());
    Assert.assertEquals("build", parsedSrc.getBuild());
}
Also used : FeaturePackLocation(org.jboss.galleon.universe.FeaturePackLocation) UniverseSpec(org.jboss.galleon.universe.UniverseSpec) Test(org.junit.Test)

Example 98 with FeaturePackLocation

use of org.jboss.galleon.universe.FeaturePackLocation in project galleon by wildfly.

the class FeaturePackLocationStringTestCase method testFeaturePackIdWithUniverseLocationToString.

@Test
public void testFeaturePackIdWithUniverseLocationToString() throws Exception {
    final FeaturePackLocation.FPID fpid = new FeaturePackLocation(new UniverseSpec("factory", "location"), "producer", "channel", "frequency", "build").getFPID();
    Assert.assertEquals("producer@factory(location):channel#build", fpid.toString());
}
Also used : FeaturePackLocation(org.jboss.galleon.universe.FeaturePackLocation) UniverseSpec(org.jboss.galleon.universe.UniverseSpec) Test(org.junit.Test)

Example 99 with FeaturePackLocation

use of org.jboss.galleon.universe.FeaturePackLocation in project galleon by wildfly.

the class FeaturePackLocationStringTestCase method testProducerBuildFromString.

@Test
public void testProducerBuildFromString() throws Exception {
    final FeaturePackLocation parsedSrc = FeaturePackLocation.fromString("producer#build");
    Assert.assertNotNull(parsedSrc);
    Assert.assertNull(parsedSrc.getUniverse());
    Assert.assertEquals("producer", parsedSrc.getProducerName());
    Assert.assertNull(parsedSrc.getChannelName());
    Assert.assertNull(parsedSrc.getFrequency());
    Assert.assertEquals("build", parsedSrc.getBuild());
}
Also used : FeaturePackLocation(org.jboss.galleon.universe.FeaturePackLocation) Test(org.junit.Test)

Example 100 with FeaturePackLocation

use of org.jboss.galleon.universe.FeaturePackLocation in project galleon by wildfly.

the class FeaturePackLocationStringTestCase method testProducerWithoutUniverseLocationFromString.

@Test
public void testProducerWithoutUniverseLocationFromString() throws Exception {
    final FeaturePackLocation parsedCoords = FeaturePackLocation.fromString("producer@factory");
    Assert.assertNotNull(parsedCoords);
    Assert.assertEquals("factory", parsedCoords.getUniverse().getFactory());
    Assert.assertNull(parsedCoords.getUniverse().getLocation());
    Assert.assertEquals("producer", parsedCoords.getProducerName());
    Assert.assertNull(parsedCoords.getChannelName());
    Assert.assertNull(parsedCoords.getFrequency());
    Assert.assertNull(parsedCoords.getBuild());
}
Also used : FeaturePackLocation(org.jboss.galleon.universe.FeaturePackLocation) Test(org.junit.Test)

Aggregations

FeaturePackLocation (org.jboss.galleon.universe.FeaturePackLocation)111 Test (org.junit.Test)46 Path (java.nio.file.Path)23 ProvisioningException (org.jboss.galleon.ProvisioningException)18 UniverseSpec (org.jboss.galleon.universe.UniverseSpec)18 FeaturePackConfig (org.jboss.galleon.config.FeaturePackConfig)16 ArrayList (java.util.ArrayList)13 FPID (org.jboss.galleon.universe.FeaturePackLocation.FPID)13 FeaturePackCreator (org.jboss.galleon.creator.FeaturePackCreator)12 ProducerSpec (org.jboss.galleon.universe.FeaturePackLocation.ProducerSpec)9 XMLStreamException (javax.xml.stream.XMLStreamException)8 ProvisioningConfig (org.jboss.galleon.config.ProvisioningConfig)8 IOException (java.io.IOException)7 CommandExecutionException (org.jboss.galleon.cli.CommandExecutionException)7 HashMap (java.util.HashMap)6 CommandException (org.aesh.command.CommandException)6 ProvisioningDescriptionException (org.jboss.galleon.ProvisioningDescriptionException)6 FeatureConfig (org.jboss.galleon.config.FeatureConfig)6 FeaturePackLayout (org.jboss.galleon.layout.FeaturePackLayout)6 Set (java.util.Set)5