public class NoExceptionCheck extends java.lang.Object implements Check
It is used in an error-revealing test to indicate that an exception that is considered to be an error (e.g., not "expected" or "invalid") was thrown by the statement during test generation. Only a comment is included when the test is output noting the occurrence of the exception during test generation, though the statement is expected to throw the method when the error-revealing test is run.
| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
exceptionName
The exception that the statement threw during generation.
|
private int |
statementIdx
Indicates which statement is expected to return normally.
|
| Constructor and Description |
|---|
NoExceptionCheck(int statementIdx,
java.lang.String exceptionName) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(@Nullable java.lang.Object o) |
int |
hashCode() |
java.lang.String |
toCodeStringPostStatement()
Returns the empty string: there is no code associated with this check (if an exception occurs,
it will be reported by JUnit).
|
java.lang.String |
toCodeStringPreStatement()
Returns a string of Java source code to be emitted before a statement containing this check.
|
private final int statementIdx
private java.lang.String exceptionName
NoExceptionCheck(int statementIdx,
java.lang.String exceptionName)
public boolean equals(@Nullable java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toCodeStringPostStatement()
toCodeStringPostStatement in interface Checkpublic java.lang.String toCodeStringPreStatement()
ChecktoCodeStringPreStatement in interface Check