de.smartics.testdoc.core.doc
Class ScenarioTestDoc

Package class diagram package ScenarioTestDoc
java.lang.Object
  extended by de.smartics.testdoc.core.doc.ScenarioTestDoc
All Implemented Interfaces:
Serializable, Comparable< ScenarioTestDoc>

public final class ScenarioTestDoc
     
     
extends Object
implements Serializable, Comparable< ScenarioTestDoc>

The test documentation of a single scenario of a unit-under-test.

Author:
Robert Reiner
See Also:
Serialized Form
To Do:
check deserialized form for not being tampered with.

Constructor Summary
ScenarioTestDoc(String uutMethod, String testCaseType, TestMethodDoc testMethod)
          Convenience constructor specifying the test case type as a String .
ScenarioTestDoc(String uutMethod, String testCaseType, TestMethodDoc testMethod, List<String> categories)
          Convenience constructor specifying the test case type as a String .
ScenarioTestDoc(String testCaseType, TestMethodDoc testMethod)
          Convenience constructor specifying the test case type as a String .
ScenarioTestDoc(String uutMethod, Type testCaseType, TestMethodDoc testMethod)
          Convenience constructor.
ScenarioTestDoc(String uutMethod, Type testCaseType, TestMethodDoc testMethod, List<String> categories, SortKey sortKey)
          Default constructor.
ScenarioTestDoc(Type testCaseType, TestMethodDoc testMethod, List<String> categories)
          Convenience constructor.
 
Method Summary
 int compareTo(ScenarioTestDoc other)
           The natural order is defined by the SortKey property.
 boolean equals(Object object)
          Returns true if the given object is semantically equal to the given object, false otherwise.
 List<String> getCategories()
          Returns the categories of the scenario.
 String getId()
          Returns a unique identifier for a test method.
 SortKey getSortKey()
          Returns the sort key defining the natural order of scenarios.
 Type getTestCaseType()
          Returns the type of the test case the test has been specified in.
 TestMethodDoc getTestMethod()
          Returns the test method of a scenario.
 String getUutMethod()
          Returns the name of the method under test.
 int hashCode()
          Returns the hash code of the object.
 String toString()
          Returns the string representation of the object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ScenarioTestDoc

public ScenarioTestDoc(String testCaseType,
                       TestMethodDoc testMethod)
                throws IllegalArgumentException
Convenience constructor specifying the test case type as a String .

Parameters:
testCaseType - the type of the test case the test has been specified in.
testMethod - the test method of a scenario.
Throws:
IllegalArgumentException - if testCaseType is null or testName or testSentence is blank.

ScenarioTestDoc

public ScenarioTestDoc(String uutMethod,
                       String testCaseType,
                       TestMethodDoc testMethod)
                throws IllegalArgumentException
Convenience constructor specifying the test case type as a String .

Parameters:
uutMethod - the name of the method under test.
testCaseType - the type of the test case the test has been specified in.
testMethod - the test method of a scenario.
Throws:
IllegalArgumentException - if testCaseType is null or testName or testSentence is blank.

ScenarioTestDoc

public ScenarioTestDoc(String uutMethod,
                       String testCaseType,
                       TestMethodDoc testMethod,
                       List<String> categories)
                throws IllegalArgumentException
Convenience constructor specifying the test case type as a String .

Parameters:
uutMethod - the name of the method under test.
testCaseType - the type of the test case the test has been specified in.
testMethod - the test method of a scenario.
categories - the categories of the scenario.
Throws:
IllegalArgumentException - if testCaseType is null or testName or testSentence is blank.

ScenarioTestDoc

public ScenarioTestDoc(String uutMethod,
                       Type testCaseType,
                       TestMethodDoc testMethod)
                throws IllegalArgumentException
Convenience constructor.

Parameters:
uutMethod - the name of the method under test.
testCaseType - the type of the test case the test has been specified in.
testMethod - the test method of a scenario.
Throws:
IllegalArgumentException - if testCaseType or testMethod is null.

ScenarioTestDoc

public ScenarioTestDoc(Type testCaseType,
                       TestMethodDoc testMethod,
                       List<String> categories)
                throws IllegalArgumentException
Convenience constructor.

Parameters:
testCaseType - the type of the test case the test has been specified in.
testMethod - the test method of a scenario.
categories - the categories of the scenario. May be null.
Throws:
IllegalArgumentException - if testCaseType or testMethod is null.

ScenarioTestDoc

public ScenarioTestDoc(String uutMethod,
                       Type testCaseType,
                       TestMethodDoc testMethod,
                       List<String> categories,
                       SortKey sortKey)
                throws IllegalArgumentException
Default constructor.

Parameters:
uutMethod - the name of the method under test.
testCaseType - the type of the test case the test has been specified in.
testMethod - the test method of a scenario.
categories - the categories of the scenario. May be null.
sortKey - the sort key defining the natural order of scenarios.
Throws:
IllegalArgumentException - if testCaseType, testMethod, or sortKey is null.
Method Detail

getUutMethod

public String getUutMethod()
Returns the name of the method under test.

Returns:
the name of the method under test.

getId

public String getId()
Returns a unique identifier for a test method.

Implementation Notes:
The value is calculated each time it is requested.
Warnings:
Please note that the identifier is not unique if the method is overloaded. Since test methods never have parameters and the parameters of theories should not be significant, this usually is no problem.
Returns:
the unique identifier for the test method.

getTestCaseType

public Type getTestCaseType()
Returns the type of the test case the test has been specified in.

Returns:
the type of the test case the test has been specified in. The returned value is never null.

getTestMethod

public TestMethodDoc getTestMethod()
Returns the test method of a scenario.

Returns:
the test method of a scenario.

getCategories

public List<String> getCategories()
Returns the categories of the scenario.

Returns:
the categories of the scenario.

getSortKey

public SortKey getSortKey()
Returns the sort key defining the natural order of scenarios.

Returns:
the sort key defining the natural order of scenarios.

hashCode

public int hashCode()
Returns the hash code of the object.

Overrides:
hashCode in class Object
Returns:
the hash code.

equals

public boolean equals(Object object)
Returns true if the given object is semantically equal to the given object, false otherwise.

Overrides:
equals in class Object
Parameters:
object - the instance to compare to.
Returns:
true if the given object is semantically equal to the given object, false otherwise.

compareTo

public int compareTo(ScenarioTestDoc other)

The natural order is defined by the SortKey property.

Specified by:
compareTo in interface Comparable<ScenarioTestDoc>
See Also:
Comparable.compareTo(java.lang.Object)

toString

public String toString()
Returns the string representation of the object.

Overrides:
toString in class Object
Returns:
the string representation of the object.


Copyright © 2010-2013 Kronseder & Reiner GmbH - smartics. All Rights Reserved.