public abstract class IntExceptionGenerator extends java.lang.Object implements Generator<IntNumber,IntException>
IntExceptionGenerator
is a base interface for random generators targeted at the integer
arithmetic exceptions.Constructor and Description |
---|
IntExceptionGenerator() |
Modifier and Type | Method and Description |
---|---|
boolean |
check(IntException situation,
IntNumber[] operands)
Checks the test data against the test situation.
|
protected abstract boolean |
checkNormal(IntNumber[] operands)
Checks whether the operation does not cause exceptions.
|
protected abstract boolean |
checkOverflow(IntNumber[] operands)
Checks whether the operation causes the overflow exception.
|
GeneratorResult<IntNumber> |
generate(IntException situation,
IntNumber[] operands)
Generates test data for the given test situation.
|
protected abstract GeneratorResult<IntNumber> |
generateNormal(IntNumber[] operands)
Tries to generate operands that do not cause exceptions.
|
protected abstract GeneratorResult<IntNumber> |
generateOverflow(IntNumber[] operands)
Tries to generate operands that cause the overflow exception.
|
public final boolean check(IntException situation, IntNumber[] operands)
Generator
check
in interface Generator<IntNumber,IntException>
situation
- the test situation.operands
- the test data.true
if the test data correspond to the test situation;
false
otherwise.public final GeneratorResult<IntNumber> generate(IntException situation, IntNumber[] operands)
Generator
generate
in interface Generator<IntNumber,IntException>
situation
- the test situation.operands
- the test data having been fixed.protected abstract boolean checkNormal(IntNumber[] operands)
operands
- the operation operands.true
if the operation does not cause exceptions; false
otherwise.protected abstract GeneratorResult<IntNumber> generateNormal(IntNumber[] operands)
operands
- the operation operands (operand[i] == null
if the i-th operation
is not fixed; otherwise operand[i]
contains the operand value).protected abstract boolean checkOverflow(IntNumber[] operands)
operands
- the operation operands.true
if the operation causes the exception; false
otherwise.protected abstract GeneratorResult<IntNumber> generateOverflow(IntNumber[] operands)
operands
- the operation operands (operand[i] == null
if the i-th operation
is not fixed; otherwise operand[i]
contains the operand value).