diff --git a/jmx/src/main/java/org/jboss/as/jmx/JMXSubsystemRootResource.java b/jmx/src/main/java/org/jboss/as/jmx/JMXSubsystemRootResource.java
index 75db73bcd41..93fbc9f6831 100644
--- a/jmx/src/main/java/org/jboss/as/jmx/JMXSubsystemRootResource.java
+++ b/jmx/src/main/java/org/jboss/as/jmx/JMXSubsystemRootResource.java
@@ -132,7 +132,7 @@ public void execute(OperationContext context, ModelNode operation) throws Operat
OperationStepHandler handler = context.getResourceRegistration().getOperationEntry(PathAddress.pathAddress(ExposeModelResourceResolved.PATH_ELEMENT), ADD).getOperationHandler();
ModelNode addOp = new ModelNode();
addOp.get(OP).set(ADD);
- addOp.get(OP_ADDR).set(PathAddress.pathAddress(operation.get(OP_ADDR)).append(ExposeModelResourceResolved.PATH_ELEMENT).toModelNode());
+ addOp.get(OP_ADDR).set(context.getCurrentAddress().append(ExposeModelResourceResolved.PATH_ELEMENT).toModelNode());
context.addStep(addOp, handler, Stage.MODEL, true);
}
} else {
@@ -140,7 +140,7 @@ public void execute(OperationContext context, ModelNode operation) throws Operat
OperationStepHandler handler = context.getResourceRegistration().getOperationEntry(PathAddress.pathAddress(ExposeModelResourceResolved.PATH_ELEMENT), REMOVE).getOperationHandler();
ModelNode addOp = new ModelNode();
addOp.get(OP).set(REMOVE);
- addOp.get(OP_ADDR).set(PathAddress.pathAddress(operation.get(OP_ADDR)).append(ExposeModelResourceResolved.PATH_ELEMENT).toModelNode());
+ addOp.get(OP_ADDR).set(context.getCurrentAddress().append(ExposeModelResourceResolved.PATH_ELEMENT).toModelNode());
context.addStep(addOp, handler, Stage.MODEL, true);
}
}
diff --git a/jmx/src/test/java/org/jboss/as/jmx/JMXSubsystemTestCase.java b/jmx/src/test/java/org/jboss/as/jmx/JMXSubsystemTestCase.java
index d285a0023f4..6f5dcb4b58d 100644
--- a/jmx/src/test/java/org/jboss/as/jmx/JMXSubsystemTestCase.java
+++ b/jmx/src/test/java/org/jboss/as/jmx/JMXSubsystemTestCase.java
@@ -32,6 +32,7 @@
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.VALUE;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.WRITE_ATTRIBUTE_OPERATION;
+import java.io.IOException;
import java.util.List;
import javax.management.MBeanServerConnection;
@@ -57,7 +58,7 @@
import org.jboss.as.remoting.RemotingServices;
import org.jboss.as.remoting.management.ManagementRemotingServices;
import org.jboss.as.server.ServerEnvironmentResourceDescription;
-import org.jboss.as.subsystem.test.AbstractSubsystemTest;
+import org.jboss.as.subsystem.test.AbstractSubsystemBaseTest;
import org.jboss.as.subsystem.test.AdditionalInitialization;
import org.jboss.as.subsystem.test.ControllerInitializer;
import org.jboss.as.subsystem.test.KernelServices;
@@ -73,7 +74,7 @@
*
* @author Kabir Khan
*/
-public class JMXSubsystemTestCase extends AbstractSubsystemTest {
+public class JMXSubsystemTestCase extends AbstractSubsystemBaseTest {
private static final int JMX_PORT = 27258;
private static final String TYPE_STANDALONE = "STANDALONE";
@@ -82,6 +83,16 @@ public JMXSubsystemTestCase() {
super(JMXExtension.SUBSYSTEM_NAME, new JMXExtension());
}
+ @Override
+ protected String getSubsystemXml() throws IOException {
+ return readResource("subsystem-with-expressions.xml");
+ }
+
+
+ @Override
+ public void testSubsystem() throws Exception {
+ standardSubsystemTest(null, null, true, new AuditLogInitialization());
+ }
@Test
public void testParseEmptySubsystem() throws Exception {
diff --git a/jmx/src/test/resources/org/jboss/as/jmx/subsystem-with-expressions.xml b/jmx/src/test/resources/org/jboss/as/jmx/subsystem-with-expressions.xml
new file mode 100644
index 00000000000..fe395d6193b
--- /dev/null
+++ b/jmx/src/test/resources/org/jboss/as/jmx/subsystem-with-expressions.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
+
+