use of org.wildfly.extras.config.ConfigContext in project wildfly-camel by wildfly-extras.
the class LayerConfigTest method testApplyLayerConfigChange2.
@Test
public void testApplyLayerConfigChange2() throws Exception {
ConfigPlugin plugin = new ConfigPlugin() {
@Override
public String getConfigName() {
return "foo";
}
@Override
public List<LayerConfig> getLayerConfigs() {
return Arrays.asList(new LayerConfig("fuse_6.2.1", Type.REQUIRED, -10), new LayerConfig("soa_6.2.1", Type.REQUIRED, -10), new LayerConfig("brms_6.2.1", Type.INSTALLING, -9));
}
@Override
public boolean applyStandaloneConfigChange(ConfigContext context, boolean enable) {
return false;
}
@Override
public boolean applyDomainConfigChange(ConfigContext context, boolean enable) {
return false;
}
};
// Install/Uninstall scenario.
List<String> layers;
try {
layers = list("foo", "example");
ConfigSupport.applyLayerChanges(plugin, layers, true);
Assert.fail("Expecting exception since required modules are not installed");
} catch (Exception e) {
}
layers = list("fuse", "soa");
layers = ConfigSupport.applyLayerChanges(plugin, layers, true);
Assert.assertEquals(list("fuse", "soa", "brms_6.2.1"), layers);
}
Aggregations