use of org.jboss.galleon.creator.FeaturePackCreator in project galleon by wildfly.
the class AdvancedLayersTestCase method buildFP.
private static void buildFP(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().addPackageDep("p1-required").addPackageDep("p1-optional", true).addPackageDep(PackageDependencySpec.newInstance("p1-passive", PackageDependencySpec.PASSIVE)).addPackageDep(PackageDependencySpec.newInstance("p2-passive", PackageDependencySpec.PASSIVE)).setName("feat1").addParam(FeatureParameterSpec.createId("p1")).build()).addFeatureSpec(FeatureSpec.builder().addPackageDep("p2-required").addPackageDep("p2-optional", true).setName("feat2").addParam(FeatureParameterSpec.createId("p2")).build()).addConfigLayer(ConfigLayerSpec.builder().setModel("testmodel").setName("base-" + producer).build()).addConfigLayer(ConfigLayerSpec.builder().setModel("testmodel").setName("layerA-" + producer).addLayerDep("base-" + producer).addFeature(FeatureConfig.newConfig("feat1").setParam("p1", "1")).build()).addConfigLayer(ConfigLayerSpec.builder().setModel("testmodel").setName("layerB-" + producer).addLayerDep("base-" + producer).addFeature(FeatureConfig.newConfig("feat2").setParam("p2", "1")).build()).addConfigLayer(ConfigLayerSpec.builder().setModel("testmodel").setName("layerD-" + producer).addLayerDep("layerE-" + producer).addFeature(FeatureConfig.newConfig("feat1").setParam("p1", "1")).build()).addConfigLayer(ConfigLayerSpec.builder().setModel("testmodel").setName("layerE-" + producer).addLayerDep("layerD-" + producer, true).addFeature(FeatureConfig.newConfig("feat1").setParam("p1", "1")).build()).addConfig(ConfigModel.builder("testmodel", "foo.xml").includeLayer("layerA-" + producer).includeLayer("layerB-" + producer).build(), true).newPackage("p1-required", false).addDependency("p1-ref-from-required").writeContent("fp1/p1-required.txt", "fp1 p1").getFeaturePack().newPackage("p1-ref-from-required", false).writeContent("fp1/p1-ref-from-required.txt", "fp1 p1").getFeaturePack().newPackage("p1-optional", false).addDependency("p1-ref-from-optional1").addDependency("p1-ref-from-optional2", true).writeContent("fp1/p1-optional.txt", "fp1 p1").getFeaturePack().newPackage("p1-ref-from-optional1", false).writeContent("fp1/p1-ref-from-optional1.txt", "fp1 p1").getFeaturePack().newPackage("p1-ref-from-optional2", false).writeContent("fp1/p1-ref-from-optional2.txt", "fp1 p1").getFeaturePack().newPackage("p1-passive", false).addDependency("p2-required").addDependency("p2-passive").writeContent("fp1/p1-passive.txt", "fp1 p1").getFeaturePack().newPackage("p2-passive", false).addDependency("p1-required").writeContent("fp1/p2-passive.txt", "fp1 p1").getFeaturePack().newPackage("p2-required", false).writeContent("fp1/p2-required.txt", "fp1 p1").getFeaturePack().newPackage("p2-optional", false).writeContent("fp1/p2-optional.txt", "fp1 p1").getFeaturePack();
creator.install();
}
use of org.jboss.galleon.creator.FeaturePackCreator 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.creator.FeaturePackCreator in project galleon by wildfly.
the class PmTestBase method doBefore.
@Override
protected void doBefore() throws Exception {
super.doBefore();
final FeaturePackCreator fpCreator = initCreator();
createFeaturePacks(fpCreator);
fpCreator.install();
initialProvisioningConfig = initialState();
if (initialProvisioningConfig != null) {
try (ProvisioningManager pm = getPm()) {
pm.provision(initialProvisioningConfig);
initialProvisionedState = pm.getProvisionedState();
}
}
initialHomeDirState = DirState.rootBuilder().init(installHome).build();
}
use of org.jboss.galleon.creator.FeaturePackCreator 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.creator.FeaturePackCreator 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();
}
Aggregations