Package org.jboss.as.arquillian.api
Interface ServerSetupTask
-
- All Known Implementing Classes:
ConfigureLoggingSetupTask,ReloadServerSetupTask,SnapshotServerSetupTask
public interface ServerSetupTaskA task which is run before deployment that allows the client to customize the server config.- Author:
- Stuart Douglas
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default org.jboss.dmr.ModelNodeexecuteOperation(ManagementClient client, org.jboss.as.controller.client.Operation op)Executes an operation failing with aRuntimeExceptionif the operation was not successful.default org.jboss.dmr.ModelNodeexecuteOperation(ManagementClient client, org.jboss.as.controller.client.Operation op, Function<org.jboss.dmr.ModelNode,String> errorMessage)Executes an operation failing with aRuntimeExceptionif the operation was not successful.default org.jboss.dmr.ModelNodeexecuteOperation(ManagementClient client, org.jboss.dmr.ModelNode op)Executes an operation failing with aRuntimeExceptionif the operation was not successful.default org.jboss.dmr.ModelNodeexecuteOperation(ManagementClient client, org.jboss.dmr.ModelNode op, Function<org.jboss.dmr.ModelNode,String> errorMessage)Executes an operation failing with aRuntimeExceptionif the operation was not successful.voidsetup(ManagementClient managementClient, String containerId)Execute any necessary setup work that needs to happen before the first deployment to the given container.voidtearDown(ManagementClient managementClient, String containerId)Execute any tear down work that needs to happen after the last deployment associated with the given container has been undeployed.
-
-
-
Method Detail
-
setup
void setup(ManagementClient managementClient, String containerId) throws Exception
Execute any necessary setup work that needs to happen before the first deployment to the given container.Note on exception handling: If an implementation of this method throws any exception, the implementation can assume the following:
- Any subsequent
ServerSetupTasksassociated with test classwill not be executed. - The deployment event that triggered the call to this method will be skipped.
- The
tearDownmethod of the instance that threw the exception will not be invoked. Therefore, implementations that throwAssumptionViolatedException, or any other exception, should do so before altering any system state. - The
tearDownmethod for any previously executedServerSetupTasksassociated with test classwill be invoked.
If any other exception is thrown, the
tearDown(ManagementClient, String)will be executed, including this implementationstearDown(), re-throwing the original exception. The original exception will have any other exceptions thrown in thetearDown()methods add as suppressed messages.- Parameters:
managementClient- management client to use to interact with the containercontainerId- id of the container to which the deployment will be deployed- Throws:
Exception- if a failure occurs
- Any subsequent
-
tearDown
void tearDown(ManagementClient managementClient, String containerId) throws Exception
Execute any tear down work that needs to happen after the last deployment associated with the given container has been undeployed.- Parameters:
managementClient- management client to use to interact with the containercontainerId- id of the container to which the deployment will be deployed- Throws:
Exception- if a failure occurs
-
executeOperation
default org.jboss.dmr.ModelNode executeOperation(ManagementClient client, org.jboss.dmr.ModelNode op) throws IOException
Executes an operation failing with aRuntimeExceptionif the operation was not successful.- Parameters:
client- the client used to communicate with the serverop- the operation to execute- Returns:
- the result from the operation
- Throws:
org.wildfly.plugin.tools.OperationExecutionException- if the operation failedIOException- if an error occurs communicating with the server
-
executeOperation
default org.jboss.dmr.ModelNode executeOperation(ManagementClient client, org.jboss.dmr.ModelNode op, Function<org.jboss.dmr.ModelNode,String> errorMessage) throws IOException
Executes an operation failing with aRuntimeExceptionif the operation was not successful.- Parameters:
client- the client used to communicate with the serverop- the operation to executeerrorMessage- a function which accepts the result as the argument and returns an error message for an unsuccessful operation- Returns:
- the result from the operation
- Throws:
org.wildfly.plugin.tools.OperationExecutionException- if the operation failedIOException- if an error occurs communicating with the server
-
executeOperation
default org.jboss.dmr.ModelNode executeOperation(ManagementClient client, org.jboss.as.controller.client.Operation op) throws IOException
Executes an operation failing with aRuntimeExceptionif the operation was not successful.- Parameters:
client- the client used to communicate with the serverop- the operation to execute- Returns:
- the result from the operation
- Throws:
org.wildfly.plugin.tools.OperationExecutionException- if the operation failedIOException- if an error occurs communicating with the server
-
executeOperation
default org.jboss.dmr.ModelNode executeOperation(ManagementClient client, org.jboss.as.controller.client.Operation op, Function<org.jboss.dmr.ModelNode,String> errorMessage) throws IOException
Executes an operation failing with aRuntimeExceptionif the operation was not successful.- Parameters:
client- the client used to communicate with the serverop- the operation to executeerrorMessage- a function which accepts the result as the argument and returns an error message for an unsuccessful operation- Returns:
- the result from the operation
- Throws:
org.wildfly.plugin.tools.OperationExecutionException- if the operation failedIOException- if an error occurs communicating with the server
-
-