Search in sources :

Example 11 with ModelTestControllerVersion

use of org.jboss.as.model.test.ModelTestControllerVersion in project wildfly by wildfly.

the class DatasourcesSubsystemTestCase method testTransformerEAP7Rejection.

/**
     * Tests transformation of model from latest version which needs to be rejected in EAP 7.0.0
     *
     * @throws Exception
     */
private void testTransformerEAP7Rejection(String subsystemXml) throws Exception {
    //Use the non-runtime version of the extension which will happen on the HC
    ModelTestControllerVersion eap7ControllerVersion = ModelTestControllerVersion.EAP_7_0_0;
    ModelVersion eap7ModelVersion = ModelVersion.create(4, 0, 0);
    KernelServicesBuilder builder = createKernelServicesBuilder(AdditionalInitialization.MANAGEMENT);
    KernelServices mainServices = initialKernelServices(builder, eap7ControllerVersion, eap7ModelVersion);
    List<ModelNode> ops = builder.parseXmlResource(subsystemXml);
    PathAddress subsystemAddress = PathAddress.pathAddress(DataSourcesSubsystemRootDefinition.PATH_SUBSYSTEM);
    ModelTestUtils.checkFailedTransformedBootOperations(mainServices, eap7ModelVersion, ops, new FailedOperationTransformationConfig().addFailedAttribute(subsystemAddress.append(DataSourceDefinition.PATH_DATASOURCE), new RejectUndefinedAttribute(Constants.CONNECTION_URL.getName())));
}
Also used : FailedOperationTransformationConfig(org.jboss.as.model.test.FailedOperationTransformationConfig) PathAddress(org.jboss.as.controller.PathAddress) KernelServices(org.jboss.as.subsystem.test.KernelServices) ModelTestControllerVersion(org.jboss.as.model.test.ModelTestControllerVersion) ModelVersion(org.jboss.as.controller.ModelVersion) ModelNode(org.jboss.dmr.ModelNode) KernelServicesBuilder(org.jboss.as.subsystem.test.KernelServicesBuilder)

Aggregations

ModelTestControllerVersion (org.jboss.as.model.test.ModelTestControllerVersion)11 Test (org.junit.Test)8 AbstractSubsystemBaseTest (org.jboss.as.subsystem.test.AbstractSubsystemBaseTest)6 ModelVersion (org.jboss.as.controller.ModelVersion)5 KernelServices (org.jboss.as.subsystem.test.KernelServices)5 KernelServicesBuilder (org.jboss.as.subsystem.test.KernelServicesBuilder)5 ModelNode (org.jboss.dmr.ModelNode)4 FailedOperationTransformationConfig (org.jboss.as.model.test.FailedOperationTransformationConfig)3 PathAddress (org.jboss.as.controller.PathAddress)1