use of org.jboss.as.subsystem.test.KernelServicesBuilder 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);
}
use of org.jboss.as.subsystem.test.KernelServicesBuilder in project wildfly by wildfly.
the class InfinispanTransformersTestCase method buildKernelServices.
private KernelServices buildKernelServices(String xml, ModelTestControllerVersion controllerVersion, ModelVersion version, String... mavenResourceURLs) throws Exception {
KernelServicesBuilder builder = this.createKernelServicesBuilder().setSubsystemXml(xml);
builder.createLegacyKernelServicesBuilder(AdditionalInitialization.MANAGEMENT, controllerVersion, version).addMavenResourceURL(mavenResourceURLs).skipReverseControllerCheck().dontPersistXml();
KernelServices services = builder.build();
Assert.assertTrue(ModelTestControllerVersion.MASTER + " boot failed", services.isSuccessfulBoot());
Assert.assertTrue(controllerVersion.getMavenGavVersion() + " boot failed", services.getLegacyServices(version).isSuccessfulBoot());
return services;
}
use of org.jboss.as.subsystem.test.KernelServicesBuilder in project wildfly by wildfly.
the class JacORBTransformersTestCase method testTransformersSecurityIdentity.
private void testTransformersSecurityIdentity(ModelTestControllerVersion controllerVersion, ModelVersion modelVersion) throws Exception {
KernelServicesBuilder builder = createKernelServicesBuilder(AdditionalInitialization.ADMIN_ONLY_HC).setSubsystemXml(readResource("subsystem-security-identity.xml"));
// 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());
ModelNode transformed = checkSubsystemModelTransformation(mainServices, modelVersion).get(SUBSYSTEM, JacORBExtension.SUBSYSTEM_NAME);
Assert.assertEquals("identity", transformed.get("security").asString());
List<ModelNode> properties = transformed.get(ModelDescriptionConstants.PROPERTIES).asList();
Assert.assertEquals(1, properties.size());
Assert.assertEquals("some_value", properties.get(0).get("some_property").asString());
}
use of org.jboss.as.subsystem.test.KernelServicesBuilder in project wildfly by wildfly.
the class JacORBTransformersTestCase method testTransformersSecurityClient.
private void testTransformersSecurityClient(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());
FailedOperationTransformationConfig config = new FailedOperationTransformationConfig();
ModelTestUtils.checkFailedTransformedBootOperations(mainServices, modelVersion, builder.parseXmlResource("subsystem-security-client.xml"), config);
checkSubsystemModelTransformation(mainServices, modelVersion);
}
use of org.jboss.as.subsystem.test.KernelServicesBuilder in project wildfly by wildfly.
the class JacORBTransformersTestCase method testTransformers.
private void testTransformers(ModelTestControllerVersion controllerVersion, ModelVersion modelVersion) throws Exception {
KernelServicesBuilder builder = createKernelServicesBuilder(AdditionalInitialization.ADMIN_ONLY_HC).setSubsystemXmlResource("subsystem-transform.xml");
// 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();
KernelServices legacyServices = mainServices.getLegacyServices(modelVersion);
Assert.assertTrue(mainServices.isSuccessfulBoot());
Assert.assertTrue(legacyServices.isSuccessfulBoot());
checkSubsystemModelTransformation(mainServices, modelVersion, new ModelFixer() {
@Override
public ModelNode fixModel(ModelNode modelNode) {
//modelNode.get(JacORBSubsystemDefinitions.PERSISTENT_SERVER_ID.getName()).set(JacORBSubsystemDefinitions.PERSISTENT_SERVER_ID.getDefaultValue());
modelNode.get(JacORBSubsystemDefinitions.INTEROP_CHUNK_RMI_VALUETYPES.getName()).set(JacORBSubsystemDefinitions.INTEROP_CHUNK_RMI_VALUETYPES.getDefaultValue());
return modelNode;
}
});
}
Aggregations