String subsystemXml =
"<subsystem xmlns=\"" + DependencySubsystemExtension.NAMESPACE + "\">" +
"</subsystem>" +
"<subsystem xmlns=\"" + MainSubsystemExtension.NAMESPACE + "\">" +
"</subsystem>";
KernelServices servicesA = super.installInController(new DependencyAdditionalInitialization(), subsystemXml);
//Get the model and the describe operations from the first controller
ModelNode modelA = servicesA.readWholeModel();
ModelNode describeOp = new ModelNode();
describeOp.get(OP).set(DESCRIBE);
describeOp.get(OP_ADDR).set(
PathAddress.pathAddress(
PathElement.pathElement(SUBSYSTEM, DependencySubsystemExtension.SUBSYSTEM_NAME)).toModelNode());
ArrayList<ModelNode> allOps = new ArrayList<ModelNode>();
allOps.addAll(super.checkResultAndGetContents(servicesA.executeOperation(describeOp)).asList());
describeOp.get(OP_ADDR).set(
PathAddress.pathAddress(
PathElement.pathElement(SUBSYSTEM, MainSubsystemExtension.SUBSYSTEM_NAME)).toModelNode());
allOps.addAll(super.checkResultAndGetContents(servicesA.executeOperation(describeOp)).asList());
//Install the describe options from the first controller into a second controller
KernelServices servicesB = super.installInController(new DependencyAdditionalInitialization(), allOps);
ModelNode modelB = servicesB.readWholeModel();
//Make sure the models from the two controllers are identical
super.compare(modelA, modelB);
}