Search in sources :

Example 36 with FeatureConfig

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

the class FeatureDependsOnRequiredExcludedPackageTestCase method pmFailure.

@Override
protected void pmFailure(Throwable e) throws ProvisioningDescriptionException {
    Assert.assertEquals(Errors.failedToResolveConfigSpec(null, "main"), e.getLocalizedMessage());
    Throwable t = e.getCause();
    Assert.assertNotNull(t);
    Assert.assertEquals(Errors.failedToProcess(FP_GAV, new FeatureConfig("specA").setParam("name", "a")), t.getLocalizedMessage());
    t = t.getCause();
    Assert.assertNotNull(t);
    Assert.assertEquals(Errors.unsatisfiedPackageDependency(FP_GAV, "specA.pkg"), t.getLocalizedMessage());
}
Also used : FeatureConfig(org.jboss.galleon.config.FeatureConfig)

Example 37 with FeatureConfig

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

the class ReenableConfigInheritanceForTransitiveDepExcludeConfigTestCase method createFeaturePacks.

@Override
protected void createFeaturePacks(FeaturePackCreator creator) throws ProvisioningException {
    fp1 = newFpl("prod1", "1", "1.0.0.Final");
    fp2 = newFpl("prod2", "1", "1.0.0.Final");
    fp3 = newFpl("prod3", "1", "1.0.0.Final");
    creator.newFeaturePack().setFPID(fp1.getFPID()).addDependency(FeaturePackConfig.builder(fp2).setInheritConfigs(false).setInheritPackages(false).build()).addFeatureSpec(FeatureSpec.builder("specA").addParam(FeatureParameterSpec.createId("p1")).build()).addConfig(ConfigModel.builder("model1", "name1").addFeature(new FeatureConfig("specA").setParam("p1", "1")).build()).addConfig(ConfigModel.builder("model1", "name2").addFeature(new FeatureConfig("specA").setParam("p1", "2")).build(), false).newPackage("p1", true).writeContent("fp1/p1.txt", "fp1");
    creator.newFeaturePack().setFPID(fp2.getFPID()).addDependency(FeaturePackConfig.builder(fp3).excludeDefaultConfig("model1", "name6").build()).addFeatureSpec(FeatureSpec.builder("specB").addParam(FeatureParameterSpec.createId("p1")).build()).addConfig(ConfigModel.builder("model1", "name2").addFeature(new FeatureConfig("specB").setParam("p1", "1")).build()).addConfig(ConfigModel.builder("model1", "name3").addFeature(new FeatureConfig("specB").setParam("p1", "3")).build()).addConfig(ConfigModel.builder("model1", "name4").addFeature(new FeatureConfig("specB").setParam("p1", "4")).build(), false).newPackage("p1", true).writeContent("fp2/p1.txt", "fp2");
    creator.newFeaturePack().setFPID(fp3.getFPID()).addFeatureSpec(FeatureSpec.builder("specC").addParam(FeatureParameterSpec.createId("p1")).build()).addConfig(ConfigModel.builder("model1", "name2").addFeature(new FeatureConfig("specC").setParam("p1", "1")).build(), false).addConfig(ConfigModel.builder("model1", "name5").addFeature(new FeatureConfig("specC").setParam("p1", "5")).build()).addConfig(ConfigModel.builder("model1", "name6").addFeature(new FeatureConfig("specC").setParam("p1", "6")).build());
}
Also used : FeatureConfig(org.jboss.galleon.config.FeatureConfig)

Example 38 with FeatureConfig

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

the class TransitiveDepExcludeConfigIdTestCase method createFeaturePacks.

@Override
protected void createFeaturePacks(FeaturePackCreator creator) throws ProvisioningException {
    fp1Fpl = newFpl("producer1", "1", "1.0.0.Final");
    fp2Fpl = newFpl("producer2", "1", "1.0.0.Final");
    fp3_100_fpl = newFpl("producer3", "1", "1.0.0.Final");
    fp3_101_fpl = newFpl("producer3", "1", "1.0.1.Final");
    fp3_102_fpl = newFpl("producer3", "1", "1.0.2.Final");
    creator.newFeaturePack().setFPID(fp1Fpl.getFPID()).addDependency(FeaturePackConfig.builder(fp3_100_fpl, false).build()).addFeatureSpec(FeatureSpec.builder("specA").addParam(FeatureParameterSpec.createId("p1")).build()).addConfig(ConfigModel.builder("model1", "name1").addFeature(new FeatureConfig("specA").setParam("p1", "1")).build());
    creator.newFeaturePack().setFPID(fp2Fpl.getFPID()).addDependency(FeaturePackConfig.builder(fp3_101_fpl).build()).addFeatureSpec(FeatureSpec.builder("specB").addParam(FeatureParameterSpec.createId("p1")).build()).addConfig(ConfigModel.builder("model1", "name1").addFeature(new FeatureConfig("specB").setParam("p1", "1")).build());
    creator.newFeaturePack().setFPID(fp3_100_fpl.getFPID()).addFeatureSpec(FeatureSpec.builder("specC").addParam(FeatureParameterSpec.createId("p1")).addParam(FeatureParameterSpec.create("p2", "100")).build()).addConfig(ConfigModel.builder("model1", "name1").addFeature(new FeatureConfig("specC").setParam("p1", "1")).build()).addConfig(ConfigModel.builder("model2", "name1").addFeature(new FeatureConfig("specC").setParam("p1", "1")).build());
    creator.newFeaturePack().setFPID(fp3_101_fpl.getFPID()).addFeatureSpec(FeatureSpec.builder("specC").addParam(FeatureParameterSpec.createId("p1")).addParam(FeatureParameterSpec.create("p2", "101")).addParam(FeatureParameterSpec.create("p3", "101")).build()).addConfig(ConfigModel.builder("model1", "name1").addFeature(new FeatureConfig("specC").setParam("p1", "1")).build()).addConfig(ConfigModel.builder("model2", "name1").addFeature(new FeatureConfig("specC").setParam("p1", "1")).build());
    creator.newFeaturePack().setFPID(fp3_102_fpl.getFPID()).addFeatureSpec(FeatureSpec.builder("specC").addParam(FeatureParameterSpec.createId("p1")).addParam(FeatureParameterSpec.create("p2", "102")).addParam(FeatureParameterSpec.create("p4", "102")).build()).addConfig(ConfigModel.builder("model1", "name1").addFeature(new FeatureConfig("specC").setParam("p1", "1")).build()).addConfig(ConfigModel.builder("model2", "name1").addFeature(new FeatureConfig("specC").setParam("p1", "1")).build());
}
Also used : FeatureConfig(org.jboss.galleon.config.FeatureConfig)

Example 39 with FeatureConfig

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

the class TransitiveDepIncludeConfigIdTestCase method createFeaturePacks.

@Override
protected void createFeaturePacks(FeaturePackCreator creator) throws ProvisioningException {
    fp1Fpl = newFpl("producer1", "1", "1.0.0.Final");
    fp2Fpl = newFpl("producer2", "1", "1.0.0.Final");
    fp3_100_fpl = newFpl("producer3", "1", "1.0.0.Final");
    fp3_101_fpl = newFpl("producer3", "1", "1.0.1.Final");
    fp3_102_fpl = newFpl("producer3", "1", "1.0.2.Final");
    creator.newFeaturePack().setFPID(fp1Fpl.getFPID()).addDependency(FeaturePackConfig.builder(fp3_100_fpl, false).build()).addFeatureSpec(FeatureSpec.builder("specA").addParam(FeatureParameterSpec.createId("p1")).build()).addConfig(ConfigModel.builder("model1", "name1").addFeature(new FeatureConfig("specA").setParam("p1", "1")).build());
    creator.newFeaturePack().setFPID(fp2Fpl.getFPID()).addDependency(FeaturePackConfig.builder(fp3_101_fpl).build()).addFeatureSpec(FeatureSpec.builder("specB").addParam(FeatureParameterSpec.createId("p1")).build()).addConfig(ConfigModel.builder("model1", "name1").addFeature(new FeatureConfig("specB").setParam("p1", "1")).build());
    creator.newFeaturePack().setFPID(fp3_100_fpl.getFPID()).addFeatureSpec(FeatureSpec.builder("specC").addParam(FeatureParameterSpec.createId("p1")).addParam(FeatureParameterSpec.create("p2", "100")).build()).addConfig(ConfigModel.builder("model1", "name1").addFeature(new FeatureConfig("specC").setParam("p1", "1")).build()).addConfig(ConfigModel.builder("model2", "name1").addFeature(new FeatureConfig("specC").setParam("p1", "1")).build());
    creator.newFeaturePack().setFPID(fp3_101_fpl.getFPID()).addFeatureSpec(FeatureSpec.builder("specC").addParam(FeatureParameterSpec.createId("p1")).addParam(FeatureParameterSpec.create("p2", "101")).addParam(FeatureParameterSpec.create("p3", "101")).build()).addConfig(ConfigModel.builder("model1", "name1").addFeature(new FeatureConfig("specC").setParam("p1", "1")).build()).addConfig(ConfigModel.builder("model2", "name1").addFeature(new FeatureConfig("specC").setParam("p1", "1")).build());
    creator.newFeaturePack().setFPID(fp3_102_fpl.getFPID()).addFeatureSpec(FeatureSpec.builder("specC").addParam(FeatureParameterSpec.createId("p1")).addParam(FeatureParameterSpec.create("p2", "102")).addParam(FeatureParameterSpec.create("p4", "102")).build()).addConfig(ConfigModel.builder("model1", "name1").addFeature(new FeatureConfig("specC").setParam("p1", "1")).build()).addConfig(ConfigModel.builder("model2", "name1").addFeature(new FeatureConfig("specC").setParam("p1", "1")).build());
}
Also used : FeatureConfig(org.jboss.galleon.config.FeatureConfig)

Example 40 with FeatureConfig

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

the class TransitiveDepInheritFalseTestCase method createFeaturePacks.

@Override
protected void createFeaturePacks(FeaturePackCreator creator) throws ProvisioningException {
    fp1Fpl = newFpl("producer1", "1", "1.0.0.Final");
    fp2Fpl = newFpl("producer2", "1", "1.0.0.Final");
    fp3_100_fpl = newFpl("producer3", "1", "1.0.0.Final");
    fp3_101_fpl = newFpl("producer3", "1", "1.0.1.Final");
    fp3_102_fpl = newFpl("producer3", "1", "1.0.2.Final");
    creator.newFeaturePack().setFPID(fp1Fpl.getFPID()).addDependency(FeaturePackConfig.builder(fp3_100_fpl, false).includePackage("p2").includePackage("p3").build()).addFeatureSpec(FeatureSpec.builder("specA").addParam(FeatureParameterSpec.createId("p1")).build()).addConfig(ConfigModel.builder("model1", "name1").addFeature(new FeatureConfig("specA").setParam("p1", "1")).build()).newPackage("p1", true).writeContent("fp1/p1.txt", "fp1");
    creator.newFeaturePack().setFPID(fp2Fpl.getFPID()).addDependency(FeaturePackConfig.builder(fp3_101_fpl).includePackage("p2").build()).addFeatureSpec(FeatureSpec.builder("specB").addParam(FeatureParameterSpec.createId("p1")).build()).addConfig(ConfigModel.builder("model1", "name1").addFeature(new FeatureConfig("specB").setParam("p1", "1")).build()).newPackage("p1", true).writeContent("fp2/p1.txt", "fp2");
    creator.newFeaturePack().setFPID(fp3_100_fpl.getFPID()).addFeatureSpec(FeatureSpec.builder("specC").addParam(FeatureParameterSpec.createId("p1")).addParam(FeatureParameterSpec.create("p2", "100")).build()).addConfig(ConfigModel.builder("model1", "name1").addFeature(new FeatureConfig("specC").setParam("p1", "1")).build()).newPackage("p1", true).writeContent("fp3/p1.txt", "fp3 p1 100").getFeaturePack().newPackage("p2").writeContent("fp3/p2.txt", "fp3 p2 100").getFeaturePack().newPackage("p3").writeContent("fp3/p3.txt", "fp3 p3 100").getFeaturePack().newPackage("p4").writeContent("fp3/p4.txt", "fp3 p4 100");
    creator.newFeaturePack().setFPID(fp3_101_fpl.getFPID()).addFeatureSpec(FeatureSpec.builder("specC").addParam(FeatureParameterSpec.createId("p1")).addParam(FeatureParameterSpec.create("p2", "101")).addParam(FeatureParameterSpec.create("p3", "101")).build()).addConfig(ConfigModel.builder("model1", "name1").addFeature(new FeatureConfig("specC").setParam("p1", "2")).build()).newPackage("p1", true).writeContent("fp3/p1.txt", "fp3 101").getFeaturePack().newPackage("p2").writeContent("fp3/p2.txt", "fp3 p2 101").getFeaturePack().newPackage("p3").writeContent("fp3/p3.txt", "fp3 p3 101").getFeaturePack().newPackage("p4").writeContent("fp3/p4.txt", "fp3 p4 101");
    creator.newFeaturePack().setFPID(fp3_102_fpl.getFPID()).addFeatureSpec(FeatureSpec.builder("specC").addParam(FeatureParameterSpec.createId("p1")).addParam(FeatureParameterSpec.create("p2", "102")).addParam(FeatureParameterSpec.create("p4", "102")).build()).addConfig(ConfigModel.builder("model1", "name1").addFeature(new FeatureConfig("specC").setParam("p1", "2")).build()).newPackage("p1", true).writeContent("fp3/p1.txt", "fp3 p1 102").getFeaturePack().newPackage("p2").writeContent("fp3/p2.txt", "fp3 p2 102").getFeaturePack().newPackage("p3").writeContent("fp3/p3.txt", "fp3 p3 102").getFeaturePack().newPackage("p4").writeContent("fp3/p4.txt", "fp3 p4 102");
}
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