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();
}
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);
}
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);
}
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);
}
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);
}
Aggregations