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