Package de.hsh.graja.modules.junit.api
Class CommentAssertionError
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Error
-
- java.lang.AssertionError
-
- de.hsh.graja.modules.junit.api.CommentAssertionError
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
DiffHelper.DiffAssertionError
public class CommentAssertionError extends AssertionError
An instance of this class can be used to fail a JUnit test together with some formatted comments instead of a simple plain text message. The JUnit module runner will catch the comments and output them as an error message.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CommentAssertionError()
Initialize with an empty list of commentsCommentAssertionError(Content singleComment)
Initialize with a first commentCommentAssertionError(Content firstComment, Content secondComment)
Initialize with two initial comments, that can be extended by calling#addComment(Comment)
.CommentAssertionError(Content firstComment, Content secondComment, Throwable cause)
Initialize with two initial comments, that can be extended by calling#addComment(Comment)
.CommentAssertionError(Content singleComment, Throwable cause)
Initialize with a first commentCommentAssertionError(Throwable cause)
Initialize with an empty list of commentsCommentAssertionError(Collection<Content> comments)
Initialize with a first set of commentsCommentAssertionError(Collection<Content> comments, Throwable cause)
Initialize with a first set of comments
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addComment(Content comment)
Adds a commentList<Content>
getComments()
Double
getTestScore()
void
prependComment(Content comment)
Adds a comment to the top of the listvoid
setTestScore(Double s)
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
CommentAssertionError
public CommentAssertionError()
Initialize with an empty list of comments
-
CommentAssertionError
public CommentAssertionError(Throwable cause)
Initialize with an empty list of comments- Parameters:
cause
- causing exception
-
CommentAssertionError
public CommentAssertionError(Content singleComment)
Initialize with a first comment- Parameters:
singleComment
- a first comment
-
CommentAssertionError
public CommentAssertionError(Content singleComment, Throwable cause)
Initialize with a first comment- Parameters:
singleComment
- a first commentcause
- causing exception
-
CommentAssertionError
public CommentAssertionError(Content firstComment, Content secondComment)
Initialize with two initial comments, that can be extended by calling#addComment(Comment)
.- Parameters:
firstComment
- a first commentsecondComment
- a second comment
-
CommentAssertionError
public CommentAssertionError(Content firstComment, Content secondComment, Throwable cause)
Initialize with two initial comments, that can be extended by calling#addComment(Comment)
.- Parameters:
firstComment
- a first commentsecondComment
- a second commentcause
- causing exception
-
CommentAssertionError
public CommentAssertionError(Collection<Content> comments)
Initialize with a first set of comments- Parameters:
comments
- a first set of comments
-
CommentAssertionError
public CommentAssertionError(Collection<Content> comments, Throwable cause)
Initialize with a first set of comments- Parameters:
comments
- a first set of commentscause
- causing exception
-
-
Method Detail
-
addComment
public void addComment(Content comment)
Adds a comment- Parameters:
comment
- a new comment
-
prependComment
public void prependComment(Content comment)
Adds a comment to the top of the list- Parameters:
comment
- a new comment
-
setTestScore
public void setTestScore(Double s)
-
getTestScore
public Double getTestScore()
-
-