net.thucydides.core.model
Class Story

Package class diagram package Story
java.lang.Object
  extended by net.thucydides.core.model.Story

public class Story
extends Object

Represents a given user story. Used to record test results and so on.


Constructor Summary
protected Story(Class<?> userStoryClass)
           
protected Story(String qualifiedStoryClassName, String storyName, String qualifiedFeatureClassName, String featureName, String path)
           
 
Method Summary
static Story called(String storyName)
           
 boolean equals(Object obj)
           
static Story from(Class<?> userStoryClass)
          Obtain a story instance from a given story class.
 ApplicationFeature getFeature()
           
 Class<?> getFeatureClass()
          What feature does this story belong to?
 String getFeatureId()
           
 String getFeatureName()
           
 String getId()
           
 String getName()
          Each story has a descriptive name.
 String getPath()
           
 String getReportName()
           
 String getReportName(ReportType type)
          Find the name of the report for this story for the specified report type (XML, HTML,...).
 Class<?> getUserStoryClass()
          The underlying user story class that represents this story.
 int hashCode()
           
static Class<?> testedInTestCase(Class<?> testClass)
          Returns the class representing the story that is tested by a given test class This is indicated by the Story annotation.
static Story withId(String storyId, String storyName)
          Create a story using a full class name as an id.
static Story withId(String storyId, String storyName, String featureClassName, String featureName)
           
static Story withIdAndPath(String storyId, String storyName, String storyPath)
           
static Story withIdAndPathAndFeature(String storyId, String storyName, String storyPath, String featureClassName, String featureName)
           
 Story withNarrative(String narrative)
           
 Story withPath(String storyPath)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Story

protected Story(Class<?> userStoryClass)

Story

protected Story(String qualifiedStoryClassName,
                String storyName,
                String qualifiedFeatureClassName,
                String featureName,
                String path)
Method Detail

getId

public String getId()

from

public static Story from(Class<?> userStoryClass)
Obtain a story instance from a given story class. Story instances are used for recording and reporting test results.


withId

public static Story withId(String storyId,
                           String storyName)
Create a story using a full class name as an id. Note that the class may no longer exist, so the story needs to be able to exist beyond the life of the original story class. This is used to deserialize stories from XML files.


withNarrative

public Story withNarrative(String narrative)

withIdAndPath

public static Story withIdAndPath(String storyId,
                                  String storyName,
                                  String storyPath)

called

public static Story called(String storyName)

withId

public static Story withId(String storyId,
                           String storyName,
                           String featureClassName,
                           String featureName)

withIdAndPathAndFeature

public static Story withIdAndPathAndFeature(String storyId,
                                            String storyName,
                                            String storyPath,
                                            String featureClassName,
                                            String featureName)

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

getUserStoryClass

public Class<?> getUserStoryClass()
The underlying user story class that represents this story. This is used to record the original story class in the reports and XML results files.


getFeatureClass

public Class<?> getFeatureClass()
What feature does this story belong to?


testedInTestCase

public static Class<?> testedInTestCase(Class<?> testClass)
Returns the class representing the story that is tested by a given test class This is indicated by the Story annotation.

Returns:

getName

public String getName()
Each story has a descriptive name. This name is usually a human-readable version of the class name, or the story name for an easyb story.


getFeatureName

public String getFeatureName()

getReportName

public String getReportName(ReportType type)
Find the name of the report for this story for the specified report type (XML, HTML,...).


getReportName

public String getReportName()

getFeatureId

public String getFeatureId()

getFeature

public ApplicationFeature getFeature()

getPath

public String getPath()

withPath

public Story withPath(String storyPath)


Copyright © 2011-2013 Wakaleo Consulting. All Rights Reserved.