Search in sources :

Example 21 with FeatureConfig

use of org.jboss.galleon.config.FeatureConfig in project galleon by wildfly.

the class DisableConfigInheritanceIncludeDefaultConfigTestCase method createFeaturePacks.

@Override
protected void createFeaturePacks(FeaturePackCreator creator) throws ProvisioningException {
    baseFp = newFpl("base-prod", "1", "1.0");
    topFp = newFpl("top-prod", "1", "1.0");
    creator.newFeaturePack().setFPID(baseFp.getFPID()).addFeatureSpec(FeatureSpec.builder("specA").addParam(FeatureParameterSpec.createId("p1")).build()).addConfig(ConfigModel.builder("model1", "name1").addFeature(new FeatureConfig("specA").setParam("p1", "base")).build()).addConfig(ConfigModel.builder("model2", "name1").addFeature(new FeatureConfig("specA").setParam("p1", "base")).build());
    creator.newFeaturePack().setFPID(topFp.getFPID()).addDependency(FeaturePackConfig.builder(baseFp).setInheritConfigs(true).build()).addFeatureSpec(FeatureSpec.builder("specB").addParam(FeatureParameterSpec.createId("p1")).build()).addConfig(ConfigModel.builder("model1", "name1").addFeature(new FeatureConfig("specB").setParam("p1", "top")).build()).addConfig(ConfigModel.builder("model2", "name1").addFeature(new FeatureConfig("specB").setParam("p1", "top")).build());
}
Also used : FeatureConfig(org.jboss.galleon.config.FeatureConfig)

Example 22 with FeatureConfig

use of org.jboss.galleon.config.FeatureConfig in project galleon by wildfly.

the class StateTestCase method installWithDependency.

public static void installWithDependency(String version) throws ProvisioningException {
    FeaturePackCreator creator = FeaturePackCreator.getInstance().addArtifactResolver(cli.getSession().getMavenRepoManager());
    FeaturePackLocation fp1 = new FeaturePackLocation(universeSpec, PRODUCER3, "1", null, version);
    creator.newFeaturePack(fp1.getFPID()).addFeatureSpec(FeatureSpec.builder("specA").addPackageDep("p1", true).addParam(FeatureParameterSpec.createId("p1")).build()).addConfig(ConfigModel.builder().setModel("model1").setName("name1").addFeature(new FeatureConfig("specA").setParam("p1", "1")).build(), true).newPackage("p1", false).writeContent("fp1/p1.txt", "fp1 p1").getFeaturePack().newPackage("p2", true).writeContent("fp2/p2.txt", "fp1 p2");
    FeaturePackLocation fp2 = new FeaturePackLocation(universeSpec, PRODUCER4, "1", null, version);
    FeaturePackConfig dep = FeaturePackConfig.builder(fp1).setInheritConfigs(false).setInheritPackages(false).build();
    creator.newFeaturePack(fp2.getFPID()).addDependency(dep).addFeatureSpec(FeatureSpec.builder("specB").addParam(FeatureParameterSpec.createId("p1")).build()).addConfig(ConfigModel.builder().setModel("model1").setName("name1").addFeature(new FeatureConfig("specB").setParam("p1", "1")).addFeature(new FeatureConfig("specA").setParam("p1", "1")).build(), true);
    creator.install();
}
Also used : FeaturePackCreator(org.jboss.galleon.creator.FeaturePackCreator) FeatureConfig(org.jboss.galleon.config.FeatureConfig) FeaturePackLocation(org.jboss.galleon.universe.FeaturePackLocation) FeaturePackConfig(org.jboss.galleon.config.FeaturePackConfig)

Example 23 with FeatureConfig

use of org.jboss.galleon.config.FeatureConfig in project galleon by wildfly.

the class StateTestCase method installLayers.

public static void installLayers(String version) throws ProvisioningException {
    FeaturePackCreator creator = FeaturePackCreator.getInstance().addArtifactResolver(cli.getSession().getMavenRepoManager());
    FeaturePackLocation fp1 = new FeaturePackLocation(universeSpec, PRODUCER2, "1", null, version);
    creator.newFeaturePack(fp1.getFPID()).addFeatureSpec(FeatureSpec.builder(PRODUCER2 + "-FeatureA").addParam(FeatureParameterSpec.createId("id")).build()).addConfigLayer(ConfigLayerSpec.builder().setModel("testmodel").setName("base").addFeature(new FeatureConfig(PRODUCER2 + "-FeatureA").setParam("id", "base")).build()).addConfigLayer(ConfigLayerSpec.builder().setModel("testmodel").setName("layer1").addLayerDep("base").addFeature(new FeatureConfig(PRODUCER2 + "-FeatureA").setParam("id", "layer1")).build()).addConfigLayer(ConfigLayerSpec.builder().setModel("testmodel").setName("layer2").addFeature(new FeatureConfig(PRODUCER2 + "-FeatureA").setParam("id", "layer2")).build()).newPackage("p1", true).writeContent("fp1/p1.txt", "fp1 p1").getFeaturePack().addConfig(ConfigModel.builder().setModel("testmodel").setName("testmodel1").includeLayer("layer1").build());
    creator.install();
}
Also used : FeaturePackCreator(org.jboss.galleon.creator.FeaturePackCreator) FeatureConfig(org.jboss.galleon.config.FeatureConfig) FeaturePackLocation(org.jboss.galleon.universe.FeaturePackLocation)

Example 24 with FeatureConfig

use of org.jboss.galleon.config.FeatureConfig in project galleon by wildfly.

the class StateTestCase method install.

public static void install(String version) throws ProvisioningException {
    FeaturePackCreator creator = FeaturePackCreator.getInstance().addArtifactResolver(cli.getSession().getMavenRepoManager());
    FeaturePackLocation fp1 = new FeaturePackLocation(universeSpec, PRODUCER1, "1", null, version);
    creator.newFeaturePack(fp1.getFPID()).newPackage("p1", true).writeContent("fp1/p1.txt", "fp1 p1").getFeaturePack().addFeatureSpec(FeatureSpec.builder("specA").addParam(FeatureParameterSpec.createId("p1")).build()).addConfig(ConfigModel.builder().setModel("model1").setName("name1").addFeature(new FeatureConfig("specA").setParam("p1", "1")).build());
    creator.install();
}
Also used : FeaturePackCreator(org.jboss.galleon.creator.FeaturePackCreator) FeatureConfig(org.jboss.galleon.config.FeatureConfig) FeaturePackLocation(org.jboss.galleon.universe.FeaturePackLocation)

Example 25 with FeatureConfig

use of org.jboss.galleon.config.FeatureConfig in project galleon by wildfly.

the class BasicConfigLayerInheritanceDisabledTestCase method createFeaturePacks.

@Override
protected void createFeaturePacks(FeaturePackCreator creator) throws ProvisioningException {
    prod1 = newFpl("prod1", "1", "1.0.0.Final");
    prod2 = newFpl("prod2", "1", "1.0.0.Final");
    creator.newFeaturePack().setFPID(prod1.getFPID()).addFeatureSpec(FeatureSpec.builder("specA").addParam(FeatureParameterSpec.createId("id")).addParam(FeatureParameterSpec.create("p1", "spec")).addParam(FeatureParameterSpec.create("p2", "spec")).addParam(FeatureParameterSpec.create("p3", "spec")).build()).addConfigLayer(ConfigLayerSpec.builder().setModel("model1").setName("base").addFeature(new FeatureConfig("specA").setParam("id", "base-prod1").setParam("p2", "base")).addPackageDep("base").build()).addConfig(ConfigModel.builder("model1", "main").includeLayer("base").build()).newPackage("base").writeContent("base.txt", "base");
    creator.newFeaturePack().setFPID(prod2.getFPID()).addFeatureSpec(FeatureSpec.builder("specB").addParam(FeatureParameterSpec.createId("id")).addParam(FeatureParameterSpec.create("p1", "spec")).addParam(FeatureParameterSpec.create("p2", "spec")).addParam(FeatureParameterSpec.create("p3", "spec")).build()).addConfigLayer(ConfigLayerSpec.builder().setModel("model1").setName("other").addFeature(new FeatureConfig("specB").setParam("id", "base-prod2").setParam("p2", "base")).addPackageDep("other").build()).addConfig(ConfigModel.builder("model1", "main").includeLayer("other").build()).newPackage("other").writeContent("other.txt", "other");
}
Also used : FeatureConfig(org.jboss.galleon.config.FeatureConfig)

Aggregations

FeatureConfig (org.jboss.galleon.config.FeatureConfig)76 StateDiffPlugin (org.jboss.galleon.plugin.StateDiffPlugin)8 FeaturePackLocation (org.jboss.galleon.universe.FeaturePackLocation)6 FeaturePackCreator (org.jboss.galleon.creator.FeaturePackCreator)5 Test (org.junit.Test)4 Map (java.util.Map)3 FeatureId (org.jboss.galleon.spec.FeatureId)3 LinkedHashMap (java.util.LinkedHashMap)2 XMLStreamException (javax.xml.stream.XMLStreamException)2 ProvisioningDescriptionException (org.jboss.galleon.ProvisioningDescriptionException)2 ProvisioningConfig (org.jboss.galleon.config.ProvisioningConfig)2 HashMap (java.util.HashMap)1 ProvisioningException (org.jboss.galleon.ProvisioningException)1 ConfigId (org.jboss.galleon.config.ConfigId)1 FeatureGroup (org.jboss.galleon.config.FeatureGroup)1 FeaturePackConfig (org.jboss.galleon.config.FeaturePackConfig)1 ResolvedSpecId (org.jboss.galleon.runtime.ResolvedSpecId)1 FeaturePackSpec (org.jboss.galleon.spec.FeaturePackSpec)1 SpecId (org.jboss.galleon.spec.SpecId)1 BasicStateDiffPlugin (org.jboss.galleon.userchanges.persist.test.BasicStateDiffPlugin)1