org.jwalk.out
Class Confirmation

java.lang.Object
  extended by org.jwalk.out.Report
      extended by org.jwalk.out.Question
          extended by org.jwalk.out.Confirmation

public class Confirmation
extends Question

Confirmation is a kind of question to confirm or reject a test result. The content-part of a Confirmation is a pretty-printed TestSequence and its result, which may be correct or incorrect. The question-part of this Confirmation is an invitation to enter yes, no or quit. The contained TestSequence may also be accessed directly by client programs that wish to control how they display the content.

Version:
1.0
Author:
Anthony Simons

Field Summary
protected  TestSequence sequence
          The TestSequence whose outcome must be judged by the tester.
 
Fields inherited from class org.jwalk.out.Report
edition, walker
 
Constructor Summary
Confirmation(JWalker walker, TestSequence sequence)
          Creates a Confirmation asked by a JWalker about a TestSequence.
 
Method Summary
 java.lang.String getContent()
          Returns the content this Confirmation request as formatted text.
 java.lang.String getQuestion()
          Returns the query-part of this Confirmation request as formatted text.
 TestSequence getTestResult()
          Returns the TestSequence whose result is being confirmed.
 
Methods inherited from class org.jwalk.out.Question
toString
 
Methods inherited from class org.jwalk.out.Report
getEdition, getJWalker
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sequence

protected TestSequence sequence
The TestSequence whose outcome must be judged by the tester.

Constructor Detail

Confirmation

public Confirmation(JWalker walker,
                    TestSequence sequence)
Creates a Confirmation asked by a JWalker about a TestSequence.

Parameters:
walker - the JWalker that issued this Confirmation request.
sequence - the TestSequence to be confirmed or rejected.
Method Detail

getContent

public java.lang.String getContent()
Returns the content this Confirmation request as formatted text. Returns the pretty-printed form of the TestSequence.

Specified by:
getContent in class Report
Returns:
the formatted content of this Confirmation.

getQuestion

public java.lang.String getQuestion()
Returns the query-part of this Confirmation request as formatted text. Returns a standard query: "Confirm? (y|n|q): " that is issued after the content of this Confirmation.

Specified by:
getQuestion in class Question
Returns:
the query-prompt of the Question.

getTestResult

public TestSequence getTestResult()
Returns the TestSequence whose result is being confirmed. This allows client programs to choose how to display the TestSequence, rather than relying on the default pretty-printed style.