public interface Statement
StatementInterface interface.
| Modifier and Type | Method and Description |
|---|---|
void |
addAssertion(Assertion assertion)
Add a new assertion to statement
|
void |
addComment(String comment)
A statement can have a textual comment that will be included
in the JUnit output
|
void |
changeClassLoader(ClassLoader loader)
Class instances are bound to a class loader - if we want to reexecute a
test on a different classloader we need to be able to change the class of
the reflection object
|
Statement |
clone()
Create deep copy of statement
|
Statement |
clone(TestCase newTestCase)
clone
|
Statement |
copy(TestCase newTestCase,
int offset)
copy
|
Set<Assertion> |
copyAssertions(TestCase newTestCase,
int offset)
copyAssertions
|
boolean |
equals(Object s)
Equality check
|
Throwable |
execute(Scope scope,
PrintStream out)
This method executes the statement under the given scope.
|
GenericAccessibleObject<?> |
getAccessibleObject()
Returns the accessibleObject which is used to generate this kind of
statement E.g.
|
String |
getAssertionCode()
Get Java code representation of assertions
|
Set<Assertion> |
getAssertions()
Return list of assertions
|
String |
getCode()
Create a string representing the statement as Java code
|
String |
getCode(Throwable exception)
Create a string representing the statement as Java code
|
String |
getComment()
Retrieve comment for this statement
|
Set<Class<?>> |
getDeclaredExceptions()
getDeclaredExceptions
|
int |
getNumParameters()
Retrieve the number of parameters of this statement
|
int |
getPosition()
getPosition
|
Class<?> |
getReturnClass()
getReturnClass
|
Type |
getReturnType()
getReturnType
|
VariableReference |
getReturnValue()
getReturnValue
|
TestCase |
getTestCase()
Retrieve the test case this statement is part of
|
List<VariableReference> |
getUniqueVariableReferences()
getUniqueVariableReferences
|
Set<VariableReference> |
getVariableReferences()
getVariableReferences
|
boolean |
hasAssertions()
Check if there are assertions
|
int |
hashCode()
Generate hash code
|
boolean |
isAccessible()
Determine if the underlying reflection object is currently accessible
|
boolean |
isAssignmentStatement()
Returns true if this statement should be handled as an
AssignmentStatement.
|
boolean |
isDeclaredException(Throwable t)
Tests if the throwable defined by t is declared to be thrown by the
underlying type.
|
boolean |
isReflectionStatement() |
boolean |
isValid()
Various consistency checks.
|
boolean |
mutate(TestCase test,
TestFactory factory)
mutate
|
boolean |
references(VariableReference var)
Check if the statement makes use of var
|
void |
removeAssertion(Assertion assertion)
Delete assertion attached to this statement
|
void |
removeAssertions()
Delete all assertions attached to this statement
|
void |
replace(VariableReference var1,
VariableReference var2)
Replace a VariableReference with another one
|
boolean |
same(Statement s)
Allows the comparing of Statements between TestCases.
|
void |
setAssertions(Set<Assertion> assertions)
Sets the set of assertions to statement
|
void |
setRetval(VariableReference newRetVal)
setRetval
|
void addAssertion(Assertion assertion)
assertion - Assertion to be addedvoid addComment(String comment)
comment - void changeClassLoader(ClassLoader loader)
loader - a ClassLoader object.Statement clone(TestCase newTestCase)
clone
newTestCase - the testcase in which this statement will be insertedStatement object.Statement copy(TestCase newTestCase, int offset)
copy
newTestCase - the testcase in which this statement will be insertedoffset - a int.Statement object.Set<Assertion> copyAssertions(TestCase newTestCase, int offset)
copyAssertions
newTestCase - the testcase in which this statement will be insertedoffset - a int.Set object.Throwable execute(Scope scope, PrintStream out) throws InvocationTargetException, IllegalArgumentException, IllegalAccessException, InstantiationException
scope - the scope under which the statement is executedout - a PrintStream object.InvocationTargetException - if any.IllegalArgumentException - if any.IllegalAccessException - if any.InstantiationException - if any.GenericAccessibleObject<?> getAccessibleObject()
AccessibleObject object.String getAssertionCode()
String getCode()
String object.String getComment()
Set<Class<?>> getDeclaredExceptions()
getDeclaredExceptions
Set object.int getNumParameters()
int getPosition()
getPosition
Class<?> getReturnClass()
getReturnClass
Type getReturnType()
getReturnType
VariableReference getReturnValue()
getReturnValue
TestCase getTestCase()
List<VariableReference> getUniqueVariableReferences()
getUniqueVariableReferences
List object.Set<VariableReference> getVariableReferences()
getVariableReferences
Set object.boolean hasAssertions()
boolean isAccessible()
boolean isAssignmentStatement()
boolean isReflectionStatement()
boolean isDeclaredException(Throwable t)
t - a Throwable object.boolean isValid()
boolean mutate(TestCase test, TestFactory factory)
mutate
test - a TestCase object.factory - a TestFactory object.boolean references(VariableReference var)
var - Variable we are checking forvoid removeAssertion(Assertion assertion)
assertion - a Assertion object.void removeAssertions()
void replace(VariableReference var1, VariableReference var2)
var1 - The old variablevar2 - The new variableboolean same(Statement s)
s - a Statement object.void setAssertions(Set<Assertion> assertions)
assertions - a Set object.void setRetval(VariableReference newRetVal)
setRetval
newRetVal - a VariableReference object.Copyright © 2010–2017 EvoSuite. All rights reserved.