From 5c24c9fa392c1617e937de5a64ab8105034efb88 Mon Sep 17 00:00:00 2001 From: Paul Ferraro Date: Fri, 19 Jul 2024 16:13:26 -0400 Subject: [PATCH] WFCORE-6914 Remove usage of deprecated AbstractAddStepHandler constructors in tests --- .../java/org/jboss/as/remoting/RemotingSubsystemTestUtil.java | 2 +- .../subsystem/map_to_child_resource/NewExtension.java | 2 +- .../subsystem/map_to_child_resource/OldExtension.java | 4 ++-- .../domain/extension/TestHostCapableExtension.java | 4 ---- .../expressions/module/TestSecureExpressionsExtension.java | 4 ---- .../extension/dependent/RootResourceDefinition.java | 4 ---- .../management/extension/optypes/OpTypesExtension.java | 2 +- .../CliExtCommandsSubsystemResourceDescription.java | 2 +- .../DuplicateExtCommandSubsystemResourceDescription.java | 2 +- 9 files changed, 7 insertions(+), 19 deletions(-) diff --git a/remoting/tests/src/test/java/org/jboss/as/remoting/RemotingSubsystemTestUtil.java b/remoting/tests/src/test/java/org/jboss/as/remoting/RemotingSubsystemTestUtil.java index 83debecbf48..27be4fc9fad 100644 --- a/remoting/tests/src/test/java/org/jboss/as/remoting/RemotingSubsystemTestUtil.java +++ b/remoting/tests/src/test/java/org/jboss/as/remoting/RemotingSubsystemTestUtil.java @@ -69,7 +69,7 @@ protected void initializeExtraSubystemsAndModel(ExtensionRegistry extensionRegis static void registerIOExtension(ExtensionRegistry extensionRegistry, ManagementResourceRegistration rootRegistration) { ManagementResourceRegistration extReg = rootRegistration.registerSubModel(new SimpleResourceDefinition(PathElement.pathElement(EXTENSION, "org.wildfly.extension.io"), - NonResolvingResourceDescriptionResolver.INSTANCE, new ModelOnlyAddStepHandler(), ModelOnlyRemoveStepHandler.INSTANCE)); + NonResolvingResourceDescriptionResolver.INSTANCE, ModelOnlyAddStepHandler.INSTANCE, ModelOnlyRemoveStepHandler.INSTANCE)); extReg.registerReadOnlyAttribute(new SimpleAttributeDefinitionBuilder("module", ModelType.STRING).build(), null); Extension ioe = new IOExtension(); diff --git a/subsystem-test/tests/src/test/java/org/jboss/as/subsystem/test/transformers/subsystem/map_to_child_resource/NewExtension.java b/subsystem-test/tests/src/test/java/org/jboss/as/subsystem/test/transformers/subsystem/map_to_child_resource/NewExtension.java index bea91bc9fb7..e7f8baa4b98 100644 --- a/subsystem-test/tests/src/test/java/org/jboss/as/subsystem/test/transformers/subsystem/map_to_child_resource/NewExtension.java +++ b/subsystem-test/tests/src/test/java/org/jboss/as/subsystem/test/transformers/subsystem/map_to_child_resource/NewExtension.java @@ -161,7 +161,7 @@ protected static class TestResourceDefinition extends SimpleResourceDefinition { protected TestResourceDefinition() { super(SUBSYSTEM_PATH, NonResolvingResourceDescriptionResolver.INSTANCE, - new ModelOnlyAddStepHandler(ATTRIBUTES), + ModelOnlyAddStepHandler.INSTANCE, ModelOnlyRemoveStepHandler.INSTANCE); } diff --git a/subsystem-test/tests/src/test/java/org/jboss/as/subsystem/test/transformers/subsystem/map_to_child_resource/OldExtension.java b/subsystem-test/tests/src/test/java/org/jboss/as/subsystem/test/transformers/subsystem/map_to_child_resource/OldExtension.java index b41f153082d..6160c66a0f9 100644 --- a/subsystem-test/tests/src/test/java/org/jboss/as/subsystem/test/transformers/subsystem/map_to_child_resource/OldExtension.java +++ b/subsystem-test/tests/src/test/java/org/jboss/as/subsystem/test/transformers/subsystem/map_to_child_resource/OldExtension.java @@ -69,7 +69,7 @@ private static final class TestResourceDefinition extends SimpleResourceDefiniti private TestResourceDefinition() { super(SUBSYSTEM_PATH, NonResolvingResourceDescriptionResolver.INSTANCE, - new ModelOnlyAddStepHandler(TEST), + ModelOnlyAddStepHandler.INSTANCE, ModelOnlyRemoveStepHandler.INSTANCE); } @@ -88,7 +88,7 @@ private static final class PropertyResourceDefinition extends SimpleResourceDefi private PropertyResourceDefinition() { super(PathElement.pathElement("property"), NonResolvingResourceDescriptionResolver.INSTANCE, - new ModelOnlyAddStepHandler(VALUE), + ModelOnlyAddStepHandler.INSTANCE, ModelOnlyRemoveStepHandler.INSTANCE); } diff --git a/testsuite/domain/src/test/java/org/jboss/as/test/integration/domain/extension/TestHostCapableExtension.java b/testsuite/domain/src/test/java/org/jboss/as/test/integration/domain/extension/TestHostCapableExtension.java index f24f272633c..090345e6a8f 100644 --- a/testsuite/domain/src/test/java/org/jboss/as/test/integration/domain/extension/TestHostCapableExtension.java +++ b/testsuite/domain/src/test/java/org/jboss/as/test/integration/domain/extension/TestHostCapableExtension.java @@ -129,10 +129,6 @@ private static ServiceName createServiceName(PathAddress address) { private static class AddSubsystemHandler extends AbstractAddStepHandler { - AddSubsystemHandler() { - super(NAME, SOCKET_BINDING); - } - @Override protected void performRuntime(OperationContext context, ModelNode operation, Resource resource) throws OperationFailedException { diff --git a/testsuite/manualmode/src/test/java/org/jboss/as/test/manualmode/expressions/module/TestSecureExpressionsExtension.java b/testsuite/manualmode/src/test/java/org/jboss/as/test/manualmode/expressions/module/TestSecureExpressionsExtension.java index 596e763ca01..23614d4bf0a 100644 --- a/testsuite/manualmode/src/test/java/org/jboss/as/test/manualmode/expressions/module/TestSecureExpressionsExtension.java +++ b/testsuite/manualmode/src/test/java/org/jboss/as/test/manualmode/expressions/module/TestSecureExpressionsExtension.java @@ -135,10 +135,6 @@ public Collection getAttributes() { public static final class AddHandler extends AbstractBoottimeAddStepHandler { - private AddHandler() { - super(ATTR); - } - @Override protected void performBoottime(OperationContext context, ModelNode operation, Resource resource) throws OperationFailedException { diff --git a/testsuite/shared/src/main/java/org/jboss/as/test/integration/management/extension/dependent/RootResourceDefinition.java b/testsuite/shared/src/main/java/org/jboss/as/test/integration/management/extension/dependent/RootResourceDefinition.java index 60d8d39d9ca..65c40ab1682 100644 --- a/testsuite/shared/src/main/java/org/jboss/as/test/integration/management/extension/dependent/RootResourceDefinition.java +++ b/testsuite/shared/src/main/java/org/jboss/as/test/integration/management/extension/dependent/RootResourceDefinition.java @@ -81,10 +81,6 @@ private static class AddSubsystemHandler extends AbstractAddStepHandler { private static final AbstractAddStepHandler INSTANCE = new AddSubsystemHandler(); - private AddSubsystemHandler() { - super(ATTRIBUTE); - } - @Override protected void performRuntime(OperationContext context, ModelNode operation, Resource resource) throws OperationFailedException { String osb = ATTRIBUTE.resolveModelAttribute(context, resource.getModel()).asString(); diff --git a/testsuite/shared/src/main/java/org/jboss/as/test/integration/management/extension/optypes/OpTypesExtension.java b/testsuite/shared/src/main/java/org/jboss/as/test/integration/management/extension/optypes/OpTypesExtension.java index 1186325cc26..b69be4ea832 100644 --- a/testsuite/shared/src/main/java/org/jboss/as/test/integration/management/extension/optypes/OpTypesExtension.java +++ b/testsuite/shared/src/main/java/org/jboss/as/test/integration/management/extension/optypes/OpTypesExtension.java @@ -117,7 +117,7 @@ private static class OperationTypesSubsystemResourceDefinition extends SimpleRes private OperationTypesSubsystemResourceDefinition(ProcessType processType) { super(new Parameters(PathElement.pathElement(SUBSYSTEM, SUBSYSTEM_NAME), NonResolvingResourceDescriptionResolver.INSTANCE) - .setAddHandler(new ModelOnlyAddStepHandler()) + .setAddHandler(ModelOnlyAddStepHandler.INSTANCE) .setRemoveHandler(new ModelOnlyRemoveStepHandler()) ); this.processType = processType; diff --git a/testsuite/standalone/src/test/java/org/jboss/as/test/integration/management/cli/extensions/CliExtCommandsSubsystemResourceDescription.java b/testsuite/standalone/src/test/java/org/jboss/as/test/integration/management/cli/extensions/CliExtCommandsSubsystemResourceDescription.java index 2a4ea98aee7..3d3fa833659 100644 --- a/testsuite/standalone/src/test/java/org/jboss/as/test/integration/management/cli/extensions/CliExtCommandsSubsystemResourceDescription.java +++ b/testsuite/standalone/src/test/java/org/jboss/as/test/integration/management/cli/extensions/CliExtCommandsSubsystemResourceDescription.java @@ -24,7 +24,7 @@ public class CliExtCommandsSubsystemResourceDescription extends SimpleResourceDe public static final PathElement PATH = PathElement.pathElement(ModelDescriptionConstants.SUBSYSTEM, CliExtCommandsExtension.SUBSYSTEM_NAME); public CliExtCommandsSubsystemResourceDescription() { - super(PATH, NonResolvingResourceDescriptionResolver.INSTANCE, new ModelOnlyAddStepHandler(), new AbstractRemoveStepHandler(){}); + super(PATH, NonResolvingResourceDescriptionResolver.INSTANCE, ModelOnlyAddStepHandler.INSTANCE, new AbstractRemoveStepHandler(){}); } @Override diff --git a/testsuite/standalone/src/test/java/org/jboss/as/test/integration/management/cli/extensions/DuplicateExtCommandSubsystemResourceDescription.java b/testsuite/standalone/src/test/java/org/jboss/as/test/integration/management/cli/extensions/DuplicateExtCommandSubsystemResourceDescription.java index 0e806e9b770..70760244baa 100644 --- a/testsuite/standalone/src/test/java/org/jboss/as/test/integration/management/cli/extensions/DuplicateExtCommandSubsystemResourceDescription.java +++ b/testsuite/standalone/src/test/java/org/jboss/as/test/integration/management/cli/extensions/DuplicateExtCommandSubsystemResourceDescription.java @@ -21,7 +21,7 @@ public class DuplicateExtCommandSubsystemResourceDescription extends SimpleResou public static final PathElement PATH = PathElement.pathElement(ModelDescriptionConstants.SUBSYSTEM, DuplicateExtCommandsExtension.SUBSYSTEM_NAME); public DuplicateExtCommandSubsystemResourceDescription() { - super(PATH, NonResolvingResourceDescriptionResolver.INSTANCE, new ModelOnlyAddStepHandler(), new AbstractRemoveStepHandler() { + super(PATH, NonResolvingResourceDescriptionResolver.INSTANCE, ModelOnlyAddStepHandler.INSTANCE, new AbstractRemoveStepHandler() { }); }