public class AssignmentStatement extends AbstractStatement
AbstractStatement.Executer| Modifier and Type | Field and Description |
|---|---|
protected VariableReference |
parameter |
assertions, comment, logger, retval, tc| Constructor and Description |
|---|
AssignmentStatement(TestCase tc,
VariableReference var,
VariableReference value)
Constructor for AssignmentStatement.
|
| Modifier and Type | Method and Description |
|---|---|
Statement |
copy(TestCase newTestCase,
int offset)
copy
|
boolean |
equals(Object obj)
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.
|
int |
getPosition()
getPosition
|
List<VariableReference> |
getUniqueVariableReferences()
getUniqueVariableReferences
|
VariableReference |
getValue()
getValue
|
Set<VariableReference> |
getVariableReferences()
getVariableReferences
|
int |
hashCode()
Generate hash code
|
boolean |
isAssignmentStatement()
Returns true if this statement should be handled as an
AssignmentStatement.
|
boolean |
isValid()
Various consistency checks.
|
boolean |
mutate(TestCase test,
TestFactory factory)
mutate
|
void |
replace(VariableReference var1,
VariableReference var2)
Replace a VariableReference with another one
|
boolean |
same(Statement s)
Allows the comparing of Statements between TestCases.
|
addAssertion, addComment, changeClassLoader, clone, clone, copyAssertions, exceptionHandler, getAssertionCode, getAssertionReferences, getAssertions, getCode, getCode, getComment, getDeclaredExceptions, getExceptionClass, getNumParameters, getReturnClass, getReturnType, getReturnValue, getTestCase, hasAssertions, isAccessible, isDeclaredException, isReflectionStatement, negate, references, removeAssertion, removeAssertions, setAssertions, setRetvalprotected VariableReference parameter
public AssignmentStatement(TestCase tc, VariableReference var, VariableReference value)
Constructor for AssignmentStatement.
tc - a TestCase object.var - a VariableReference object.value - a VariableReference object.public VariableReference getValue()
getValue
VariableReference object.public Statement copy(TestCase newTestCase, int offset)
copy
newTestCase - the testcase in which this statement will be insertedoffset - a int.Statement object.public 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.public Set<VariableReference> getVariableReferences()
getVariableReferences
Set object.public void replace(VariableReference var1, VariableReference var2)
var1 - The old variablevar2 - The new variablepublic int hashCode()
public boolean equals(Object obj)
public List<VariableReference> getUniqueVariableReferences()
getUniqueVariableReferences
List object.public boolean isValid()
isValid in interface StatementisValid in class AbstractStatementpublic boolean same(Statement s)
s - a Statement object.public boolean mutate(TestCase test, TestFactory factory)
mutate
mutate in interface Statementmutate in class AbstractStatementtest - a TestCase object.factory - a TestFactory object.public GenericAccessibleObject<?> getAccessibleObject()
AccessibleObject object.public boolean isAssignmentStatement()
public int getPosition()
AbstractStatementgetPosition
getPosition in interface StatementgetPosition in class AbstractStatementCopyright © 2010–2017 EvoSuite. All rights reserved.