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
Constructors Modifier Constructor Description protectedModelTestKernelServicesImpl(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddLegacyKernelService(org.jboss.as.controller.ModelVersion modelVersion, T legacyServices)protected voidcheckIsMainController()protected 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)ThrowablegetBootError()Get any errors thrown on bootorg.jboss.msc.service.ServiceContainergetContainer()Gets the service containerprotected StringgetControllerClassSimpleName()TgetLegacyServices(org.jboss.as.controller.ModelVersion modelVersion)Gets the legacy controller services for the controller containing the passed in model versionStringgetPersistedSubsystemXml()Reads the persisted subsystem xmlorg.jboss.as.controller.registry.ImmutableManagementResourceRegistrationgetRootRegistration()protected org.jboss.as.controller.transform.TransformerRegistrygetTransformersRegistry()protected org.jboss.dmr.ModelNodeinternalExecute(org.jboss.dmr.ModelNode operation, org.jboss.as.controller.OperationStepHandler handler)booleanisSuccessfulBoot()Get whether the controller booted successfullyorg.jboss.dmr.ModelNodereadWholeModel()Reads 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 controller-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jboss.as.model.test.ModelTestKernelServices
executeOperation, getBootErrorCollectorFailures, getBootErrorDescription, hasBootErrorCollectorFailures, readTransformedModel, transformOperation, transformOperation
-
-
-
-
Constructor Detail
-
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 Detail
-
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
public Throwable getBootError()
Get any errors thrown on boot- Specified by:
getBootErrorin interfaceModelTestKernelServices<T extends ModelTestKernelServices<T>>- Returns:
- the boot error
-
getLegacyServices
public T getLegacyServices(org.jboss.as.controller.ModelVersion modelVersion)
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
public void executeForFailure(org.jboss.dmr.ModelNode operation, InputStream... inputStreams)Execute an operation in the model controller, expecting failure.- Specified by:
executeForFailurein interfaceModelTestKernelServices<T extends ModelTestKernelServices<T>>- Parameters:
operation- the operation to execute
-
getPersistedSubsystemXml
public String getPersistedSubsystemXml()
Reads the persisted subsystem xml- Specified by:
getPersistedSubsystemXmlin interfaceModelTestKernelServices<T extends ModelTestKernelServices<T>>- Returns:
- the xml
-
validateOperations
public void validateOperations(List<org.jboss.dmr.ModelNode> operations)
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()
-
getControllerClassSimpleName
protected String getControllerClassSimpleName()
-
-