use of org.jboss.galleon.universe.UniverseSpec in project galleon by wildfly.
the class LayoutUtils method getFeaturePackDir.
public static Path getFeaturePackDir(Path fpLayoutDir, FPID fpid, boolean existing) throws ProvisioningDescriptionException {
final FeaturePackLocation fps = fpid.getLocation();
final UniverseSpec universe = fps.getUniverse();
Path fpPath = fpLayoutDir.resolve(universe.getFactory());
if (universe.getLocation() != null) {
fpPath = fpPath.resolve(ensureValidFileName(universe.getLocation()));
}
fpPath = fpPath.resolve(ensureValidFileName(fps.getProducerName()));
if (fps.getChannelName() != null) {
fpPath = fpPath.resolve(fps.getChannelName());
}
fpPath = fpPath.resolve(ensureValidFileName(fpid.getBuild()));
if (existing && !Files.exists(fpPath)) {
throw new ProvisioningDescriptionException(Errors.pathDoesNotExist(fpPath));
}
return fpPath;
}
use of org.jboss.galleon.universe.UniverseSpec in project galleon by wildfly.
the class FeaturePackLocationStringTestCase method testProducerUniverseFactoryLocationFromString.
@Test
public void testProducerUniverseFactoryLocationFromString() throws Exception {
final FeaturePackLocation parsedSrc = FeaturePackLocation.fromString("producer@factory(location)");
Assert.assertNotNull(parsedSrc);
Assert.assertEquals(new UniverseSpec("factory", "location"), parsedSrc.getUniverse());
Assert.assertEquals("producer", parsedSrc.getProducerName());
Assert.assertNull(parsedSrc.getChannelName());
Assert.assertNull(parsedSrc.getFrequency());
Assert.assertNull(parsedSrc.getBuild());
}
use of org.jboss.galleon.universe.UniverseSpec in project galleon by wildfly.
the class FeaturePackLocationStringTestCase method testFeaturePackIdWithoutUniverseLocationToString.
@Test
public void testFeaturePackIdWithoutUniverseLocationToString() throws Exception {
final FeaturePackLocation.FPID fpid = new FeaturePackLocation(new UniverseSpec("factory", null), "producer", "channel", "frequency", "build").getFPID();
Assert.assertEquals("producer@factory:channel#build", fpid.toString());
}
use of org.jboss.galleon.universe.UniverseSpec in project galleon by wildfly.
the class FeaturePackLocationStringTestCase method testProducerUniverseFactoryLocationFrequencyFromString.
@Test
public void testProducerUniverseFactoryLocationFrequencyFromString() throws Exception {
final FeaturePackLocation parsedSrc = FeaturePackLocation.fromString("producer@factory(location)/frequency");
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.assertNull(parsedSrc.getBuild());
}
use of org.jboss.galleon.universe.UniverseSpec in project galleon by wildfly.
the class FeaturePackLocationStringTestCase method testChannelWithoutUniverseLocationToString.
@Test
public void testChannelWithoutUniverseLocationToString() throws Exception {
final ChannelSpec channel = new FeaturePackLocation(new UniverseSpec("factory", null), "producer", "channel", "frequency", "build").getChannel();
Assert.assertEquals("producer@factory:channel", channel.toString());
}
Aggregations