Package org.jboss.as.model.test
Interface ModelTestKernelServices<T extends ModelTestKernelServices<T>>
-
- All Known Implementing Classes:
ModelTestKernelServicesImpl
public interface ModelTestKernelServices<T extends ModelTestKernelServices<T>>- Author:
- Kabir Khan
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description 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.as.controller.ModelVersion modelVersion, org.jboss.as.controller.transform.OperationTransformer.TransformedOperation op)Execute an operation in the controller containg the passed in version of the subsystem.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 bootdefault org.jboss.dmr.ModelNodegetBootErrorCollectorFailures()Retrieve failures collected by BootErrorCollector if there are any and in case of OperationFailedException thrown by executeForResult will be outputted the error message containing exception descriptiondefault StringgetBootErrorDescription()Get information about error on boot from both BootErrorCollector and BootErrororg.jboss.msc.service.ServiceContainergetContainer()Gets the service containerTgetLegacyServices(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()default booleanhasBootErrorCollectorFailures()Returns whether BootErrorCollector collected any failurebooleanisSuccessfulBoot()Get whether the controller booted successfullyorg.jboss.dmr.ModelNodereadTransformedModel(org.jboss.as.controller.ModelVersion modelVersion)Transforms the model to the legacy subsystem model versionorg.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()org.jboss.as.controller.transform.OperationTransformer.TransformedOperationtransformOperation(org.jboss.as.controller.ModelVersion modelVersion, org.jboss.dmr.ModelNode operation)Transforms an operation in the main controller to the format expected by the model controller containing the legacy subsystemvoidvalidateOperation(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
-
-
-
Method Detail
-
isSuccessfulBoot
boolean isSuccessfulBoot()
Get whether the controller booted successfully- Returns:
- true if the controller booted successfully
-
getBootError
Throwable getBootError()
Get any errors thrown on boot- Returns:
- the boot error
-
getLegacyServices
T getLegacyServices(org.jboss.as.controller.ModelVersion modelVersion)
Gets the legacy controller services for the controller containing the passed in model version- 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
-
transformOperation
org.jboss.as.controller.transform.OperationTransformer.TransformedOperation transformOperation(org.jboss.as.controller.ModelVersion modelVersion, org.jboss.dmr.ModelNode operation) throws org.jboss.as.controller.OperationFailedExceptionTransforms an operation in the main controller to the format expected by the model controller containing the legacy subsystem- Parameters:
modelVersion- the subsystem model version of the legacy subsystem model controlleroperation- the operation to transform- Returns:
- the transformed operation
- Throws:
IllegalStateException- if this is not the test's main model controllerorg.jboss.as.controller.OperationFailedException
-
readTransformedModel
org.jboss.dmr.ModelNode readTransformedModel(org.jboss.as.controller.ModelVersion modelVersion)
Transforms the model to the legacy subsystem model version- Parameters:
modelVersion- the target legacy subsystem model version- Returns:
- the transformed model
- Throws:
IllegalStateException- if this is not the test's main model controller
-
executeOperation
org.jboss.dmr.ModelNode executeOperation(org.jboss.as.controller.ModelVersion modelVersion, org.jboss.as.controller.transform.OperationTransformer.TransformedOperation op)Execute an operation in the controller containg the passed in version of the subsystem. The operation and results will be translated from the format for the main controller to the legacy controller's format.- Parameters:
modelVersion- the subsystem model version of the legacy subsystem model controllerop- the operation for the main controller- Throws:
IllegalStateException- if this is not the test's main model controllerIllegalStateException- if there is no legacy controller containing the version of the subsystem
-
readWholeModel
org.jboss.dmr.ModelNode readWholeModel()
Reads the whole model from the model controller without aliases or runtime attributes/resources- Returns:
- the whole model
-
readWholeModel
org.jboss.dmr.ModelNode readWholeModel(boolean includeAliases)
Reads the whole model from the model controller without runtime attributes/resources- Parameters:
includeAliases- whether to include aliases- Returns:
- the whole model
-
readWholeModel
org.jboss.dmr.ModelNode readWholeModel(boolean includeAliases, boolean includeRuntime)Reads the whole model from the model controller- Parameters:
includeAliases- whether to include aliasesincludeRuntime- whether to include runtime attributes/resources- Returns:
- the whole model
-
getContainer
org.jboss.msc.service.ServiceContainer getContainer()
Gets the service container- Returns:
- the service container
-
executeOperation
org.jboss.dmr.ModelNode executeOperation(org.jboss.dmr.ModelNode operation, InputStream... inputStreams)Execute an operation in the model controller- Parameters:
operation- the operation to executeinputStreams- Input Streams for the operation- Returns:
- the whole result of the operation
-
executeOperation
org.jboss.dmr.ModelNode executeOperation(org.jboss.dmr.ModelNode operation, org.jboss.as.controller.ModelController.OperationTransactionControl txControl)
-
executeForResult
org.jboss.dmr.ModelNode executeForResult(org.jboss.dmr.ModelNode operation, InputStream... inputStreams) throws org.jboss.as.controller.OperationFailedException- Throws:
org.jboss.as.controller.OperationFailedException
-
executeForFailure
void executeForFailure(org.jboss.dmr.ModelNode operation, InputStream... inputStreams)Execute an operation in the model controller, expecting failure.- Parameters:
operation- the operation to execute
-
getPersistedSubsystemXml
String getPersistedSubsystemXml()
Reads the persisted subsystem xml- Returns:
- the xml
-
validateOperations
void validateOperations(List<org.jboss.dmr.ModelNode> operations)
Validates the operations against the description providers in the model controller- Parameters:
operations- the operations to validate
-
validateOperation
void validateOperation(org.jboss.dmr.ModelNode operation)
Validates the operation against the description providers in the model controller- Parameters:
operation- the operation to validate
-
shutdown
void shutdown()
-
getRootRegistration
org.jboss.as.controller.registry.ImmutableManagementResourceRegistration getRootRegistration()
-
getBootErrorDescription
default String getBootErrorDescription()
Get information about error on boot from both BootErrorCollector and BootError- Returns:
- BootErrorCollector description if any and BootError printed stack trace if any, empty string otherwise
-
getBootErrorCollectorFailures
default org.jboss.dmr.ModelNode getBootErrorCollectorFailures()
Retrieve failures collected by BootErrorCollector if there are any and in case of OperationFailedException thrown by executeForResult will be outputted the error message containing exception description- Returns:
- failures from BootErrorCollector or null when retrieved none or undefined failure
-
hasBootErrorCollectorFailures
default boolean hasBootErrorCollectorFailures()
Returns whether BootErrorCollector collected any failure- Returns:
- true if BootErrorCollector collected any failure
-
-