Search in sources :

Example 1 with UniverseSpec

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;
}
Also used : Path(java.nio.file.Path) FeaturePackLocation(org.jboss.galleon.universe.FeaturePackLocation) UniverseSpec(org.jboss.galleon.universe.UniverseSpec) ProvisioningDescriptionException(org.jboss.galleon.ProvisioningDescriptionException)

Example 2 with UniverseSpec

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());
}
Also used : FeaturePackLocation(org.jboss.galleon.universe.FeaturePackLocation) UniverseSpec(org.jboss.galleon.universe.UniverseSpec) Test(org.junit.Test)

Example 3 with UniverseSpec

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());
}
Also used : FeaturePackLocation(org.jboss.galleon.universe.FeaturePackLocation) UniverseSpec(org.jboss.galleon.universe.UniverseSpec) Test(org.junit.Test)

Example 4 with UniverseSpec

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());
}
Also used : FeaturePackLocation(org.jboss.galleon.universe.FeaturePackLocation) UniverseSpec(org.jboss.galleon.universe.UniverseSpec) Test(org.junit.Test)

Example 5 with UniverseSpec

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());
}
Also used : FeaturePackLocation(org.jboss.galleon.universe.FeaturePackLocation) UniverseSpec(org.jboss.galleon.universe.UniverseSpec) ChannelSpec(org.jboss.galleon.universe.FeaturePackLocation.ChannelSpec) Test(org.junit.Test)

Aggregations

UniverseSpec (org.jboss.galleon.universe.UniverseSpec)29 FeaturePackLocation (org.jboss.galleon.universe.FeaturePackLocation)18 Test (org.junit.Test)14 ProvisioningException (org.jboss.galleon.ProvisioningException)6 ProvisioningManager (org.jboss.galleon.ProvisioningManager)4 ProvisioningConfig (org.jboss.galleon.config.ProvisioningConfig)4 ProducerSpec (org.jboss.galleon.universe.FeaturePackLocation.ProducerSpec)4 Path (java.nio.file.Path)3 ChannelSpec (org.jboss.galleon.universe.FeaturePackLocation.ChannelSpec)3 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 HashSet (java.util.HashSet)2 Set (java.util.Set)2 ProvisioningDescriptionException (org.jboss.galleon.ProvisioningDescriptionException)2 CommandExecutionException (org.jboss.galleon.cli.CommandExecutionException)2 UniverseVisitor (org.jboss.galleon.cli.UniverseManager.UniverseVisitor)2 Table (org.jboss.galleon.cli.cmd.Table)2 Producer (org.jboss.galleon.universe.Producer)2 IOException (java.io.IOException)1 Comparator (java.util.Comparator)1