private void compareSubsystemModels() { System.out.println("====== Comparing subsystem models ======"); ResourceDefinition rootCurrentDefinition = new ResourceDefinition(trimNonSubsystem(currentResourceDefinitions), currentModelVersions); ResourceDefinition rootLegacyDefinition = new ResourceDefinition(trimNonSubsystem(legacyResourceDefinitions), legacyModelVersions); Map<String, ModelNode> currentSubsystems = rootCurrentDefinition.getChildren(SUBSYSTEM); Map<String, ModelNode> legacySubsystems = rootLegacyDefinition.getChildren(SUBSYSTEM); CompareContext context = new CompareContext( PathAddress.EMPTY_ADDRESS, PathAddress.EMPTY_ADDRESS, true, rootCurrentDefinition, rootLegacyDefinition); compareKeySetsAndRemoveMissing(context, "subsystems", currentSubsystems, legacySubsystems); for (Map.Entry<String, ModelNode> legacyEntry : legacySubsystems.entrySet()) { PathAddress subsystemAddress = PathAddress.pathAddress(PathElement.pathElement(SUBSYSTEM, legacyEntry.getKey())); ResourceDefinition currentDefinition = new ResourceDefinition(currentSubsystems.get(legacyEntry.getKey()), currentModelVersions); ResourceDefinition legacyDefinition = new ResourceDefinition(legacyEntry.getValue(), legacyModelVersions); context = new CompareContext( subsystemAddress, subsystemAddress, false, currentDefinition, legacyDefinition); if (!context.continuteWithCheck()) { continue; } compareModel(context); } }
private void compareCoreModels() { System.out.println("====== Comparing core models ======"); ResourceDefinition currentDefinition = new ResourceDefinition(trimSubsystem(currentResourceDefinitions), currentModelVersions); ResourceDefinition legacyDefinition = new ResourceDefinition(trimSubsystem(legacyResourceDefinitions), legacyModelVersions); CompareContext context = new CompareContext( PathAddress.EMPTY_ADDRESS, PathAddress.EMPTY_ADDRESS, true, currentDefinition, legacyDefinition); if (!context.continuteWithCheck()) { return; } compareModel(context); }