Search in sources :

Example 46 with ModelVersion

use of org.jboss.as.controller.ModelVersion in project wildfly by wildfly.

the class JGroupsTransformersTestCase method testRejections.

private void testRejections(final ModelTestControllerVersion controller) throws Exception {
    final ModelVersion version = getModelVersion(controller).getVersion();
    final String[] dependencies = getDependencies(controller);
    // create builder for current subsystem version
    KernelServicesBuilder builder = createKernelServicesBuilder(createAdditionalInitialization());
    // initialize the legacy services and add required jars
    builder.createLegacyKernelServicesBuilder(createAdditionalInitialization(), controller, version).addSingleChildFirstClass(AdditionalInitialization.class).addMavenResourceURL(dependencies).addSingleChildFirstClass(ClassConfigurator.class).dontPersistXml();
    KernelServices services = builder.build();
    Assert.assertTrue(services.isSuccessfulBoot());
    KernelServices legacyServices = services.getLegacyServices(version);
    Assert.assertNotNull(legacyServices);
    Assert.assertTrue(legacyServices.isSuccessfulBoot());
    List<ModelNode> operations = builder.parseXmlResource("subsystem-jgroups-transform-reject.xml");
    ModelTestUtils.checkFailedTransformedBootOperations(services, version, operations, createFailedOperationTransformationConfig(version));
}
Also used : KernelServices(org.jboss.as.subsystem.test.KernelServices) ModelVersion(org.jboss.as.controller.ModelVersion) ModelNode(org.jboss.dmr.ModelNode) KernelServicesBuilder(org.jboss.as.subsystem.test.KernelServicesBuilder) AdditionalInitialization(org.jboss.as.clustering.subsystem.AdditionalInitialization) ClassConfigurator(org.jgroups.conf.ClassConfigurator)

Example 47 with ModelVersion

use of org.jboss.as.controller.ModelVersion in project wildfly by wildfly.

the class SingletonTransformersTestCase method testTransformation.

private void testTransformation(final ModelTestControllerVersion controller) throws Exception {
    final ModelVersion version = getModelVersion(controller).getVersion();
    final String[] dependencies = getDependencies(controller);
    KernelServices services = this.buildKernelServices("subsystem-transform.xml", controller, version, dependencies);
    checkSubsystemModelTransformation(services, version, null, false);
}
Also used : KernelServices(org.jboss.as.subsystem.test.KernelServices) ModelVersion(org.jboss.as.controller.ModelVersion)

Example 48 with ModelVersion

use of org.jboss.as.controller.ModelVersion in project wildfly by wildfly.

the class DistributableWebExtensionTransformerRegistration method registerTransformers.

@Override
public void registerTransformers(SubsystemTransformerRegistration registration) {
    // Register transformers for all but the current model
    for (DistributableWebModel model : EnumSet.complementOf(EnumSet.of(DistributableWebModel.CURRENT))) {
        ModelVersion version = model.getVersion();
        TransformationDescription transformation = new DistributableWebResourceTransformer().apply(version).build();
        TransformationDescription.Tools.register(transformation, registration, version);
    }
}
Also used : TransformationDescription(org.jboss.as.controller.transform.description.TransformationDescription) ModelVersion(org.jboss.as.controller.ModelVersion)

Example 49 with ModelVersion

use of org.jboss.as.controller.ModelVersion in project wildfly by wildfly.

the class SecurityTransformersTestCase method testTransformers.

private void testTransformers(ModelTestControllerVersion controllerVersion) throws Exception {
    ModelVersion version = ModelVersion.create(2, 0, 0);
    final String artifactId = "wildfly-security";
    String mavenGav = String.format("%s:%s:%s", controllerVersion.getMavenGroupId(), artifactId, controllerVersion.getMavenGavVersion());
    testTransformers(controllerVersion, version, mavenGav);
    testReject(controllerVersion, version, mavenGav);
}
Also used : ModelVersion(org.jboss.as.controller.ModelVersion)

Aggregations

ModelVersion (org.jboss.as.controller.ModelVersion)49 KernelServices (org.jboss.as.subsystem.test.KernelServices)34 KernelServicesBuilder (org.jboss.as.subsystem.test.KernelServicesBuilder)30 ModelNode (org.jboss.dmr.ModelNode)18 FailedOperationTransformationConfig (org.jboss.as.model.test.FailedOperationTransformationConfig)11 ResourceTransformationDescriptionBuilder (org.jboss.as.controller.transform.description.ResourceTransformationDescriptionBuilder)8 PathAddress (org.jboss.as.controller.PathAddress)6 ChainedTransformationDescriptionBuilder (org.jboss.as.controller.transform.description.ChainedTransformationDescriptionBuilder)6 ModelTestControllerVersion (org.jboss.as.model.test.ModelTestControllerVersion)5 Test (org.junit.Test)4 AdditionalInitialization (org.jboss.as.clustering.subsystem.AdditionalInitialization)3 ModelFixer (org.jboss.as.model.test.ModelFixer)3 DiscardAttributeChecker (org.jboss.as.controller.transform.description.DiscardAttributeChecker)2 NewAttributesConfig (org.jboss.as.model.test.FailedOperationTransformationConfig.NewAttributesConfig)2 AbstractSubsystemBaseTest (org.jboss.as.subsystem.test.AbstractSubsystemBaseTest)2 HashSet (java.util.HashSet)1 Map (java.util.Map)1 AttributeDefinition (org.jboss.as.controller.AttributeDefinition)1 SubsystemRegistration (org.jboss.as.controller.SubsystemRegistration)1 TransformedOperation (org.jboss.as.controller.transform.OperationTransformer.TransformedOperation)1