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;
}
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());
}
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());
}
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());
}
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());
}
Aggregations