Search in sources :

Example 1 with NewAttributesConfig

use of org.jboss.as.model.test.FailedOperationTransformationConfig.NewAttributesConfig 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()));
}
Also used : FailedOperationTransformationConfig(org.jboss.as.model.test.FailedOperationTransformationConfig) NewAttributesConfig(org.jboss.as.model.test.FailedOperationTransformationConfig.NewAttributesConfig) KernelServices(org.jboss.as.subsystem.test.KernelServices) ModelVersion(org.jboss.as.controller.ModelVersion) KernelServicesBuilder(org.jboss.as.subsystem.test.KernelServicesBuilder)

Example 2 with NewAttributesConfig

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

the class WeldSubsystemTestCase method testTransformersRejectionEAP700.

@Test
public void testTransformersRejectionEAP700() throws Exception {
    ModelVersion modelVersion = ModelVersion.create(3, 0, 0);
    KernelServicesBuilder builder = createKernelServicesBuilder(AdditionalInitialization.MANAGEMENT);
    builder.createLegacyKernelServicesBuilder(AdditionalInitialization.MANAGEMENT, ModelTestControllerVersion.EAP_7_0_0, modelVersion).addMavenResourceURL("org.jboss.eap:wildfly-weld:" + ModelTestControllerVersion.EAP_7_0_0.getMavenGavVersion()).skipReverseControllerCheck().dontPersistXml();
    KernelServices mainServices = builder.build();
    assertTrue(mainServices.isSuccessfulBoot());
    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 NewAttributesConfig(WeldResourceDefinition.THREAD_POOL_SIZE_ATTRIBUTE)).build()));
}
Also used : FailedOperationTransformationConfig(org.jboss.as.model.test.FailedOperationTransformationConfig) NewAttributesConfig(org.jboss.as.model.test.FailedOperationTransformationConfig.NewAttributesConfig) KernelServices(org.jboss.as.subsystem.test.KernelServices) ModelVersion(org.jboss.as.controller.ModelVersion) KernelServicesBuilder(org.jboss.as.subsystem.test.KernelServicesBuilder) AbstractSubsystemBaseTest(org.jboss.as.subsystem.test.AbstractSubsystemBaseTest) Test(org.junit.Test)

Aggregations

ModelVersion (org.jboss.as.controller.ModelVersion)2 FailedOperationTransformationConfig (org.jboss.as.model.test.FailedOperationTransformationConfig)2 NewAttributesConfig (org.jboss.as.model.test.FailedOperationTransformationConfig.NewAttributesConfig)2 KernelServices (org.jboss.as.subsystem.test.KernelServices)2 KernelServicesBuilder (org.jboss.as.subsystem.test.KernelServicesBuilder)2 AbstractSubsystemBaseTest (org.jboss.as.subsystem.test.AbstractSubsystemBaseTest)1 Test (org.junit.Test)1