Search in sources :

Example 1 with FeatureConfig

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

the class CliTestUtils method installWithLayers.

public static void installWithLayers(CliWrapper cli, UniverseSpec universeSpec, String producer, String version) throws ProvisioningException {
    FeaturePackCreator creator = FeaturePackCreator.getInstance().addArtifactResolver(cli.getSession().getMavenRepoManager());
    FeaturePackLocation fp1 = new FeaturePackLocation(universeSpec, producer, "1", null, version);
    creator.newFeaturePack(fp1.getFPID()).addFeatureSpec(FeatureSpec.builder(producer + "-FeatureA").addParam(FeatureParameterSpec.createId("id")).build()).addConfigLayer(ConfigLayerSpec.builder().setModel("testmodel").setName("base-" + producer).addFeature(new FeatureConfig(producer + "-FeatureA").setParam("id", "base")).build()).addConfigLayer(ConfigLayerSpec.builder().setModel("testmodel").setName("layerA-" + producer).addLayerDep("base-" + producer).build()).addConfigLayer(ConfigLayerSpec.builder().setModel("testmodel").setName("layerB-" + producer).addLayerDep("layerA-" + producer).build()).addConfigLayer(ConfigLayerSpec.builder().setModel("testmodel").setName("layerC-" + producer).build()).addConfigLayer(ConfigLayerSpec.builder().setModel("testmodel").setName("layerD-" + producer).build()).addConfig(ConfigModel.builder("testmodel", "config1.xml").includeLayer("layerB-" + producer).build(), true).addConfig(ConfigModel.builder("testmodel", "config2.xml").includeLayer("layerD-" + producer).build(), true).newPackage("p1", true).writeContent(producer + "/p1.txt", "fp1 p1").getFeaturePack().addService(StateDiffPlugin.class, BasicStateDiffPlugin.class).addPlugin(TestConfigsPersistingPlugin.class);
    creator.install();
}
Also used : FeaturePackCreator(org.jboss.galleon.creator.FeaturePackCreator) BasicStateDiffPlugin(org.jboss.galleon.userchanges.persist.test.BasicStateDiffPlugin) FeatureConfig(org.jboss.galleon.config.FeatureConfig) FeaturePackLocation(org.jboss.galleon.universe.FeaturePackLocation) BasicStateDiffPlugin(org.jboss.galleon.userchanges.persist.test.BasicStateDiffPlugin) StateDiffPlugin(org.jboss.galleon.plugin.StateDiffPlugin)

Example 2 with FeatureConfig

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

the class FeaturePackXmlParserTestCase method readDefaultConfigs.

@Test
public void readDefaultConfigs() throws Exception {
    FeaturePackSpec found = validator.validateAndParse("xml/feature-pack/feature-pack-default-configs.xml", null, null);
    FeaturePackSpec expected = FeaturePackSpec.builder().setFPID(LegacyGalleon1Universe.newFPID("org.jboss.fp.group1:fp1", "1", "1.0.0")).addConfig(ConfigModel.builder().setName("config1").setModel("model1").setProperty("prop1", "value1").setProperty("prop2", "value2").addFeatureGroup(FeatureGroup.builder("fg1").build()).addFeatureGroup(FeatureGroup.builder("fg2").excludeFeature(FeatureId.create("spec1", "p1", "v1")).build()).addFeature(new FeatureConfig("spec1").addFeatureDep(FeatureId.fromString("spec2:p1=v1,p2=v2")).addFeatureDep(FeatureId.create("spec3", "p3", "v3")).setParam("p1", "v1").setParam("p2", "v2")).build()).addConfig(ConfigModel.builder().setModel("model2").setProperty("prop3", "value3").setProperty("prop4", "value4").addFeatureGroup(FeatureGroup.builder("fg3").build()).addFeatureGroup(FeatureGroup.builder("fg4").excludeFeature(FeatureId.create("spec4", "p1", "v1")).build()).addFeature(new FeatureConfig("spec5").addFeatureDep(FeatureId.fromString("spec6:p1=v1,p2=v2")).addFeatureDep(FeatureId.create("spec7", "p3", "v3")).setParam("p1", "v1").setParam("p2", "v2")).build()).addDefaultPackage("package1").addDefaultPackage("package2").build();
    Assert.assertEquals(expected, found);
}
Also used : FeatureConfig(org.jboss.galleon.config.FeatureConfig) FeaturePackSpec(org.jboss.galleon.spec.FeaturePackSpec) Test(org.junit.Test)

Example 3 with FeatureConfig

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

the class ConfigIncludeExcludeInheritConfigsFalseIncludeConfigTestCase method createFeaturePacks.

@Override
protected void createFeaturePacks(FeaturePackCreator creator) throws ProvisioningException {
    prod1 = newFpl("prod1", "1", "1.0.0.Final");
    creator.newFeaturePack(prod1.getFPID()).addFeatureSpec(FeatureSpec.builder("specA").addParam(FeatureParameterSpec.createId("id")).addParam(FeatureParameterSpec.create("a", "spec")).addParam(FeatureParameterSpec.create("b", "spec")).addParam(FeatureParameterSpec.create("c", "spec")).build()).addConfig(ConfigModel.builder("model1", "name1").addFeature(new FeatureConfig("specA").setParam("id", "1").setParam("a", "config").setParam("b", "config")).build()).addConfig(ConfigModel.builder("model1", "name2").addFeature(new FeatureConfig("specA").setParam("id", "2").setParam("a", "config").setParam("b", "config")).build()).addService(StateDiffPlugin.class, BasicStateDiffPlugin.class).addPlugin(TestConfigsPersistingPlugin.class);
}
Also used : FeatureConfig(org.jboss.galleon.config.FeatureConfig) StateDiffPlugin(org.jboss.galleon.plugin.StateDiffPlugin)

Example 4 with FeatureConfig

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

the class PersistFeatureIncludeExcludeAddWithInheritFeaturesFalseSpecIncludedTestCase method createFeaturePacks.

@Override
protected void createFeaturePacks(FeaturePackCreator creator) throws ProvisioningException {
    prod1 = newFpl("prod1", "1", "1.0.0.Final");
    creator.newFeaturePack(prod1.getFPID()).addFeatureSpec(FeatureSpec.builder("specA").addParam(FeatureParameterSpec.createId("id")).addParam(FeatureParameterSpec.create("a", "spec")).addParam(FeatureParameterSpec.create("b", "spec")).addParam(FeatureParameterSpec.create("c", "spec")).build()).addConfig(ConfigModel.builder("model1", "name1").addFeature(new FeatureConfig("specA").setParam("id", "1").setParam("a", "config").setParam("b", "config")).addFeature(new FeatureConfig("specA").setParam("id", "2").setParam("a", "config").setParam("b", "config")).build()).addService(StateDiffPlugin.class, BasicStateDiffPlugin.class).addPlugin(TestConfigsPersistingPlugin.class);
}
Also used : FeatureConfig(org.jboss.galleon.config.FeatureConfig) StateDiffPlugin(org.jboss.galleon.plugin.StateDiffPlugin)

Example 5 with FeatureConfig

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

the class PersistFeatureIncludeExcludeAddWithInheritFeaturesFalseTestCase method createFeaturePacks.

@Override
protected void createFeaturePacks(FeaturePackCreator creator) throws ProvisioningException {
    prod1 = newFpl("prod1", "1", "1.0.0.Final");
    creator.newFeaturePack(prod1.getFPID()).addFeatureSpec(FeatureSpec.builder("specA").addParam(FeatureParameterSpec.createId("id")).addParam(FeatureParameterSpec.create("a", "spec")).addParam(FeatureParameterSpec.create("b", "spec")).addParam(FeatureParameterSpec.create("c", "spec")).build()).addConfig(ConfigModel.builder("model1", "name1").addFeature(new FeatureConfig("specA").setParam("id", "1").setParam("a", "config").setParam("b", "config")).addFeature(new FeatureConfig("specA").setParam("id", "2").setParam("a", "config").setParam("b", "config")).build()).addService(StateDiffPlugin.class, BasicStateDiffPlugin.class).addPlugin(TestConfigsPersistingPlugin.class);
}
Also used : FeatureConfig(org.jboss.galleon.config.FeatureConfig) StateDiffPlugin(org.jboss.galleon.plugin.StateDiffPlugin)

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