Skip to content

Commit

Permalink
WFCORE-6668 Ensure read-feature-description results contain stability…
Browse files Browse the repository at this point in the history
… as reported by associated description.
  • Loading branch information
pferraro committed Jan 19, 2024
1 parent 40868d7 commit d3d4439
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.REFS;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.REQUIRES;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.RESULT;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.STABILITY;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SUBSYSTEM;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.TYPE;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.VALUE_TYPE;
Expand Down Expand Up @@ -397,6 +398,7 @@ private ModelNode describeFeature(final Locale locale, final ImmutableManagement
packages.add(pkgNode);
}
}
feature.get(STABILITY).set(registration.getStability().toString());
return result;
}

Expand Down Expand Up @@ -639,6 +641,9 @@ private Map<String, String> addParams(ModelNode feature, PathAddress address, Mo
//value_type is an object
}
}
if (attDescription.hasDefined(STABILITY)) {
param.get(STABILITY).set(attDescription.get(STABILITY).asString());
}
params.add(param);
}
final ModelNode annotationNode = feature.get(ANNOTATION);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.RECURSIVE_DEPTH;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.RESULT;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SOCKET_BINDING_GROUP;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.STABILITY;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SUCCESS;

import jakarta.inject.Inject;

import org.jboss.as.controller.PathAddress;
import org.jboss.as.controller.operations.common.Util;
import org.jboss.as.version.Stability;
import org.jboss.dmr.ModelNode;
import org.jboss.dmr.ModelType;
import org.jboss.dmr.Property;
Expand Down Expand Up @@ -133,6 +135,10 @@ private static int validateFeature(ModelNode feature, String expectedName, int m
}
}
break;
case STABILITY:
// Verify validity of stability
Stability.fromString(prop.getValue().asString());
break;
case ANNOTATION:
case "params":
case "refs":
Expand Down

0 comments on commit d3d4439

Please sign in to comment.