use of org.jboss.as.subsystem.test.KernelServices 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.KernelServices in project wildfly by wildfly.
the class OperationSequencesTestCase method testLocalCacheAddRemoveAddSequence.
@Test
public void testLocalCacheAddRemoveAddSequence() throws Exception {
// Parse and install the XML into the controller
String subsystemXml = getSubsystemXml();
KernelServices servicesA = this.createKernelServicesBuilder().setSubsystemXml(subsystemXml).build();
ModelNode addOp = getCacheAddOperation("maximal", LocalCacheResourceDefinition.WILDCARD_PATH.getKey(), "fred");
ModelNode removeOp = getCacheRemoveOperation("maximal", LocalCacheResourceDefinition.WILDCARD_PATH.getKey(), "fred");
// add a local cache
ModelNode result = servicesA.executeOperation(addOp);
Assert.assertEquals(result.get(FAILURE_DESCRIPTION).asString(), SUCCESS, result.get(OUTCOME).asString());
// remove the local cache
result = servicesA.executeOperation(removeOp);
Assert.assertEquals(result.get(FAILURE_DESCRIPTION).asString(), SUCCESS, result.get(OUTCOME).asString());
// add the same local cache
result = servicesA.executeOperation(addOp);
Assert.assertEquals(result.get(FAILURE_DESCRIPTION).asString(), SUCCESS, result.get(OUTCOME).asString());
}
use of org.jboss.as.subsystem.test.KernelServices in project wildfly by wildfly.
the class JGroupsSubsystemParsingTestCase method testParseAndMarshalModel.
/**
* Starts a controller with a given subsystem xml and then checks that a second controller
* started with the xml marshalled from the first one results in the same model
*/
@Test
public void testParseAndMarshalModel() throws Exception {
KernelServices services = this.buildKernelServices();
// Get the model and the persisted xml from the first controller
ModelNode modelA = services.readWholeModel();
String marshalled = services.getPersistedSubsystemXml();
ModelNode modelB = this.buildKernelServices(marshalled).readWholeModel();
// Make sure the models from the two controllers are identical
super.compare(modelA, modelB);
}
use of org.jboss.as.subsystem.test.KernelServices 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.KernelServices 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);
}
Aggregations