use of org.jboss.as.subsystem.test.KernelServicesBuilder in project wildfly by wildfly.
the class ModClusterTransformersTestCase method testTransformation.
private void testTransformation(ModelTestControllerVersion controllerVersion) throws Exception {
String[] dependencies = getDependencies(controllerVersion);
String subsystemXml = readResource("subsystem-transform.xml");
ModClusterModel model = getModelVersion(controllerVersion);
ModelVersion modelVersion = model.getVersion();
String extensionClassName = (model.getVersion().getMajor() == 1) ? "org.jboss.as.modcluster.ModClusterExtension" : "org.wildfly.extension.mod_cluster.ModClusterExtension";
KernelServicesBuilder builder = createKernelServicesBuilder(createAdditionalInitialization()).setSubsystemXml(subsystemXml);
builder.createLegacyKernelServicesBuilder(null, controllerVersion, modelVersion).addMavenResourceURL(dependencies).setExtensionClassName(extensionClassName).skipReverseControllerCheck();
KernelServices mainServices = builder.build();
KernelServices legacyServices = mainServices.getLegacyServices(modelVersion);
Assert.assertNotNull(legacyServices);
Assert.assertTrue(mainServices.isSuccessfulBoot());
Assert.assertTrue(legacyServices.isSuccessfulBoot());
checkSubsystemModelTransformation(mainServices, modelVersion, null, false);
}
use of org.jboss.as.subsystem.test.KernelServicesBuilder in project wildfly by wildfly.
the class InfinispanTransformersTestCase method testRejections.
private void testRejections(final ModelTestControllerVersion controller) throws Exception {
final ModelVersion version = getModelVersion(controller).getVersion();
final String[] dependencies = getDependencies(controller);
// create builder for current subsystem version
KernelServicesBuilder builder = this.createKernelServicesBuilder();
// initialize the legacy services
builder.createLegacyKernelServicesBuilder(createAdditionalInitialization(), controller, version).addSingleChildFirstClass(InfinispanSubsystemInitialization.class).addSingleChildFirstClass(JGroupsSubsystemInitialization.class).addSingleChildFirstClass(org.jboss.as.clustering.subsystem.AdditionalInitialization.class).addMavenResourceURL(dependencies).dontPersistXml();
KernelServices services = builder.build();
KernelServices legacyServices = services.getLegacyServices(version);
Assert.assertNotNull(legacyServices);
Assert.assertTrue("main services did not boot", services.isSuccessfulBoot());
Assert.assertTrue(legacyServices.isSuccessfulBoot());
// test failed operations involving backups
List<ModelNode> xmlOps = builder.parseXmlResource("infinispan-transformer-reject.xml");
ModelTestUtils.checkFailedTransformedBootOperations(services, version, xmlOps, createFailedOperationConfig(version));
}
use of org.jboss.as.subsystem.test.KernelServicesBuilder in project wildfly by wildfly.
the class JacORBTransformersTestCase method testTransformersIORSettings.
private void testTransformersIORSettings(ModelTestControllerVersion controllerVersion, ModelVersion modelVersion) throws Exception {
KernelServicesBuilder builder = createKernelServicesBuilder(AdditionalInitialization.ADMIN_ONLY_HC);
// Add legacy subsystems
builder.createLegacyKernelServicesBuilder(AdditionalInitialization.ADMIN_ONLY_HC, controllerVersion, modelVersion).addMavenResourceURL("org.jboss.as:jboss-as-jacorb:" + controllerVersion.getMavenGavVersion()).configureReverseControllerCheck(AdditionalInitialization.ADMIN_ONLY_HC, null);
KernelServices mainServices = builder.build();
assertTrue(mainServices.isSuccessfulBoot());
KernelServices legacyServices = mainServices.getLegacyServices(modelVersion);
assertNotNull(legacyServices);
assertTrue(legacyServices.isSuccessfulBoot());
ModelTestUtils.checkFailedTransformedBootOperations(mainServices, modelVersion, builder.parseXmlResource("subsystem-ior-settings.xml"), new FailedOperationTransformationConfig().addFailedAttribute(PathAddress.pathAddress(JacORBSubsystemResource.INSTANCE.getPathElement(), IORSettingsDefinition.INSTANCE.getPathElement()), FailedOperationTransformationConfig.REJECTED_RESOURCE).addFailedAttribute(PathAddress.pathAddress(JacORBSubsystemResource.INSTANCE.getPathElement(), IORSettingsDefinition.INSTANCE.getPathElement(), IORTransportConfigDefinition.INSTANCE.getPathElement()), FailedOperationTransformationConfig.REJECTED_RESOURCE).addFailedAttribute(PathAddress.pathAddress(JacORBSubsystemResource.INSTANCE.getPathElement(), IORSettingsDefinition.INSTANCE.getPathElement(), IORASContextDefinition.INSTANCE.getPathElement()), FailedOperationTransformationConfig.REJECTED_RESOURCE).addFailedAttribute(PathAddress.pathAddress(JacORBSubsystemResource.INSTANCE.getPathElement(), IORSettingsDefinition.INSTANCE.getPathElement(), IORSASContextDefinition.INSTANCE.getPathElement()), FailedOperationTransformationConfig.REJECTED_RESOURCE));
}
Aggregations