org.tap4j.model
Class TestSet

Package class diagram package TestSet
java.lang.Object
  extended by org.tap4j.model.TestSet
All Implemented Interfaces:
Serializable

public class TestSet
extends Object
implements Serializable

A Test Set is the top element in a TAP File. It holds references to the Header, Plan, List of Test Results and the rest of elements in TAP spec.

Since:
1.0
See Also:
Serialized Form

Constructor Summary
TestSet()
          Default constructor.
 
Method Summary
 boolean addBailOut(BailOut bailOut)
           
 boolean addComment(Comment comment)
           
 boolean addTapLine(TapResult tapLine)
          Adds a new TAP Line.
 boolean addTestResult(TestResult testResult)
          Adds a TestResult into the list of TestResults.
 Boolean containsBailOut()
           
 Boolean containsNotOk()
           
 Boolean containsOk()
           
 List<BailOut> getBailOuts()
           
 List<Comment> getComments()
           
 Footer getFooter()
           
 Header getHeader()
           
 int getNextTestNumber()
           
 int getNumberOfBailOuts()
           
 int getNumberOfComments()
           
 int getNumberOfTapLines()
           
 int getNumberOfTestResults()
           
 Plan getPlan()
           
 List<TapResult> getTapLines()
           
 TestResult getTestResult(Integer testNumber)
           
 List<TestResult> getTestResults()
           
 boolean hasBailOut()
           
 boolean removeBailOut(BailOut bailOut)
          Removes a Bail Out from the list.
 boolean removeComment(Comment comment)
          Removes a Comment from the list.
protected  boolean removeTapLine(TapResult tapLine)
          Removes a TAP Line from the list.
 boolean removeTestResult(TestResult testResult)
          Removes a Test Result from the list.
 void setFooter(Footer footer)
           
 void setHeader(Header header)
           
 void setPlan(Plan plan)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestSet

public TestSet()
Default constructor.

Method Detail

getHeader

public Header getHeader()
Returns:
TAP Header.

setHeader

public void setHeader(Header header)
Parameters:
header - TAP Header.

getPlan

public Plan getPlan()
Returns:
TAP Plan.

setPlan

public void setPlan(Plan plan)
Parameters:
plan - TAP Plan.

getTapLines

public List<TapResult> getTapLines()
Returns:
List of TAP Lines. These lines may be either a TestResult or a BailOut.

getTestResults

public List<TestResult> getTestResults()
Returns:
List of Test Results.

getNextTestNumber

public int getNextTestNumber()
Returns:
Next test number.

getBailOuts

public List<BailOut> getBailOuts()
Returns:
List of Bail Outs.

getComments

public List<Comment> getComments()
Returns:
List of Comments.

addTapLine

public boolean addTapLine(TapResult tapLine)
Adds a new TAP Line.

Parameters:
tapLine - TAP Line.
Returns:
True if the TAP Line could be added into the list successfully.

addTestResult

public boolean addTestResult(TestResult testResult)
Adds a TestResult into the list of TestResults. If the TestResult Test Number is null or less than or equals to zero it is changed to the next Test Number in the sequence.

Parameters:
testResult - TAP TestResult.
Returns:
Whether could add to TestResult list or not.

addBailOut

public boolean addBailOut(BailOut bailOut)
Parameters:
bailOut - Bail Out.
Returns:
Whether could add to BailOut list or not.

addComment

public boolean addComment(Comment comment)
Parameters:
comment - Comment. Whether could add to Comment list or not.

removeTapLine

protected boolean removeTapLine(TapResult tapLine)
Removes a TAP Line from the list.

Parameters:
tapLine - TAP Line object.
Returns:
True if could successfully remove the TAP Line from the list.

removeTestResult

public boolean removeTestResult(TestResult testResult)
Removes a Test Result from the list.

Parameters:
testResult - Test Result.
Returns:
True if could successfully remove the Test Result from the list.

removeBailOut

public boolean removeBailOut(BailOut bailOut)
Removes a Bail Out from the list.

Parameters:
bailOut - Bail Out object.
Returns:
True if could successfully remove the Bail Out from the list.

removeComment

public boolean removeComment(Comment comment)
Removes a Comment from the list.

Parameters:
comment - Comment.
Returns:
True if could successfully remove the Comment from the list.

getNumberOfTapLines

public int getNumberOfTapLines()
Returns:
Number of TAP Lines. It includes Test Results, Bail Outs and Comments (the footer is not included).

getNumberOfTestResults

public int getNumberOfTestResults()
Returns:
Number of Test Results.

getNumberOfBailOuts

public int getNumberOfBailOuts()
Returns:
Number of Bail Outs.

getNumberOfComments

public int getNumberOfComments()
Returns:
Number of Comments.

getFooter

public Footer getFooter()
Returns:
Footer

setFooter

public void setFooter(Footer footer)
Parameters:
footer - Footer

hasBailOut

public boolean hasBailOut()
Returns:
True if it has any Bail Out statement, false otherwise.

containsOk

public Boolean containsOk()

containsNotOk

public Boolean containsNotOk()

containsBailOut

public Boolean containsBailOut()

getTestResult

public TestResult getTestResult(Integer testNumber)


Copyright © 2010-2012 TupiLabs. All Rights Reserved.