Uploaded image for project: 'WildFly Arquillian'
  1. WildFly Arquillian
  2. WFARQ-169

Add helper methods for executing operations to the ServerSetupTask interface

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Major Major
    • 5.1.0.Beta2
    • None
    • None

      In many cases a ServerSetupTask will execute some kind of management operation against a server. It would be helpful to some helper methods like:

      default ModelNode executeOperation(final ManagementClient client, final ModelNode op,
              final Function<ModelNode, String> errorMessage) throws IOException {
          final ModelNode result = client.getControllerClient().execute(op);
          if (!Operations.isSuccessfulOutcome(result)) {
              throw new RuntimeException(errorMessage.apply(result));
          }
          return Operations.readResult(result);
      }
      

      This avoids implementations having to implement this on their own as it's a failure standard pattern. It might be useful to create a new RuntimeException these methods could throw as well. Or possibly reuse the org.wildfly.plugin.tools.OperationException.

            jperkins-rhn James Perkins
            jperkins-rhn James Perkins
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: