Search in sources :

Example 21 with ModelVersion

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

the class JacORBExtension method registerTransformers.

/**
     * Register the transformers for the 1.3.0 version.
     *
     * @param subsystem the subsystems registration
     */
protected static void registerTransformers(final SubsystemRegistration subsystem) {
    ChainedTransformationDescriptionBuilder chained = ResourceTransformationDescriptionBuilder.Factory.createChainedSubystemInstance(CURRENT_MODEL_VERSION);
    ModelVersion MODEL_VERSION_EAP64 = ModelVersion.create(1, 4, 0);
    //also EAP6.2
    ModelVersion MODEL_VERSION_EAP63 = ModelVersion.create(1, 3, 0);
    ResourceTransformationDescriptionBuilder builder64 = chained.createBuilder(CURRENT_MODEL_VERSION, MODEL_VERSION_EAP64);
    builder64.getAttributeBuilder().addRejectCheck(RejectAttributeChecker.DEFINED, JacORBSubsystemDefinitions.PERSISTENT_SERVER_ID).setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(JacORBSubsystemDefinitions.PERSISTENT_SERVER_ID.getDefaultValue()), JacORBSubsystemDefinitions.PERSISTENT_SERVER_ID).setValueConverter(new AttributeConverter.DefaultValueAttributeConverter(JacORBSubsystemDefinitions.INTEROP_CHUNK_RMI_VALUETYPES), JacORBSubsystemDefinitions.INTEROP_CHUNK_RMI_VALUETYPES);
    ResourceTransformationDescriptionBuilder builder63 = chained.createBuilder(MODEL_VERSION_EAP64, MODEL_VERSION_EAP63);
    builder63.getAttributeBuilder().addRejectCheck(RejectAttributeChecker.DEFINED, IORTransportConfigDefinition.ATTRIBUTES.toArray(new AttributeDefinition[0])).addRejectCheck(RejectAttributeChecker.DEFINED, IORASContextDefinition.ATTRIBUTES.toArray(new AttributeDefinition[0])).addRejectCheck(RejectAttributeChecker.DEFINED, IORSASContextDefinition.ATTRIBUTES.toArray(new AttributeDefinition[0])).end().rejectChildResource(IORSettingsDefinition.INSTANCE.getPathElement());
    chained.buildAndRegister(subsystem, new ModelVersion[] { MODEL_VERSION_EAP64, MODEL_VERSION_EAP63 });
}
Also used : AttributeConverter(org.jboss.as.controller.transform.description.AttributeConverter) ChainedTransformationDescriptionBuilder(org.jboss.as.controller.transform.description.ChainedTransformationDescriptionBuilder) ResourceTransformationDescriptionBuilder(org.jboss.as.controller.transform.description.ResourceTransformationDescriptionBuilder) AttributeDefinition(org.jboss.as.controller.AttributeDefinition) ModelVersion(org.jboss.as.controller.ModelVersion)

Example 22 with ModelVersion

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

the class WebservicesSubsystemParserTestCase method testRejections_2_0_0.

private void testRejections_2_0_0(ModelTestControllerVersion controllerVersion) throws Exception {
    // create builder for current subsystem version
    KernelServicesBuilder builder = createKernelServicesBuilder(createAdditionalInitialization());
    // create builder for legacy subsystem version
    ModelVersion version_2_0_0 = ModelVersion.create(2, 0, 0);
    builder.createLegacyKernelServicesBuilder(null, controllerVersion, version_2_0_0).addMavenResourceURL("org.jboss.eap:wildfly-webservices-server-integration:" + controllerVersion.getMavenGavVersion()).configureReverseControllerCheck(AdditionalInitialization.MANAGEMENT, null).dontPersistXml();
    KernelServices mainServices = builder.build();
    KernelServices legacyServices = mainServices.getLegacyServices(version_2_0_0);
    Assert.assertNotNull(legacyServices);
    Assert.assertTrue("main services did not boot", mainServices.isSuccessfulBoot());
    Assert.assertTrue(legacyServices.isSuccessfulBoot());
    List<ModelNode> xmlOps = builder.parseXmlResource("ws-subsystem20.xml");
    ModelTestUtils.checkFailedTransformedBootOperations(mainServices, version_2_0_0, xmlOps, getFailedTransformationConfig());
}
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)

Example 23 with ModelVersion

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

the class WebSubsystemTestCase method testRejectingTransformers_1_4_0.

private void testRejectingTransformers_1_4_0(ModelTestControllerVersion controllerVersion) throws Exception {
    ModelVersion modelVersion = ModelVersion.create(1, 4, 0);
    KernelServicesBuilder builder = createKernelServicesBuilder(createAdditionalInitialization());
    builder.createLegacyKernelServicesBuilder(null, controllerVersion, modelVersion).addMavenResourceURL("org.jboss.as:jboss-as-web:" + controllerVersion.getMavenGavVersion()).setExtensionClassName("org.jboss.as.web.WebExtension").configureReverseControllerCheck(createAdditionalInitialization(), null);
    KernelServices mainServices = builder.build();
    KernelServices legacyServices = mainServices.getLegacyServices(modelVersion);
    Assert.assertTrue("main services did not boot", mainServices.isSuccessfulBoot());
    Assert.assertTrue(legacyServices.isSuccessfulBoot());
    final PathAddress subsystem = PathAddress.EMPTY_ADDRESS.append("subsystem", "web");
    List<ModelNode> xmlOps = builder.parseXmlResource("subsystem-2.2.0.xml");
    FailedOperationTransformationConfig config = new FailedOperationTransformationConfig().addFailedAttribute(subsystem, new IntExpressionConfig("default-session-timeout")).addFailedAttribute(subsystem.append("virtual-server", "default-host").append("configuration", "sso"), new BooleanExpressionConfig("http-only"));
    ModelTestUtils.checkFailedTransformedBootOperations(mainServices, modelVersion, xmlOps, config);
}
Also used : FailedOperationTransformationConfig(org.jboss.as.model.test.FailedOperationTransformationConfig) PathAddress(org.jboss.as.controller.PathAddress) 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)

Example 24 with ModelVersion

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

the class WebSubsystemTestCase method testTransformation_1_4_0.

//no need to test target 6.4 as current == 6.4
private void testTransformation_1_4_0(ModelTestControllerVersion controllerVersion) throws Exception {
    ModelVersion modelVersion = ModelVersion.create(1, 4, 0);
    String subsystemXml = readResource("subsystem-1.4.0.xml");
    KernelServicesBuilder builder = createKernelServicesBuilder(createAdditionalInitialization()).setSubsystemXml(subsystemXml);
    builder.createLegacyKernelServicesBuilder(null, controllerVersion, modelVersion).addMavenResourceURL("org.jboss.as:jboss-as-web:" + controllerVersion.getMavenGavVersion()).setExtensionClassName("org.jboss.as.web.WebExtension").configureReverseControllerCheck(createAdditionalInitialization(), null);
    KernelServices mainServices = builder.build();
    KernelServices legacyServices = mainServices.getLegacyServices(modelVersion);
    Assert.assertTrue(mainServices.isSuccessfulBoot());
    Assert.assertTrue(legacyServices.isSuccessfulBoot());
    checkSubsystemModelTransformation(mainServices, modelVersion, new ModelFixer.CumulativeModelFixer(SSLConfigurationNameFixer.INSTANCE, AccessLogPrefixFixer_1_2_0.INSTANCE));
}
Also used : KernelServices(org.jboss.as.subsystem.test.KernelServices) ModelVersion(org.jboss.as.controller.ModelVersion) ModelFixer(org.jboss.as.model.test.ModelFixer) KernelServicesBuilder(org.jboss.as.subsystem.test.KernelServicesBuilder)

Example 25 with ModelVersion

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

the class WebSubsystemTestCase method testRejectingTransformers_1_3_0.

private void testRejectingTransformers_1_3_0(ModelTestControllerVersion controllerVersion) throws Exception {
    ModelVersion modelVersion = ModelVersion.create(1, 3, 0);
    KernelServicesBuilder builder = createKernelServicesBuilder(createAdditionalInitialization());
    builder.createLegacyKernelServicesBuilder(null, controllerVersion, modelVersion).addMavenResourceURL("org.jboss.as:jboss-as-web:" + controllerVersion.getMavenGavVersion()).setExtensionClassName("org.jboss.as.web.WebExtension").configureReverseControllerCheck(createAdditionalInitialization(), null);
    KernelServices mainServices = builder.build();
    KernelServices legacyServices = mainServices.getLegacyServices(modelVersion);
    Assert.assertTrue("main services did not boot", mainServices.isSuccessfulBoot());
    Assert.assertTrue(legacyServices.isSuccessfulBoot());
    final PathAddress subsystem = PathAddress.EMPTY_ADDRESS.append("subsystem", "web");
    List<ModelNode> xmlOps = builder.parseXmlResource("subsystem-2.2.0.xml");
    FailedOperationTransformationConfig config = new FailedOperationTransformationConfig().addFailedAttribute(subsystem, new IntExpressionConfig("default-session-timeout")).addFailedAttribute(subsystem.append(PathElement.pathElement("connector", "http")), new FailedOperationTransformationConfig.NewAttributesConfig("redirect-binding", "proxy-binding")).addFailedAttribute(subsystem.append("virtual-server", "default-host").append("configuration", "sso"), new BooleanExpressionConfig("http-only"));
    ModelTestUtils.checkFailedTransformedBootOperations(mainServices, modelVersion, xmlOps, config);
    checkUndefinedCipherSuite(mainServices, modelVersion);
}
Also used : FailedOperationTransformationConfig(org.jboss.as.model.test.FailedOperationTransformationConfig) PathAddress(org.jboss.as.controller.PathAddress) 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)

Aggregations

ModelVersion (org.jboss.as.controller.ModelVersion)37 KernelServices (org.jboss.as.subsystem.test.KernelServices)30 KernelServicesBuilder (org.jboss.as.subsystem.test.KernelServicesBuilder)28 ModelNode (org.jboss.dmr.ModelNode)18 FailedOperationTransformationConfig (org.jboss.as.model.test.FailedOperationTransformationConfig)10 ResourceTransformationDescriptionBuilder (org.jboss.as.controller.transform.description.ResourceTransformationDescriptionBuilder)7 PathAddress (org.jboss.as.controller.PathAddress)6 ChainedTransformationDescriptionBuilder (org.jboss.as.controller.transform.description.ChainedTransformationDescriptionBuilder)5 ModelTestControllerVersion (org.jboss.as.model.test.ModelTestControllerVersion)5 Test (org.junit.Test)4 ModelFixer (org.jboss.as.model.test.ModelFixer)3 NewAttributesConfig (org.jboss.as.model.test.FailedOperationTransformationConfig.NewAttributesConfig)2 AbstractSubsystemBaseTest (org.jboss.as.subsystem.test.AbstractSubsystemBaseTest)2 Map (java.util.Map)1 JGroupsSubsystemInitialization (org.jboss.as.clustering.jgroups.subsystem.JGroupsSubsystemInitialization)1 AdditionalInitialization (org.jboss.as.clustering.subsystem.AdditionalInitialization)1 AttributeDefinition (org.jboss.as.controller.AttributeDefinition)1 TransformedOperation (org.jboss.as.controller.transform.OperationTransformer.TransformedOperation)1 TransformationContext (org.jboss.as.controller.transform.TransformationContext)1 AttributeConverter (org.jboss.as.controller.transform.description.AttributeConverter)1