use of org.jboss.as.subsystem.test.KernelServices in project wildfly by wildfly.
the class SubsystemOperationsTestCase method testRemoveSubsystem.
@Test
public void testRemoveSubsystem() throws Exception {
final KernelServices kernelServices = boot();
final ModelNode removeSubsystemOp = SubsystemOperations.createRemoveOperation(createAddress(null));
executeOperation(kernelServices, removeSubsystemOp);
}
use of org.jboss.as.subsystem.test.KernelServices 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)));
}
use of org.jboss.as.subsystem.test.KernelServices 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.KernelServices in project wildfly by wildfly.
the class OperationSequencesTestCase method testCacheContainerAddRemoveAddSequence.
@Test
public void testCacheContainerAddRemoveAddSequence() throws Exception {
// Parse and install the XML into the controller
String subsystemXml = getSubsystemXml();
KernelServices servicesA = this.createKernelServicesBuilder().setSubsystemXml(subsystemXml).build();
ModelNode addContainerOp = getCacheContainerAddOperation("maximal2");
ModelNode removeContainerOp = getCacheContainerRemoveOperation("maximal2");
ModelNode addCacheOp = getCacheAddOperation("maximal2", LocalCacheResourceDefinition.WILDCARD_PATH.getKey(), "fred");
// add a cache container
ModelNode result = servicesA.executeOperation(addContainerOp);
Assert.assertEquals(result.get(FAILURE_DESCRIPTION).asString(), SUCCESS, result.get(OUTCOME).asString());
// add a local cache
result = servicesA.executeOperation(addCacheOp);
Assert.assertEquals(result.get(FAILURE_DESCRIPTION).asString(), SUCCESS, result.get(OUTCOME).asString());
// remove the cache container
result = servicesA.executeOperation(removeContainerOp);
Assert.assertEquals(result.get(FAILURE_DESCRIPTION).asString(), SUCCESS, result.get(OUTCOME).asString());
// add the same cache container
result = servicesA.executeOperation(addContainerOp);
Assert.assertEquals(result.get(FAILURE_DESCRIPTION).asString(), SUCCESS, result.get(OUTCOME).asString());
// add the same local cache
result = servicesA.executeOperation(addCacheOp);
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 OperationSequencesTestCase method testCacheContainerRemoveRemoveSequence.
@Test
public void testCacheContainerRemoveRemoveSequence() throws Exception {
// Parse and install the XML into the controller
String subsystemXml = getSubsystemXml();
KernelServices servicesA = this.createKernelServicesBuilder().setSubsystemXml(subsystemXml).build();
ModelNode addContainerOp = getCacheContainerAddOperation("maximal2");
ModelNode removeContainerOp = getCacheContainerRemoveOperation("maximal2");
ModelNode addCacheOp = getCacheAddOperation("maximal2", LocalCacheResourceDefinition.WILDCARD_PATH.getKey(), "fred");
// add a cache container
ModelNode result = servicesA.executeOperation(addContainerOp);
Assert.assertEquals(result.get(FAILURE_DESCRIPTION).asString(), SUCCESS, result.get(OUTCOME).asString());
// add a local cache
result = servicesA.executeOperation(addCacheOp);
Assert.assertEquals(result.get(FAILURE_DESCRIPTION).asString(), SUCCESS, result.get(OUTCOME).asString());
// remove the cache container
result = servicesA.executeOperation(removeContainerOp);
Assert.assertEquals(result.get(FAILURE_DESCRIPTION).asString(), SUCCESS, result.get(OUTCOME).asString());
// remove the cache container again
result = servicesA.executeOperation(removeContainerOp);
Assert.assertEquals(result.toString(), FAILED, result.get(OUTCOME).asString());
}
Aggregations