use of org.jboss.galleon.runtime.ResolvedSpecId in project galleon by wildfly.
the class ProvisionedStateXmlWriterTestCase method testFeatureParams.
@Test
public void testFeatureParams() throws Exception {
ProvisionedState originalState = ProvisionedState.builder().addConfig(ProvisionedConfigBuilder.builder().addFeature(ProvisionedFeatureBuilder.builder(new ResolvedSpecId(LegacyGalleon1Universe.newFPID("org.jboss.group", "fp", "1.0").getProducer(), "spec")).setIdParam("id-param", "config").setIdParam("id-param2", "config").setConfigParam("param", "config").build()).addFeature(ProvisionedFeatureBuilder.builder(ResolvedFeatureId.builder(LegacyGalleon1Universe.newFPID("org.jboss.group", "fp", "1.0").getProducer(), "spec2").setParam("id-param", // TODO: this resolved value will not have config representation
"resolved").build()).setConfigParam("param", "config").build())).build();
// marshall and unmarshall
Path path = marshallToTempFile(originalState);
ProvisionedState newState = validator.validateAndParse(path);
// retrieve the parsedFeature
ReadFeaturesHandler readFeaturesHandler = new ReadFeaturesHandler();
newState.getConfigs().get(0).handle(readFeaturesHandler);
ProvisionedFeature parsedFeature = readFeaturesHandler.features.get(0);
Assert.assertEquals("config", parsedFeature.getConfigParam("id-param"));
Assert.assertEquals("config", parsedFeature.getConfigParam("id-param2"));
Assert.assertEquals("config", parsedFeature.getConfigParam("param"));
parsedFeature = readFeaturesHandler.features.get(1);
Assert.assertEquals("resolved", parsedFeature.getConfigParam("id-param"));
Assert.assertEquals("config", parsedFeature.getConfigParam("param"));
}
Aggregations