Package randoop.condition.specification
Class ThrowsCondition
java.lang.Object
randoop.condition.specification.SpecificationClause
randoop.condition.specification.ThrowsCondition
A specification clause that an exception should be thrown.
The JSON serialization of this class is used to read the specifications for an operation given
using the --specifications
command-line option. The JSON should include a JSON object
labeled by the name of each field of this class, as in
{ "exception": "java.lang.IllegalStateException", "description": "throws IllegalStateException if the connection is already open", "guard": { "condition": "receiver.isOpen()", "description": "if the connection is already open" } }See
Guard
for details on specifying guards.-
Field Summary
Modifier and TypeFieldDescriptionprivate final @ClassGetName String
The fully-qualified binary name of the type of the expected exception. -
Constructor Summary
ModifierConstructorDescriptionprivate
Gson serialization requires a default constructor.ThrowsCondition
(String description, Guard guard, @ClassGetName String exceptionType) Creates aThrowsCondition
representing an exception expected when the guard is true. -
Method Summary
Modifier and TypeMethodDescriptionboolean
@ClassGetName String
Returns the exception type name for thisThrowsCondition
.int
hashCode()
toString()
Methods inherited from class randoop.condition.specification.SpecificationClause
getDescription, getGuard
-
Field Details
-
exceptionType
The fully-qualified binary name of the type of the expected exception.
-
-
Constructor Details
-
ThrowsCondition
private ThrowsCondition()Gson serialization requires a default constructor. -
ThrowsCondition
Creates aThrowsCondition
representing an exception expected when the guard is true.- Parameters:
description
- the description of the conditionguard
- the guard for the specificationexceptionType
- the expected exception type
-
-
Method Details
-
getExceptionTypeName
Returns the exception type name for thisThrowsCondition
.- Returns:
- the exception type name for this throws specification
-
equals
- Overrides:
equals
in classSpecificationClause
-
hashCode
public int hashCode()- Overrides:
hashCode
in classSpecificationClause
-
toString
-