Package net.thucydides.core.requirements.model

Examples of net.thucydides.core.requirements.model.Requirement


        //reset the parents
        for (Map.Entry<String, Requirement> entry : storedRequirementsMap.entrySet()) {
            String key = entry.getKey();
            if (key.contains(".")) {
                String parent = key.substring(0, key.lastIndexOf("."));
                Requirement child = entry.getValue();
                updateParentChildren(map, parent, child);
            }
        }
        return map;
    }
View Full Code Here


        }
        return map;
    }

    private void updateParentChildren(SortedMap<String, Requirement> map, String parent, Requirement entry) {
        Requirement parentRequirement = map.get(parent);
        Requirement updatedParentRequirement = parentRequirement.withChild(entry);
        map.remove(parent);
        map.put(parent, updatedParentRequirement);
    }
View Full Code Here

    }

    private Map<Requirement, String> indexRequirements(SortedMap<String, Requirement> requirementsByPath) {
        Map<Requirement, String> requirementPaths = Maps.newHashMap();
        for(String path : requirementsByPath.keySet()) {
            Requirement requirement = requirementsByPath.get(path);
            requirementPaths.put(requirement, path);

        }
        return requirementPaths;
    }
View Full Code Here

        List<Requirement> immediateChildren = Lists.newArrayList();
        if (!isLeaf(requirement)) {
            String requirementPath = requirementPaths.get(requirement);
            for (String path : requirementsByPath.keySet()) {
                Requirement childRequirement = requirementsByPath.get(path);

                if ((childRequirement != requirement) && (isImmediateChild(requirementPath, path))) {
                    if (isLeaf(childRequirement)) {
                        immediateChildren.add(childRequirement);
                    } else {
                        immediateChildren.add(childRequirement.withChildren(findDirectChildrenFor(childRequirement,
                                requirementsByPath,
                                requirementPaths)));
                    }
                }
            }
View Full Code Here

        String[] packageNames = fullRequirementName.split(DOT_REGEX);
        String currentPath = "";
        for (int level = 0; level < packageNames.length; level++) {
            currentPath = (currentPath.isEmpty()) ? packageNames[level] : Joiner.on(".").join(currentPath, packageNames[level]);
            String defaultRequirementType = getDefaultType(level);
            Requirement currentRequirement;
            if (!requirementsByPath.containsKey(currentPath)) {
                if (level < packageNames.length - 1) {
                    currentRequirement = newParentRequirement(currentPath, packageNames[level], level, defaultRequirementType);
                    requirementsByPath.put(currentPath, currentRequirement);
                } else {
View Full Code Here

    }

    private void generateRequirementsReportsForChildRequirements(RequirementsOutcomes requirementsOutcomes) throws IOException {
        List<RequirementOutcome> requirementOutcomes = requirementsOutcomes.getRequirementOutcomes();
        for (RequirementOutcome outcome : requirementOutcomes) {
            Requirement requirement = outcome.getRequirement();
            if (!reportTally.contains(requirement)) {
                TestOutcomes testOutcomesForThisRequirement = outcome.getTestOutcomes().withTag(requirement.asTag());
                RequirementsOutcomes requirementOutcomesForThisRequirement = requirementsFactory.buildRequirementsOutcomesFrom(requirement, testOutcomesForThisRequirement);
                generateNestedRequirementsReportsFor(requirement, requirementOutcomesForThisRequirement);
            }
        }
    }
View Full Code Here

    }

    private String typeOfFirstChildPresent() {
        for (RequirementOutcome outcome : requirementOutcomes) {
            if (!outcome.getRequirement().getChildren().isEmpty()) {
                Requirement firstChildRequirement = outcome.getRequirement().getChildren().get(0);
                return firstChildRequirement.getType();
            }
        }
        return null;
    }
View Full Code Here

TOP

Related Classes of net.thucydides.core.requirements.model.Requirement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.