use of org.jboss.as.controller.ModelVersion in project wildfly by wildfly.
the class EeSubsystemTestCase method testTransformersDiscardsImpliedValues1_1_0.
private void testTransformersDiscardsImpliedValues1_1_0(ModelTestControllerVersion controllerVersion) throws Exception {
String subsystemXml = readResource("subsystem-transformers-discard.xml");
ModelVersion modelVersion = ModelVersion.create(1, 1, 0);
//Use the non-runtime version of the extension which will happen on the HC
KernelServicesBuilder builder = createKernelServicesBuilder(AdditionalInitialization.MANAGEMENT).setSubsystemXml(subsystemXml);
// Add legacy subsystems
builder.createLegacyKernelServicesBuilder(null, controllerVersion, modelVersion).addMavenResourceURL("org.jboss.as:jboss-as-ee:" + controllerVersion.getMavenGavVersion()).configureReverseControllerCheck(AdditionalInitialization.MANAGEMENT, null);
KernelServices mainServices = builder.build();
KernelServices legacyServices = mainServices.getLegacyServices(modelVersion);
Assert.assertTrue(mainServices.isSuccessfulBoot());
Assert.assertTrue(legacyServices.isSuccessfulBoot());
}
use of org.jboss.as.controller.ModelVersion in project wildfly by wildfly.
the class EeSubsystemTestCase method testTransformers800.
//@Test don't test as we dont have test controller
public void testTransformers800() throws Exception {
final ModelVersion legacyModelVersion = ModelVersion.create(3, 0, 0);
final ModelTestControllerVersion controllerVersion = ModelTestControllerVersion.WILDFLY_8_2_0_FINAL;
KernelServicesBuilder builder = createKernelServicesBuilder(AdditionalInitialization.MANAGEMENT);
// Add legacy subsystems
builder.createLegacyKernelServicesBuilder(null, controllerVersion, legacyModelVersion).addMavenResourceURL("org.wildfly:wildfly-ee:" + controllerVersion.getMavenGavVersion());
KernelServices mainServices = builder.build();
KernelServices legacyServices = mainServices.getLegacyServices(legacyModelVersion);
Assert.assertTrue(mainServices.isSuccessfulBoot());
Assert.assertTrue(legacyServices.isSuccessfulBoot());
List<ModelNode> bootOps = builder.parseXmlResource("subsystem-wf8-transformer.xml");
ModelTestUtils.checkFailedTransformedBootOperations(mainServices, legacyModelVersion, bootOps, new FailedOperationTransformationConfig().addFailedAttribute(PathAddress.pathAddress(EeExtension.PATH_SUBSYSTEM, ManagedExecutorServiceResourceDefinition.INSTANCE.getPathElement()), new RejectUndefinedAttribute(new ModelNode(Integer.MAX_VALUE), ManagedExecutorServiceResourceDefinition.CORE_THREADS_AD.getName())).addFailedAttribute(PathAddress.pathAddress(EeExtension.PATH_SUBSYSTEM, ManagedScheduledExecutorServiceResourceDefinition.INSTANCE.getPathElement()), new RejectUndefinedAttribute(new ModelNode(Integer.MAX_VALUE), ManagedScheduledExecutorServiceResourceDefinition.CORE_THREADS_AD.getName())));
}
use of org.jboss.as.controller.ModelVersion in project wildfly by wildfly.
the class WSExtension method registerTransformers1_2_0.
private void registerTransformers1_2_0(SubsystemRegistration registration) {
ModelVersion version = ModelVersion.create(1, 2, 0);
ResourceTransformationDescriptionBuilder builder = TransformationDescriptionBuilder.Factory.createSubsystemInstance();
builder.getAttributeBuilder().setDiscard(DiscardAttributeChecker.ALWAYS, Attributes.STATISTICS_ENABLED);
builder.getAttributeBuilder().setDiscard(DiscardAttributeChecker.ALWAYS, Attributes.WSDL_URI_SCHEME);
builder.getAttributeBuilder().setDiscard(DiscardAttributeChecker.ALWAYS, Attributes.WSDL_PATH_REWRITE_RULE);
TransformationDescription.Tools.register(builder.build(), registration, version);
}
use of org.jboss.as.controller.ModelVersion in project wildfly by wildfly.
the class WebservicesSubsystemParserTestCase method testTransformers_1_2_0.
private void testTransformers_1_2_0(ModelTestControllerVersion controllerVersion) throws Exception {
// create builder for current subsystem version
KernelServicesBuilder builder = createKernelServicesBuilder(createAdditionalInitialization()).setSubsystemXmlResource("ws-subsystem12.xml");
// create builder for legacy subsystem version
ModelVersion version_1_2_0 = ModelVersion.create(1, 2, 0);
builder.createLegacyKernelServicesBuilder(null, controllerVersion, version_1_2_0).addMavenResourceURL("org.jboss.as:jboss-as-webservices-server-integration:" + controllerVersion.getMavenGavVersion()).configureReverseControllerCheck(AdditionalInitialization.MANAGEMENT, null);
KernelServices mainServices = builder.build();
KernelServices legacyServices = mainServices.getLegacyServices(version_1_2_0);
Assert.assertNotNull(legacyServices);
Assert.assertTrue("main services did not boot", mainServices.isSuccessfulBoot());
Assert.assertTrue(legacyServices.isSuccessfulBoot());
checkSubsystemModelTransformation(mainServices, version_1_2_0);
}
use of org.jboss.as.controller.ModelVersion in project wildfly by wildfly.
the class WeldSubsystemTestCase method testRejectTransformers10.
private void testRejectTransformers10(ModelTestControllerVersion controllerVersion) throws Exception {
ModelVersion modelVersion = ModelVersion.create(1, 0, 0);
KernelServicesBuilder builder = createKernelServicesBuilder(AdditionalInitialization.MANAGEMENT);
//which is why we need to include the jboss-as-controller artifact.
builder.createLegacyKernelServicesBuilder(AdditionalInitialization.MANAGEMENT, controllerVersion, modelVersion).addMavenResourceURL("org.jboss.as:jboss-as-weld:" + controllerVersion.getMavenGavVersion()).skipReverseControllerCheck().dontPersistXml();
KernelServices mainServices = builder.build();
Assert.assertTrue(mainServices.isSuccessfulBoot());
Assert.assertTrue(mainServices.getLegacyServices(modelVersion).isSuccessfulBoot());
ModelTestUtils.checkFailedTransformedBootOperations(mainServices, modelVersion, parse(getSubsystemXml("subsystem-reject.xml")), new FailedOperationTransformationConfig().addFailedAttribute(PathAddress.pathAddress(WeldExtension.PATH_SUBSYSTEM), ChainedConfig.createBuilder(WeldResourceDefinition.NON_PORTABLE_MODE_ATTRIBUTE, WeldResourceDefinition.REQUIRE_BEAN_DESCRIPTOR_ATTRIBUTE).addConfig(new FalseOrUndefinedToTrueConfig(WeldResourceDefinition.NON_PORTABLE_MODE_ATTRIBUTE, WeldResourceDefinition.REQUIRE_BEAN_DESCRIPTOR_ATTRIBUTE)).addConfig(new NewAttributesConfig(WeldResourceDefinition.DEVELOPMENT_MODE_ATTRIBUTE)).addConfig(new NewAttributesConfig(WeldResourceDefinition.THREAD_POOL_SIZE_ATTRIBUTE)).build()));
}
Aggregations