public Story(String id, final String storyName, final String storyClassName, final String path, final ApplicationFeature feature) { this.id = id; this.storyName = storyName; this.storyClassName = storyClassName; this.feature = feature; this.path = path; this.narrative = null; this.type = FeatureType.STORY.toString(); }
protected Story(final String id, final String storyName, final ApplicationFeature feature, final String path) { this.id = id; this.storyName = storyName; this.storyClassName = null; this.feature = feature; this.path = path; this.type = FeatureType.STORY.toString(); }
public Story(String id, final String storyName, final String storyClassName, final String path, final ApplicationFeature feature, final String narrative, final String type) { this.id = id; this.storyName = storyName; this.storyClassName = storyClassName; this.feature = feature; this.path = path; this.narrative = narrative; this.type = type; }
public Story asFeature() { return new Story(this.id, this.storyName, this.storyClassName, this.path,this.feature,this.narrative, FeatureType.FEATURE.toString()); }
protected Story(final Class<?> userStoryClass) { this.id = userStoryClass.getCanonicalName(); this.storyClassName = userStoryClass.getName(); this.storyName = humanize(userStoryClass.getSimpleName()); this.feature = findFeatureFrom(userStoryClass); this.path = pathOf(userStoryClass); this.type = FeatureType.STORY.toString(); }
private String typeFrom(String path) { if ((rootPackage == null) || requirementTypesProvider.getActiveRequirementTypes().isEmpty()) { return FeatureType.STORY.toString(); } int requirementsLevel = PathElements.elementsOf(path, rootPackage).size() - 1; int effectiveRequirementsLevel = Math.min(requirementsLevel, requirementTypesProvider.getActiveRequirementTypes().size() - 1); return requirementTypesProvider.getActiveRequirementTypes().get(effectiveRequirementsLevel); }
public Story withPath(String path) { return new Story(this.id, this.storyName, this.storyClassName, path,this.feature,this.narrative, FeatureType.forFilename(path).toString()); }
public Requirement readRequirementsFromStoryOrFeatureFile(File storyFile) { FeatureType type = featureTypeOf(storyFile); String defaultStoryName = storyFile.getName().replace(type.getExtension(), ""); Optional<Narrative> optionalNarrative = (type == FeatureType.STORY) ? loadFromStoryFile(storyFile) : loadFromFeatureFile(storyFile); String storyName = (optionalNarrative.isPresent()) ? optionalNarrative.get().getTitle().or(defaultStoryName) : defaultStoryName; Requirement requirement = (optionalNarrative.isPresent()) ? leafRequirementWithNarrative(humanReadableVersionOf(storyName), optionalNarrative.get()).withType(type.toString()) : storyNamed(storyName).withType(type.toString()); return requirement.definedInFile(storyFile); }
public Requirement readRequirementsFromStoryOrFeatureFile(File storyFile) { FeatureType type = featureTypeOf(storyFile); java.util.Optional<Narrative> narrative = (type == FeatureType.STORY) ? loadFromStoryFile(storyFile) : loadFromFeatureFile(storyFile); String storyName = storyNameFrom(narrative, type, storyFile); Requirement requirement; if (narrative.isPresent()) { requirement = leafRequirementWithNarrative(storyName, storyFile.getPath(), narrative.get()).withType(type.toString()); } else { requirement = storyNamed(storyName, storyFile.getPath()).withType(type.toString()); } return requirement.definedInFile(storyFile); }