Package org.jboss.as.model.test
Class ModelTestKernelServicesImpl<T extends ModelTestKernelServices<T>>
java.lang.Object
org.jboss.as.model.test.ModelTestKernelServicesImpl<T>
- All Implemented Interfaces:
ModelTestKernelServices<T>
public abstract class ModelTestKernelServicesImpl<T extends ModelTestKernelServices<T>>
extends Object
implements ModelTestKernelServices<T>
- Author:
- Kabir Khan
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedModelTestKernelServicesImpl(org.jboss.msc.service.ServiceContainer container, ModelTestModelControllerService controllerService, StringConfigurationPersister persister, org.jboss.as.controller.registry.ManagementResourceRegistration rootRegistration, org.jboss.as.controller.operations.validation.OperationValidator operationValidator, org.jboss.as.controller.ModelVersion legacyModelVersion, boolean successfulBoot, Throwable bootError) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddLegacyKernelService(org.jboss.as.controller.ModelVersion modelVersion, T legacyServices) protected voidprotected org.jboss.as.controller.transform.TransformationContextcreateTransformationContext(org.jboss.as.controller.transform.TransformationTarget target, org.jboss.as.controller.transform.TransformerOperationAttachment attachment) voidexecuteForFailure(org.jboss.dmr.ModelNode operation, InputStream... inputStreams) Execute an operation in the model controller, expecting failure.org.jboss.dmr.ModelNodeexecuteForResult(org.jboss.dmr.ModelNode operation, InputStream... inputStreams) org.jboss.dmr.ModelNodeexecuteOperation(org.jboss.dmr.ModelNode operation, InputStream... inputStreams) Execute an operation in the model controllerorg.jboss.dmr.ModelNodeexecuteOperation(org.jboss.dmr.ModelNode operation, org.jboss.as.controller.ModelController.OperationTransactionControl txControl) Get any errors thrown on bootorg.jboss.msc.service.ServiceContainerGets the service containergetLegacyServices(org.jboss.as.controller.ModelVersion modelVersion) Gets the legacy controller services for the controller containing the passed in model versionReads the persisted subsystem xmlorg.jboss.as.controller.registry.ImmutableManagementResourceRegistrationprotected org.jboss.as.controller.transform.TransformerRegistryprotected org.jboss.dmr.ModelNodeinternalExecute(org.jboss.dmr.ModelNode operation, org.jboss.as.controller.OperationStepHandler handler) booleanGet whether the controller booted successfullyorg.jboss.dmr.ModelNodeReads the whole model from the model controller without aliases or runtime attributes/resourcesorg.jboss.dmr.ModelNodereadWholeModel(boolean includeAliases) Reads the whole model from the model controller without runtime attributes/resourcesorg.jboss.dmr.ModelNodereadWholeModel(boolean includeAliases, boolean includeRuntime) Reads the whole model from the model controllervoidshutdown()voidvalidateOperation(org.jboss.dmr.ModelNode operation) Validates the operation against the description providers in the model controllervoidvalidateOperations(List<org.jboss.dmr.ModelNode> operations) Validates the operations against the description providers in the model controllerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jboss.as.model.test.ModelTestKernelServices
executeOperation, getBootErrorCollectorFailures, getBootErrorDescription, hasBootErrorCollectorFailures, readTransformedModel, transformOperation
-
Constructor Details
-
ModelTestKernelServicesImpl
protected ModelTestKernelServicesImpl(org.jboss.msc.service.ServiceContainer container, ModelTestModelControllerService controllerService, StringConfigurationPersister persister, org.jboss.as.controller.registry.ManagementResourceRegistration rootRegistration, org.jboss.as.controller.operations.validation.OperationValidator operationValidator, org.jboss.as.controller.ModelVersion legacyModelVersion, boolean successfulBoot, Throwable bootError)
-
-
Method Details
-
isSuccessfulBoot
public boolean isSuccessfulBoot()Get whether the controller booted successfully- Specified by:
isSuccessfulBootin interfaceModelTestKernelServices<T extends ModelTestKernelServices<T>>- Returns:
- true if the controller booted successfully
-
getBootError
Get any errors thrown on boot- Specified by:
getBootErrorin interfaceModelTestKernelServices<T extends ModelTestKernelServices<T>>- Returns:
- the boot error
-
getLegacyServices
Gets the legacy controller services for the controller containing the passed in model version- Specified by:
getLegacyServicesin interfaceModelTestKernelServices<T extends ModelTestKernelServices<T>>- Parameters:
modelVersion- the model version of the legacy model controller- Throws:
IllegalStateException- if this is not the test's main model controllerIllegalStateException- if there is no legacy controller containing the version
-
checkIsMainController
protected void checkIsMainController() -
readWholeModel
public org.jboss.dmr.ModelNode readWholeModel()Reads the whole model from the model controller without aliases or runtime attributes/resources- Specified by:
readWholeModelin interfaceModelTestKernelServices<T extends ModelTestKernelServices<T>>- Returns:
- the whole model
-
readWholeModel
public org.jboss.dmr.ModelNode readWholeModel(boolean includeAliases) Reads the whole model from the model controller without runtime attributes/resources- Specified by:
readWholeModelin interfaceModelTestKernelServices<T extends ModelTestKernelServices<T>>- Parameters:
includeAliases- whether to include aliases- Returns:
- the whole model
-
readWholeModel
public org.jboss.dmr.ModelNode readWholeModel(boolean includeAliases, boolean includeRuntime) Reads the whole model from the model controller- Specified by:
readWholeModelin interfaceModelTestKernelServices<T extends ModelTestKernelServices<T>>- Parameters:
includeAliases- whether to include aliasesincludeRuntime- whether to include runtime attributes/resources- Returns:
- the whole model
-
getContainer
public org.jboss.msc.service.ServiceContainer getContainer()Gets the service container- Specified by:
getContainerin interfaceModelTestKernelServices<T extends ModelTestKernelServices<T>>- Returns:
- the service container
-
executeOperation
public org.jboss.dmr.ModelNode executeOperation(org.jboss.dmr.ModelNode operation, InputStream... inputStreams) Execute an operation in the model controller- Specified by:
executeOperationin interfaceModelTestKernelServices<T extends ModelTestKernelServices<T>>- Parameters:
operation- the operation to executeinputStreams- Input Streams for the operation- Returns:
- the whole result of the operation
-
executeOperation
public org.jboss.dmr.ModelNode executeOperation(org.jboss.dmr.ModelNode operation, org.jboss.as.controller.ModelController.OperationTransactionControl txControl) - Specified by:
executeOperationin interfaceModelTestKernelServices<T extends ModelTestKernelServices<T>>
-
executeForResult
public org.jboss.dmr.ModelNode executeForResult(org.jboss.dmr.ModelNode operation, InputStream... inputStreams) throws org.jboss.as.controller.OperationFailedException - Specified by:
executeForResultin interfaceModelTestKernelServices<T extends ModelTestKernelServices<T>>- Throws:
org.jboss.as.controller.OperationFailedException
-
executeForFailure
Execute an operation in the model controller, expecting failure.- Specified by:
executeForFailurein interfaceModelTestKernelServices<T extends ModelTestKernelServices<T>>- Parameters:
operation- the operation to execute
-
getPersistedSubsystemXml
Reads the persisted subsystem xml- Specified by:
getPersistedSubsystemXmlin interfaceModelTestKernelServices<T extends ModelTestKernelServices<T>>- Returns:
- the xml
-
validateOperations
Validates the operations against the description providers in the model controller- Specified by:
validateOperationsin interfaceModelTestKernelServices<T extends ModelTestKernelServices<T>>- Parameters:
operations- the operations to validate
-
validateOperation
public void validateOperation(org.jboss.dmr.ModelNode operation) Validates the operation against the description providers in the model controller- Specified by:
validateOperationin interfaceModelTestKernelServices<T extends ModelTestKernelServices<T>>- Parameters:
operation- the operation to validate
-
shutdown
public void shutdown()- Specified by:
shutdownin interfaceModelTestKernelServices<T extends ModelTestKernelServices<T>>
-
getRootRegistration
public org.jboss.as.controller.registry.ImmutableManagementResourceRegistration getRootRegistration()- Specified by:
getRootRegistrationin interfaceModelTestKernelServices<T extends ModelTestKernelServices<T>>
-
addLegacyKernelService
protected void addLegacyKernelService(org.jboss.as.controller.ModelVersion modelVersion, T legacyServices) -
internalExecute
protected org.jboss.dmr.ModelNode internalExecute(org.jboss.dmr.ModelNode operation, org.jboss.as.controller.OperationStepHandler handler) -
createTransformationContext
protected org.jboss.as.controller.transform.TransformationContext createTransformationContext(org.jboss.as.controller.transform.TransformationTarget target, org.jboss.as.controller.transform.TransformerOperationAttachment attachment) -
getTransformersRegistry
protected org.jboss.as.controller.transform.TransformerRegistry getTransformersRegistry()
-