Search in sources :

Example 1 with ModelTestControllerVersion

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

the class SubsystemTransformerTestCase method testFailedTransformersEAP700.

@Test
public void testFailedTransformersEAP700() throws Exception {
    final KernelServicesBuilder builder = createKernelServicesBuilder(AdditionalInitialization.MANAGEMENT);
    final ModelVersion legacyVersion = ModelVersion.create(1, 1, 0);
    final ModelTestControllerVersion controllerVersion = ModelTestControllerVersion.EAP_7_0_0;
    // Add legacy subsystems
    builder.createLegacyKernelServicesBuilder(AdditionalInitialization.MANAGEMENT, controllerVersion, legacyVersion).addMavenResourceURL(controllerVersion.getMavenGroupId() + ":wildfly-batch-jberet:" + controllerVersion.getMavenGavVersion()).addMavenResourceURL(controllerVersion.getCoreMavenGroupId() + ":wildfly-threads:" + controllerVersion.getCoreVersion());
    final KernelServices mainServices = builder.build();
    final KernelServices legacyServices = mainServices.getLegacyServices(legacyVersion);
    Assert.assertNotNull(legacyServices);
    Assert.assertTrue("main services did not boot", mainServices.isSuccessfulBoot());
    Assert.assertTrue(legacyServices.isSuccessfulBoot());
    final List<ModelNode> ops = builder.parseXmlResource("/default-subsystem.xml");
    ModelTestUtils.checkFailedTransformedBootOperations(mainServices, legacyVersion, ops, new FailedOperationTransformationConfig().addFailedAttribute(PathAddress.pathAddress(BatchSubsystemDefinition.SUBSYSTEM_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(BatchSubsystemDefinition.SECURITY_DOMAIN)));
}
Also used : FailedOperationTransformationConfig(org.jboss.as.model.test.FailedOperationTransformationConfig) 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) Test(org.junit.Test)

Example 2 with ModelTestControllerVersion

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

the class SubsystemTransformerTestCase method testTransformersEAP700.

@Test
public void testTransformersEAP700() throws Exception {
    final KernelServicesBuilder builder = createKernelServicesBuilder(createAdditionalInitialization()).setSubsystemXmlResource("/default-subsystem_1_0.xml");
    final ModelVersion legacyVersion = ModelVersion.create(1, 1, 0);
    final ModelTestControllerVersion controllerVersion = ModelTestControllerVersion.EAP_7_0_0;
    // Add legacy subsystems
    builder.createLegacyKernelServicesBuilder(createAdditionalInitialization(), controllerVersion, legacyVersion).addMavenResourceURL(controllerVersion.getMavenGroupId() + ":wildfly-batch-jberet:" + controllerVersion.getMavenGavVersion()).addMavenResourceURL(controllerVersion.getCoreMavenGroupId() + ":wildfly-threads:" + controllerVersion.getCoreVersion());
    final KernelServices mainServices = builder.build();
    assertTrue(mainServices.isSuccessfulBoot());
    final KernelServices legacyServices = mainServices.getLegacyServices(legacyVersion);
    assertNotNull(legacyServices);
    assertTrue(legacyServices.isSuccessfulBoot());
    checkSubsystemModelTransformation(mainServices, legacyVersion, null, false);
}
Also used : KernelServices(org.jboss.as.subsystem.test.KernelServices) ModelTestControllerVersion(org.jboss.as.model.test.ModelTestControllerVersion) ModelVersion(org.jboss.as.controller.ModelVersion) KernelServicesBuilder(org.jboss.as.subsystem.test.KernelServicesBuilder) Test(org.junit.Test)

Example 3 with ModelTestControllerVersion

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

the class Ejb3TransformersTestCase method testRejectionsEAP620.

@Test
public void testRejectionsEAP620() throws Exception {
    ModelTestControllerVersion controller = ModelTestControllerVersion.EAP_6_2_0;
    this.testRejections(ModelVersion.create(1, 2, 1), controller, formatLegacySubsystemArtifact(controller), formatArtifact("org.jboss.as:jboss-as-threads:%s", controller), LEGACY_EJB_CLIENT_ARTIFACT);
}
Also used : ModelTestControllerVersion(org.jboss.as.model.test.ModelTestControllerVersion) AbstractSubsystemBaseTest(org.jboss.as.subsystem.test.AbstractSubsystemBaseTest) Test(org.junit.Test)

Example 4 with ModelTestControllerVersion

use of org.jboss.as.model.test.ModelTestControllerVersion 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())));
}
Also used : FailedOperationTransformationConfig(org.jboss.as.model.test.FailedOperationTransformationConfig) 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)

Example 5 with ModelTestControllerVersion

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

the class DatasourcesSubsystemTestCase method testTransformerEAP7FullConfiguration.

/**
     * Tests transformation of model from latest version which works well in EAP 7.0.0 without setting up FailedOperationTransformationConfig.
     *
     * @throws Exception
     */
private void testTransformerEAP7FullConfiguration(String subsystemXml) throws Exception {
    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);
    ModelTestUtils.checkFailedTransformedBootOperations(mainServices, eap7ModelVersion, ops, FailedOperationTransformationConfig.NO_FAILURES);
}
Also used : 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