Interface ModelTestKernelServices<T extends ModelTestKernelServices<T>>

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      void executeForFailure​(org.jboss.dmr.ModelNode operation, InputStream... inputStreams)
      Execute an operation in the model controller, expecting failure.
      org.jboss.dmr.ModelNode executeForResult​(org.jboss.dmr.ModelNode operation, InputStream... inputStreams)  
      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.
      org.jboss.dmr.ModelNode executeOperation​(org.jboss.dmr.ModelNode operation, InputStream... inputStreams)
      Execute an operation in the model controller
      org.jboss.dmr.ModelNode executeOperation​(org.jboss.dmr.ModelNode operation, org.jboss.as.controller.ModelController.OperationTransactionControl txControl)  
      Throwable getBootError()
      Get any errors thrown on boot
      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
      default String getBootErrorDescription()
      Get information about error on boot from both BootErrorCollector and BootError
      org.jboss.msc.service.ServiceContainer getContainer()
      Gets the service container
      T getLegacyServices​(org.jboss.as.controller.ModelVersion modelVersion)
      Gets the legacy controller services for the controller containing the passed in model version
      String getPersistedSubsystemXml()
      Reads the persisted subsystem xml
      org.jboss.as.controller.registry.ImmutableManagementResourceRegistration getRootRegistration()  
      default boolean hasBootErrorCollectorFailures()
      Returns whether BootErrorCollector collected any failure
      boolean isSuccessfulBoot()
      Get whether the controller booted successfully
      org.jboss.dmr.ModelNode readTransformedModel​(org.jboss.as.controller.ModelVersion modelVersion)
      Transforms the model to the legacy subsystem model version
      org.jboss.dmr.ModelNode readWholeModel()
      Reads the whole model from the model controller without aliases or runtime attributes/resources
      org.jboss.dmr.ModelNode readWholeModel​(boolean includeAliases)
      Reads the whole model from the model controller without runtime attributes/resources
      org.jboss.dmr.ModelNode readWholeModel​(boolean includeAliases, boolean includeRuntime)
      Reads the whole model from the model controller
      void shutdown()  
      org.jboss.as.controller.transform.OperationTransformer.TransformedOperation transformOperation​(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 subsystem
      org.jboss.as.controller.transform.OperationTransformer.TransformedOperation transformOperation​(org.jboss.as.controller.ModelVersion modelVersion, org.jboss.dmr.ModelNode operation, org.jboss.as.controller.transform.TransformerOperationAttachment attachment)
      Transforms an operation in the main controller to the format expected by the model controller containing the legacy subsystem
      void validateOperation​(org.jboss.dmr.ModelNode operation)
      Validates the operation against the description providers in the model controller
      void validateOperations​(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 controller
        IllegalStateException - 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.OperationFailedException
        Transforms 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 controller
        operation - the operation to transform
        Returns:
        the transformed operation
        Throws:
        IllegalStateException - if this is not the test's main model controller
        org.jboss.as.controller.OperationFailedException
      • transformOperation

        org.jboss.as.controller.transform.OperationTransformer.TransformedOperation transformOperation​(org.jboss.as.controller.ModelVersion modelVersion,
                                                                                                       org.jboss.dmr.ModelNode operation,
                                                                                                       org.jboss.as.controller.transform.TransformerOperationAttachment attachment)
                                                                                                throws org.jboss.as.controller.OperationFailedException
        Transforms 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 controller
        operation - the operation to transform
        attachment - attachments propagated from the operation context to the created transformer context. This may be null. In a non-test scenario, this will be added by operation handlers triggering the transformation, but for tests this needs to be hard-coded. Tests will need to ensure themselves that the relevant attachments get set.
        Returns:
        the transformed operation
        Throws:
        IllegalStateException - if this is not the test's main model controller
        org.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 controller
        op - the operation for the main controller
        Throws:
        IllegalStateException - if this is not the test's main model controller
        IllegalStateException - 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 aliases
        includeRuntime - 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 execute
        inputStreams - 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