use of org.jboss.as.controller.client.helpers.Operations in project wildfly by wildfly.
the class TestLogHandlerSetupTask method tearDown.
@Override
public void tearDown(ManagementClient managementClient, String containerId) throws Exception {
Path logPath = LoggingUtil.getLogPath(managementClient, "file-handler", getHandlerName());
// Remove the loggers and handler
final Operations.CompositeOperationBuilder builder = Operations.CompositeOperationBuilder.create();
ModelNode removeOp;
while ((removeOp = removeOps.pollFirst()) != null) {
builder.addStep(removeOp);
}
applyUpdate(managementClient.getControllerClient(), builder.build(), false);
// remove file, note this needs to be done after the operations have been executed as we need to ensure that
// no FD's are open. This can be an issue on Windows.
Files.deleteIfExists(logPath);
}
Aggregations