Search in sources :

Example 1 with ChannelSpec

use of org.jboss.galleon.universe.FeaturePackLocation.ChannelSpec 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)

Example 2 with ChannelSpec

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

the class FeaturePackLocationStringTestCase method testChannelWithoutFrequencyToString.

@Test
public void testChannelWithoutFrequencyToString() throws Exception {
    final ChannelSpec channel = new FeaturePackLocation(new UniverseSpec("factory", "location"), "producer", "channel", null, "build").getChannel();
    Assert.assertEquals("producer@factory(location):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)

Example 3 with ChannelSpec

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

the class LegacyGalleon1FeaturePackInstaller method install.

@Override
public void install(Universe<?> universe, FeaturePackLocation.FPID fpid, Path fpZip) throws ProvisioningException {
    final LegacyGalleon1Universe mvnUni = (LegacyGalleon1Universe) universe;
    final ChannelSpec channel = fpid.getChannel();
    final LegacyGalleon1Producer producer = mvnUni.getProducer(channel.getProducer());
    // make sure the channel exists
    producer.getChannel(channel.getName());
    if (!(mvnUni.artifactResolver instanceof RepositoryArtifactInstaller)) {
        throw new ProvisioningException(mvnUni.artifactResolver.getClass().getName() + " is not an instance of " + LegacyGalleon1RepositoryManager.class.getName());
    }
    ((RepositoryArtifactInstaller) mvnUni.artifactResolver).install(LegacyGalleon1Universe.toMavenCoords(fpid.getLocation()), fpZip);
}
Also used : ProvisioningException(org.jboss.galleon.ProvisioningException) RepositoryArtifactInstaller(org.jboss.galleon.repo.RepositoryArtifactInstaller) ChannelSpec(org.jboss.galleon.universe.FeaturePackLocation.ChannelSpec)

Aggregations

ChannelSpec (org.jboss.galleon.universe.FeaturePackLocation.ChannelSpec)3 FeaturePackLocation (org.jboss.galleon.universe.FeaturePackLocation)2 UniverseSpec (org.jboss.galleon.universe.UniverseSpec)2 Test (org.junit.Test)2 ProvisioningException (org.jboss.galleon.ProvisioningException)1 RepositoryArtifactInstaller (org.jboss.galleon.repo.RepositoryArtifactInstaller)1