org.jwalk.out
Class Notification

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

public class Notification
extends Question

Notification is a kind of acknowledged interaction with the tester. The content-part of a Notification is a pretty-printed notice to the human tester. This could be to report that an oracle file was written, or that the test series was abandoned, or that it ran out of memory. The question-part of this Notification is an invitation to acknowledge the notification by entering OK. A notification is flagged with different levels of urgency.

Version:
1.0
Author:
Anthony Simons

Field Summary
 
Fields inherited from class org.jwalk.out.Report
edition, walker
 
Constructor Summary
Notification(JWalker walker)
          Creates a silent Notification, sent by a JWalker as a signal.
Notification(JWalker walker, JWalkException exception)
          Creates a Notification, wrapping up an exception raised by a JWalker.
Notification(JWalker walker, java.lang.String content, Urgency urgency)
          Creates a Notification, containing information, with a given urgency.
 
Method Summary
 java.lang.String getContent()
          Returns the textual information content of this Notification.
 JWalkException getException()
          Returns the exception object wrapped by this Notification.
 java.lang.String getQuestion()
          Returns the query-part of this Notification request as formatted text.
 Urgency getUrgency()
          Reports how severe this notification is.
 
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
 

Constructor Detail

Notification

public Notification(JWalker walker,
                    java.lang.String content,
                    Urgency urgency)
Creates a Notification, containing information, with a given urgency. The content can be any message that requires acknowledgement from the user. The Urgency is an enumerated value from: {SILENT, NOTICE, WARNING} representing the degree of seriousness.

Parameters:
walker - the JWalker that issued this Notification request.
content - the content of this Notification.
urgency - the seriousness of this Notification.

Notification

public Notification(JWalker walker,
                    JWalkException exception)
Creates a Notification, wrapping up an exception raised by a JWalker. The urgency of this notification is always of the highest ERROR level.

Parameters:
walker - the JWalker that issued this Notification request.
exception - the exception raised by the JWalker.

Notification

public Notification(JWalker walker)
Creates a silent Notification, sent by a JWalker as a signal. The urgency of this notification is always of the lowest SILENT level. This is the conventional way that a JWalker signals termination, when it is run in a separate Thread from the user interface.

Parameters:
walker - the JWalker that issued this Notification request.
Method Detail

getQuestion

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

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

getContent

public java.lang.String getContent()
Returns the textual information content of this Notification. Returns the pretty-printed form of the content.

Specified by:
getContent in class Report
Returns:
the textual content of this Notification.

getException

public JWalkException getException()
Returns the exception object wrapped by this Notification.

Returns:
the exception wrapped by this Notification.

getUrgency

public Urgency getUrgency()
Reports how severe this notification is. This is a value from: {SILENT, NOTICE, WARNING, ERROR}, indicating the urgency of the notification. This should affect what kind of dialog is held with the user.

Returns:
the urgency of this Notification.