diff --git a/controller/src/main/java/org/jboss/as/controller/AbstractControllerService.java b/controller/src/main/java/org/jboss/as/controller/AbstractControllerService.java index b46c5dcbcdda..1b9b5a71f8fb 100644 --- a/controller/src/main/java/org/jboss/as/controller/AbstractControllerService.java +++ b/controller/src/main/java/org/jboss/as/controller/AbstractControllerService.java @@ -123,6 +123,7 @@ protected AbstractControllerService(final ProcessType processType, final Running final ControlledProcessState processState, final DescriptionProvider rootDescriptionProvider, final OperationStepHandler prepareStep, final ExpressionResolver expressionResolver) { assert rootDescriptionProvider != null : "Null root description provider"; + assert expressionResolver != null : "Null expressionResolver"; this.processType = processType; this.runningModeControl = runningModeControl; this.configurationPersister = configurationPersister; @@ -130,7 +131,7 @@ protected AbstractControllerService(final ProcessType processType, final Running this.rootResourceDefinition = null; this.processState = processState; this.prepareStep = prepareStep; - this.expressionResolver = expressionResolver != null ? expressionResolver : ExpressionResolver.DEFAULT; + this.expressionResolver = expressionResolver; } /** @@ -149,6 +150,7 @@ protected AbstractControllerService(final ProcessType processType, final Running final ControlledProcessState processState, final ResourceDefinition rootResourceDefinition, final OperationStepHandler prepareStep, final ExpressionResolver expressionResolver) { assert rootResourceDefinition != null : "Null root resource definition"; + assert expressionResolver != null : "Null expressionResolver"; this.processType = processType; this.runningModeControl = runningModeControl; this.configurationPersister = configurationPersister; @@ -156,7 +158,7 @@ protected AbstractControllerService(final ProcessType processType, final Running this.rootResourceDefinition = rootResourceDefinition; this.processState = processState; this.prepareStep = prepareStep; - this.expressionResolver = expressionResolver != null ? expressionResolver : ExpressionResolver.DEFAULT; + this.expressionResolver = expressionResolver; } diff --git a/controller/src/main/java/org/jboss/as/controller/AttributeDefinition.java b/controller/src/main/java/org/jboss/as/controller/AttributeDefinition.java index 7da920b04882..5c9aed350984 100644 --- a/controller/src/main/java/org/jboss/as/controller/AttributeDefinition.java +++ b/controller/src/main/java/org/jboss/as/controller/AttributeDefinition.java @@ -234,7 +234,7 @@ public final void validateAndSet(ModelNode operationObject, final ModelNode mode */ @Deprecated public ModelNode validateResolvedOperation(final ModelNode operationObject) throws OperationFailedException { - return resolveModelAttribute(NO_OPERATION_CONTEXT_FOR_RESOLVING_MODEL_PARAMETERS, operationObject); + return resolveModelAttribute(ExpressionResolver.REJECTING, operationObject); } /** @@ -623,11 +623,4 @@ public boolean isDeprecated() { public DeprecationData getDeprecationData() { return deprecationData; } - - private static final ExpressionResolver NO_OPERATION_CONTEXT_FOR_RESOLVING_MODEL_PARAMETERS = new ExpressionResolver() { - @Override - public ModelNode resolveExpressions(ModelNode node) throws OperationFailedException { - return ExpressionResolver.DEFAULT.resolveExpressions(node); - } - }; } diff --git a/controller/src/main/java/org/jboss/as/controller/ControllerMessages.java b/controller/src/main/java/org/jboss/as/controller/ControllerMessages.java index 94e76c199713..461a95fc491c 100644 --- a/controller/src/main/java/org/jboss/as/controller/ControllerMessages.java +++ b/controller/src/main/java/org/jboss/as/controller/ControllerMessages.java @@ -2603,4 +2603,6 @@ public interface ControllerMessages { @Message(id = 14892, value = "Transforming operation %s at resource %s for host controller '%s' to subsystem '%s' model version '%s' -- attributes %s are not understood in that model version and this resource will need to be ignored on that host.") OperationFailedException newAttributesSubsystemModelOperationTransformerFoundDefinedAttributes(ModelNode op, PathAddress pathAddress, String legacyHostName, String subsystem, ModelVersion modelVersion, Set attributeNames); + @Message(id = 14893, value="Node contains an unresolved expression %s -- a resolved model is required") + OperationFailedException illegalUnresolvedModel(String expression); } diff --git a/controller/src/main/java/org/jboss/as/controller/ExpressionResolver.java b/controller/src/main/java/org/jboss/as/controller/ExpressionResolver.java index d95bec7beeee..9eb528714915 100644 --- a/controller/src/main/java/org/jboss/as/controller/ExpressionResolver.java +++ b/controller/src/main/java/org/jboss/as/controller/ExpressionResolver.java @@ -21,6 +21,8 @@ */ package org.jboss.as.controller; +import java.util.regex.Pattern; + import org.jboss.dmr.ModelNode; import org.jboss.dmr.ModelType; @@ -46,6 +48,36 @@ public interface ExpressionResolver { */ ModelNode resolveExpressions(ModelNode node) throws OperationFailedException; - /** Default {@code ExpressionResolver} that simply calls {@link ModelNode#resolve()}. */ - ExpressionResolver DEFAULT = new ExpressionResolverImpl(); + /** + * An {@code ExpressionResolver} suitable for test cases that simply calls {@link ModelNode#resolve()}. + * Should not be used for production code as it does not support resolution from a security vault. + */ + ExpressionResolver TEST_RESOLVER = new ExpressionResolverImpl(); + + /** + * Default {@code ExpressionResolver} that simply calls {@link ModelNode#resolve()}. + * Should not be used for production code as it does not support resolution from a security vault. + * + * @deprecated use {@link #TEST_RESOLVER} for test cases + */ + @Deprecated + ExpressionResolver DEFAULT = TEST_RESOLVER; + + /** + * An expression resolver that throws an {@code OperationFailedException} if any expressions are found. + * Intended for use with APIs where an {@code ExpressionResolver} is required but the caller requires + * that all expression have already been resolved. + */ + ExpressionResolver REJECTING = new ExpressionResolverImpl() { + private final Pattern EXPRESSION_PATTERN = Pattern.compile(".*\\$\\{.*\\}.*"); + @Override + protected void resolvePluggableExpression(ModelNode node) throws OperationFailedException { + String expression = node.asString(); + if (EXPRESSION_PATTERN.matcher(expression).matches()) { + throw ControllerMessages.MESSAGES.illegalUnresolvedModel(expression); + } + // It wasn't an expression any way; convert the node to type STRING + node.set(expression); + } + }; } diff --git a/controller/src/main/java/org/jboss/as/controller/ExpressionResolverImpl.java b/controller/src/main/java/org/jboss/as/controller/ExpressionResolverImpl.java index e2e9edf7cd69..b67b29b62731 100644 --- a/controller/src/main/java/org/jboss/as/controller/ExpressionResolverImpl.java +++ b/controller/src/main/java/org/jboss/as/controller/ExpressionResolverImpl.java @@ -47,7 +47,7 @@ public final ModelNode resolveExpressions(final ModelNode node) throws Operation } } - private ModelNode resolveExpressionsRecursively(final ModelNode node) { + private ModelNode resolveExpressionsRecursively(final ModelNode node) throws OperationFailedException { if (!node.isDefined()) { return node; } @@ -78,7 +78,7 @@ private ModelNode resolveExpressionsRecursively(final ModelNode node) { return resolved; } - protected void resolvePluggableExpression(ModelNode node) { + protected void resolvePluggableExpression(ModelNode node) throws OperationFailedException { } } diff --git a/controller/src/main/java/org/jboss/as/controller/operations/common/NamespaceAddHandler.java b/controller/src/main/java/org/jboss/as/controller/operations/common/NamespaceAddHandler.java index d56649affe35..a0403b25059d 100644 --- a/controller/src/main/java/org/jboss/as/controller/operations/common/NamespaceAddHandler.java +++ b/controller/src/main/java/org/jboss/as/controller/operations/common/NamespaceAddHandler.java @@ -77,8 +77,8 @@ private NamespaceAddHandler() { } protected void updateModel(ModelNode operation, ModelNode model) throws OperationFailedException { - ModelNode ns = NAMESPACE.resolveModelAttribute(ExpressionResolver.DEFAULT, operation); - ModelNode uri = URI.resolveModelAttribute(ExpressionResolver.DEFAULT, operation); + ModelNode ns = NAMESPACE.resolveModelAttribute(ExpressionResolver.REJECTING, operation); + ModelNode uri = URI.resolveModelAttribute(ExpressionResolver.REJECTING, operation); ModelNode namespaces = model.get(NAMESPACES); validate(ns, namespaces); namespaces.add(ns.asString(), uri.asString()); diff --git a/controller/src/main/java/org/jboss/as/controller/operations/common/SchemaLocationAddHandler.java b/controller/src/main/java/org/jboss/as/controller/operations/common/SchemaLocationAddHandler.java index 0b8f2775d41e..d02de5b87cfd 100644 --- a/controller/src/main/java/org/jboss/as/controller/operations/common/SchemaLocationAddHandler.java +++ b/controller/src/main/java/org/jboss/as/controller/operations/common/SchemaLocationAddHandler.java @@ -79,8 +79,8 @@ private SchemaLocationAddHandler() { } protected void updateModel(ModelNode operation, ModelNode model) throws OperationFailedException { - ModelNode uri = URI.resolveModelAttribute(ExpressionResolver.DEFAULT, operation); - ModelNode location = SCHEMA_LOCATION.resolveModelAttribute(ExpressionResolver.DEFAULT, operation); + ModelNode uri = URI.resolveModelAttribute(ExpressionResolver.REJECTING, operation); + ModelNode location = SCHEMA_LOCATION.resolveModelAttribute(ExpressionResolver.REJECTING, operation); ModelNode locations = model.get(SCHEMA_LOCATIONS); validate(uri, locations); locations.add(uri.asString(), location.asString()); diff --git a/controller/src/test/java/org/jboss/as/controller/ExpressionResolverUnitTestCase.java b/controller/src/test/java/org/jboss/as/controller/ExpressionResolverUnitTestCase.java index fdbf61187f54..2522b16970b1 100644 --- a/controller/src/test/java/org/jboss/as/controller/ExpressionResolverUnitTestCase.java +++ b/controller/src/test/java/org/jboss/as/controller/ExpressionResolverUnitTestCase.java @@ -36,7 +36,7 @@ public class ExpressionResolverUnitTestCase { @Test(expected = OperationFailedException.class) public void testDefaultExpressionResolverWithNoResolutions() throws OperationFailedException { ModelNode unresolved = createModelNode(); - ExpressionResolver.DEFAULT.resolveExpressions(unresolved); + ExpressionResolver.TEST_RESOLVER.resolveExpressions(unresolved); fail("Did not fail with ISE: " + unresolved); } @@ -49,7 +49,7 @@ public void testDefaultExpressionResolverWithSystemPropertyResolutions() throws System.setProperty("test.prop.three", "THREE"); System.setProperty("test.prop.prop", "PROP"); try { - ModelNode node = ExpressionResolver.DEFAULT.resolveExpressions(createModelNode()); + ModelNode node = ExpressionResolver.TEST_RESOLVER.resolveExpressions(createModelNode()); checkResolved(node); } finally { System.clearProperty("test.prop.expr"); diff --git a/controller/src/test/java/org/jboss/as/controller/TestModelControllerService.java b/controller/src/test/java/org/jboss/as/controller/TestModelControllerService.java index a6df21c2ba3a..d102d2fc4c0c 100644 --- a/controller/src/test/java/org/jboss/as/controller/TestModelControllerService.java +++ b/controller/src/test/java/org/jboss/as/controller/TestModelControllerService.java @@ -59,13 +59,13 @@ protected TestModelControllerService(final ConfigurationPersister configurationP protected TestModelControllerService(final ProcessType processType, final ConfigurationPersister configurationPersister, final ControlledProcessState processState, final ResourceDefinition rootDescriptionProvider) { - super(processType, new RunningModeControl(RunningMode.NORMAL), configurationPersister, processState, rootDescriptionProvider, null, ExpressionResolver.DEFAULT); + super(processType, new RunningModeControl(RunningMode.NORMAL), configurationPersister, processState, rootDescriptionProvider, null, ExpressionResolver.TEST_RESOLVER); this.processState = processState; } protected TestModelControllerService(final ProcessType processType, final ConfigurationPersister configurationPersister, final ControlledProcessState processState, final DescriptionProvider rootDescriptionProvider) { - super(processType, new RunningModeControl(RunningMode.NORMAL), configurationPersister, processState, rootDescriptionProvider, null, ExpressionResolver.DEFAULT); + super(processType, new RunningModeControl(RunningMode.NORMAL), configurationPersister, processState, rootDescriptionProvider, null, ExpressionResolver.TEST_RESOLVER); this.processState = processState; } diff --git a/host-controller/src/main/java/org/jboss/as/host/controller/ManagedServer.java b/host-controller/src/main/java/org/jboss/as/host/controller/ManagedServer.java index 196ecccc2bd2..8cc460900d67 100644 --- a/host-controller/src/main/java/org/jboss/as/host/controller/ManagedServer.java +++ b/host-controller/src/main/java/org/jboss/as/host/controller/ManagedServer.java @@ -607,7 +607,8 @@ public interface ManagedServerBootConfiguration { boolean isManagementSubsystemEndpoint(); /** - * Get the subsystem endpoint configuration, in case we use the subsystem. + * Get the subsystem endpoint configuration, in case we use the subsystem. This will be a + * resolved model node with no unresolved expressions. The model will not, however, store defaults. * * @return the subsystem endpoint config */ diff --git a/model-test/src/main/java/org/jboss/as/model/test/ModelTestModelControllerService.java b/model-test/src/main/java/org/jboss/as/model/test/ModelTestModelControllerService.java index e123ada848ec..5a3926a2733f 100644 --- a/model-test/src/main/java/org/jboss/as/model/test/ModelTestModelControllerService.java +++ b/model-test/src/main/java/org/jboss/as/model/test/ModelTestModelControllerService.java @@ -77,6 +77,7 @@ public abstract class ModelTestModelControllerService extends AbstractController protected ModelTestModelControllerService(final ProcessType processType, final RunningModeControl runningModeControl, final TransformerRegistry transformerRegistry, final StringConfigurationPersister persister, boolean validateOps, final DescriptionProvider rootDescriptionProvider, ControlledProcessState processState) { + // Fails in core-model-test transformation testing if ExpressionResolver.TEST_RESOLVER is used because not present in 7.1.x super(processType, runningModeControl, persister, processState == null ? new ControlledProcessState(true) : processState, rootDescriptionProvider, null, ExpressionResolver.DEFAULT); this.persister = persister; @@ -89,7 +90,7 @@ protected ModelTestModelControllerService(final ProcessType processType, final R final StringConfigurationPersister persister, final boolean validateOps, final DelegatingResourceDefinition rootResourceDefinition, ControlledProcessState processState) { super(processType, runningModeControl, persister, processState == null ? new ControlledProcessState(true) : processState, rootResourceDefinition, null, - ExpressionResolver.DEFAULT); + ExpressionResolver.TEST_RESOLVER); this.persister = persister; this.transformerRegistry = transformerRegistry; this.validateOps = validateOps; diff --git a/platform-mbean/src/test/java/org/jboss/as/platform/mbean/PlatformMBeanTestModelControllerService.java b/platform-mbean/src/test/java/org/jboss/as/platform/mbean/PlatformMBeanTestModelControllerService.java index 4e3bbde95e8c..ce4b824edf45 100644 --- a/platform-mbean/src/test/java/org/jboss/as/platform/mbean/PlatformMBeanTestModelControllerService.java +++ b/platform-mbean/src/test/java/org/jboss/as/platform/mbean/PlatformMBeanTestModelControllerService.java @@ -66,7 +66,7 @@ public ModelNode getModelDescription(Locale locale) { */ protected PlatformMBeanTestModelControllerService() { super(ProcessType.EMBEDDED_SERVER, new RunningModeControl(RunningMode.NORMAL), new NullConfigurationPersister(), new ControlledProcessState(true), - ResourceBuilder.Factory.create(PathElement.pathElement("root"),new NonResolvingResourceDescriptionResolver()).build(), null, ExpressionResolver.DEFAULT); + ResourceBuilder.Factory.create(PathElement.pathElement("root"),new NonResolvingResourceDescriptionResolver()).build(), null, ExpressionResolver.TEST_RESOLVER); } @Override diff --git a/security/src/main/java/org/jboss/as/security/SecurityDomainAdd.java b/security/src/main/java/org/jboss/as/security/SecurityDomainAdd.java index 387dbb6c2352..70832e4be056 100644 --- a/security/src/main/java/org/jboss/as/security/SecurityDomainAdd.java +++ b/security/src/main/java/org/jboss/as/security/SecurityDomainAdd.java @@ -73,7 +73,6 @@ import org.infinispan.manager.EmbeddedCacheManager; import org.jboss.as.clustering.infinispan.subsystem.EmbeddedCacheManagerService; import org.jboss.as.controller.AbstractAddStepHandler; -import org.jboss.as.controller.ExpressionResolver; import org.jboss.as.controller.OperationContext; import org.jboss.as.controller.OperationFailedException; import org.jboss.as.controller.OperationStepHandler; @@ -223,7 +222,7 @@ private boolean processMapping(OperationContext context, String securityDomain, for (Property moduleProperty : node.asPropertyList()) { ModelNode module = moduleProperty.getValue(); MappingInfo mappingInfo = new MappingInfo(securityDomain); - String codeName = extractCode(module, ModulesMap.MAPPING_MAP); + String codeName = extractCode(context, module, ModulesMap.MAPPING_MAP); String mappingType; if (module.hasDefined(TYPE)) { @@ -327,7 +326,7 @@ private boolean processAuthorization(OperationContext context, String securityDo AuthorizationInfo authzInfo = new AuthorizationInfo(securityDomain); for (Property moduleProperty : node.asPropertyList()) { ModelNode module = moduleProperty.getValue(); - String codeName = extractCode(module, ModulesMap.AUTHORIZATION_MAP); + String codeName = extractCode(context, module, ModulesMap.AUTHORIZATION_MAP); String flag = LoginModuleResourceDefinition.FLAG.resolveModelAttribute(context, module).asString(); ControlFlag controlFlag = ControlFlag.valueOf(flag); Map options = extractOptions(context, module); @@ -370,7 +369,7 @@ public void addAppConfigurationEntry(AppConfigurationEntry entry) { } for (Property moduleProperty : node.get(AUTH_MODULE).asPropertyList()) { ModelNode authModule = moduleProperty.getValue(); - String code = extractCode(authModule, ModulesMap.AUTHENTICATION_MAP); + String code = extractCode(context, authModule, ModulesMap.AUTHENTICATION_MAP); String loginStackRef = null; if (authModule.hasDefined(LOGIN_MODULE_STACK_REF)) { loginStackRef = JASPIMappingModuleDefinition.LOGIN_MODULE_STACK_REF.resolveModelAttribute(context, authModule).asString(); @@ -398,8 +397,8 @@ public void addAppConfigurationEntry(AppConfigurationEntry entry) { return true; } - private static String extractCode(ModelNode node, Map substitutions) throws OperationFailedException { - String code = LoginModuleResourceDefinition.CODE.resolveModelAttribute(ExpressionResolver.DEFAULT, node).asString(); + private static String extractCode(OperationContext context, ModelNode node, Map substitutions) throws OperationFailedException { + String code = LoginModuleResourceDefinition.CODE.resolveModelAttribute(context, node).asString(); if (substitutions.containsKey(code)) { code = substitutions.get(code); } return code; } @@ -439,7 +438,7 @@ private void processLoginModules(OperationContext context, ModelNode node, BaseA throws OperationFailedException { for (Property moduleProperty : node.asPropertyList()) { ModelNode module = moduleProperty.getValue(); - String codeName = extractCode(module, ModulesMap.AUTHENTICATION_MAP); + String codeName = extractCode(context, module, ModulesMap.AUTHENTICATION_MAP); String flag = LoginModuleResourceDefinition.FLAG.resolveModelAttribute(context, module).asString(); LoginModuleControlFlag controlFlag = getControlFlag(flag); Map options = extractOptions(context, module); diff --git a/server/src/main/java/org/jboss/as/server/DomainServerCommunicationServices.java b/server/src/main/java/org/jboss/as/server/DomainServerCommunicationServices.java index b93250e69ff5..1d3fb5fc0228 100644 --- a/server/src/main/java/org/jboss/as/server/DomainServerCommunicationServices.java +++ b/server/src/main/java/org/jboss/as/server/DomainServerCommunicationServices.java @@ -78,6 +78,8 @@ public void activate(final ServiceActivatorContext serviceActivatorContext) thro final ServiceName endpointName = managementSubsystemEndpoint ? RemotingServices.SUBSYSTEM_ENDPOINT : ManagementRemotingServices.MANAGEMENT_ENDPOINT; final EndpointService.EndpointType endpointType = managementSubsystemEndpoint ? EndpointService.EndpointType.SUBSYSTEM : EndpointService.EndpointType.MANAGEMENT; try { + // TODO see if we can figure out a way to work in the vault resolver instead of having to use ExpressionResolver.DEFAULT + @SuppressWarnings("deprecation") final OptionMap options = EndpointConfigFactory.create(ExpressionResolver.DEFAULT, endpointConfig, DEFAULTS); ManagementRemotingServices.installRemotingEndpoint(serviceTarget, endpointName, SecurityActions.getSystemProperty(ServerEnvironment.NODE_NAME), endpointType, options, null, null); diff --git a/server/src/test/java/org/jboss/as/server/test/ServerControllerUnitTestCase.java b/server/src/test/java/org/jboss/as/server/test/ServerControllerUnitTestCase.java index 073e1ba2f1e2..bb4fed8de2b3 100644 --- a/server/src/test/java/org/jboss/as/server/test/ServerControllerUnitTestCase.java +++ b/server/src/test/java/org/jboss/as/server/test/ServerControllerUnitTestCase.java @@ -278,7 +278,7 @@ private static class ModelControllerService extends AbstractControllerService { ModelControllerService(final ControlledProcessState processState, final StringConfigurationPersister persister, final DelegatingResourceDefinition rootResourceDefinition) { - super(ProcessType.EMBEDDED_SERVER, new RunningModeControl(RunningMode.ADMIN_ONLY), persister, processState, rootResourceDefinition, null, ExpressionResolver.DEFAULT); + super(ProcessType.EMBEDDED_SERVER, new RunningModeControl(RunningMode.ADMIN_ONLY), persister, processState, rootResourceDefinition, null, ExpressionResolver.TEST_RESOLVER); this.persister = persister; this.processState = processState; this.rootResourceDefinition = rootResourceDefinition; diff --git a/testsuite/integration/manualmode/src/test/java/org/jboss/as/test/manualmode/parse/ParseAndMarshalModelsTestCase.java b/testsuite/integration/manualmode/src/test/java/org/jboss/as/test/manualmode/parse/ParseAndMarshalModelsTestCase.java index 214ff0f1be5e..e4a9e6a626e0 100644 --- a/testsuite/integration/manualmode/src/test/java/org/jboss/as/test/manualmode/parse/ParseAndMarshalModelsTestCase.java +++ b/testsuite/integration/manualmode/src/test/java/org/jboss/as/test/manualmode/parse/ParseAndMarshalModelsTestCase.java @@ -978,7 +978,7 @@ class ModelControllerService extends AbstractControllerService { ModelControllerService(final ProcessType processType, final Setup registration, final ModelNode model) { super(processType, new RunningModeControl(RunningMode.ADMIN_ONLY), new NullConfigurationPersister(), new ControlledProcessState(true), - ResourceBuilder.Factory.create(PathElement.pathElement("root"), new NonResolvingResourceDescriptionResolver()).build(), null, ExpressionResolver.DEFAULT); + ResourceBuilder.Factory.create(PathElement.pathElement("root"), new NonResolvingResourceDescriptionResolver()).build(), null, ExpressionResolver.TEST_RESOLVER); this.model = model; this.registration = registration; } diff --git a/threads/src/test/java/org/jboss/as/threads/ThreadsSubsystemParsingTestCase.java b/threads/src/test/java/org/jboss/as/threads/ThreadsSubsystemParsingTestCase.java index 07c57ccb9fb9..8a471d20930f 100644 --- a/threads/src/test/java/org/jboss/as/threads/ThreadsSubsystemParsingTestCase.java +++ b/threads/src/test/java/org/jboss/as/threads/ThreadsSubsystemParsingTestCase.java @@ -1235,7 +1235,7 @@ public class ModelControllerService extends AbstractControllerService { ModelControllerService() { super(ProcessType.EMBEDDED_SERVER, new RunningModeControl(RunningMode.NORMAL), new TestConfigurationPersister(), new ControlledProcessState(true), - ResourceBuilder.Factory.create(PathElement.pathElement("root"), new NonResolvingResourceDescriptionResolver()).build(), null, ExpressionResolver.DEFAULT); + ResourceBuilder.Factory.create(PathElement.pathElement("root"), new NonResolvingResourceDescriptionResolver()).build(), null, ExpressionResolver.TEST_RESOLVER); } @Override diff --git a/webservices/server-integration/src/test/java/org/jboss/as/webservices/dmr/WebservicesSubsystemParserTest.java b/webservices/server-integration/src/test/java/org/jboss/as/webservices/dmr/WebservicesSubsystemParserTest.java index c22cd92c8256..a0a71bb0c753 100644 --- a/webservices/server-integration/src/test/java/org/jboss/as/webservices/dmr/WebservicesSubsystemParserTest.java +++ b/webservices/server-integration/src/test/java/org/jboss/as/webservices/dmr/WebservicesSubsystemParserTest.java @@ -121,10 +121,10 @@ public void testParseV12() throws Exception { } private void checkSubsystemBasics(ModelNode model) throws Exception { - assertEquals(9090, Attributes.WSDL_PORT.resolveModelAttribute(ExpressionResolver.DEFAULT, model).asInt()); - assertEquals(9443, Attributes.WSDL_SECURE_PORT.resolveModelAttribute(ExpressionResolver.DEFAULT, model).asInt()); - assertEquals("localhost", Attributes.WSDL_HOST.resolveModelAttribute(ExpressionResolver.DEFAULT, model).asString()); - assertTrue(Attributes.MODIFY_WSDL_ADDRESS.resolveModelAttribute(ExpressionResolver.DEFAULT, model).asBoolean()); + assertEquals(9090, Attributes.WSDL_PORT.resolveModelAttribute(ExpressionResolver.TEST_RESOLVER, model).asInt()); + assertEquals(9443, Attributes.WSDL_SECURE_PORT.resolveModelAttribute(ExpressionResolver.TEST_RESOLVER, model).asInt()); + assertEquals("localhost", Attributes.WSDL_HOST.resolveModelAttribute(ExpressionResolver.TEST_RESOLVER, model).asString()); + assertTrue(Attributes.MODIFY_WSDL_ADDRESS.resolveModelAttribute(ExpressionResolver.TEST_RESOLVER, model).asBoolean()); } @@ -133,11 +133,11 @@ private void checkEndpointConfigs(ModelNode model) throws Exception { assertEquals("Standard-Endpoint-Config", endpoints.get(0).getName()); assertEquals("Recording-Endpoint-Config", endpoints.get(1).getName()); ModelNode recordingEndpoint = endpoints.get(1).getValue(); - assertEquals("bar", Attributes.VALUE.resolveModelAttribute(ExpressionResolver.DEFAULT, recordingEndpoint.get(Constants.PROPERTY).get("foo")).asString()); + assertEquals("bar", Attributes.VALUE.resolveModelAttribute(ExpressionResolver.TEST_RESOLVER, recordingEndpoint.get(Constants.PROPERTY).get("foo")).asString()); List chain = recordingEndpoint.get(Constants.PRE_HANDLER_CHAIN).asPropertyList(); assertEquals("recording-handlers", chain.get(0).getName()); ModelNode recordingHandler = chain.get(0).getValue(); - assertEquals("##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP ##SOAP12_HTTP_MTOM", Attributes.PROTOCOL_BINDINGS.resolveModelAttribute(ExpressionResolver.DEFAULT, recordingHandler).asString()); + assertEquals("##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP ##SOAP12_HTTP_MTOM", Attributes.PROTOCOL_BINDINGS.resolveModelAttribute(ExpressionResolver.TEST_RESOLVER, recordingHandler).asString()); assertEquals("org.jboss.ws.common.invocation.RecordingServerHandler", recordingHandler.get(Constants.HANDLER, "RecordingHandler", Constants.CLASS).asString()); }