Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WFCORE-6407 Deprecate non-default contructors from AbstractAddStepHandler and AbstractWriteAttributeHandler #5563

Merged
merged 15 commits into from
Sep 28, 2023
Merged
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -20,6 +20,7 @@
import org.jboss.as.controller.SimpleAttributeDefinitionBuilder;
import org.jboss.as.controller.SimpleMapAttributeDefinition;
import org.jboss.as.controller.operations.validation.ObjectTypeValidator;
import org.jboss.as.controller.registry.AttributeAccess.Flag;
import org.jboss.as.controller.services.path.PathResourceDefinition;
import org.jboss.as.logging.capabilities.Capabilities;
import org.jboss.as.logging.correctors.FileCorrector;
@@ -265,6 +266,7 @@ public void validateParameter(final String parameterName, final ModelNode value)
.addAlternatives("filter-spec")
.setDeprecated(ModelVersion.create(1, 2, 0))
.setRequired(false)
.addFlag(Flag.ALIAS)
.build();

String ADD_HANDLER_OPERATION_NAME = "add-handler";
Original file line number Diff line number Diff line change
@@ -11,6 +11,8 @@
import static org.jboss.as.controller.client.helpers.ClientConstants.RESULT;

import org.jboss.as.controller.client.helpers.Operations;
import org.jboss.as.controller.descriptions.ModelDescriptionConstants;

import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OUTCOME;
import static org.junit.Assert.assertEquals;

@@ -70,14 +72,15 @@ public void addLoggingFilter() {
assertEquals("{\"replace\" => {\"replace-all\" => true,\"pattern\" => \"JBAS\",\"replacement\" => \"DUMMY\"}}",
Operations.readResult(result).asString());
ModelNode readResourceOp = Operations.createReadResourceOperation(consoleAddress);
readResourceOp.get(ModelDescriptionConstants.INCLUDE_ALIASES).set(true);
result = executeOperation(kernelServices, readResourceOp);
assertThat(result, is(notNullValue()));
assertThat(result.get(OUTCOME).asString(), is("success"));
assertThat(result.get(RESULT).hasDefined("filter-spec"), is(true));
ModelNode filterSpec = result.get(RESULT).get("filter-spec");
assertThat(filterSpec.asString(), is("substituteAll(\"JBAS\",\"DUMMY\")"));

assertThat(result.get(RESULT).hasDefined("filter"), is(true));
assertThat(result.toJSONString(false), result.get(RESULT).hasDefined("filter"), is(true));
assertThat(result.get(RESULT).get("filter").hasDefined("replace"), is(true));
ModelNode replaceResult = result.get(RESULT).get("filter").get("replace");
assertThat(replaceResult.hasDefined("pattern"), is(true));