public class PrimitiveExpression extends AbstractStatement
| Modifier and Type | Class and Description |
|---|---|
static class |
PrimitiveExpression.Operator |
AbstractStatement.Executerassertions, comment, logger, retval, tc| Constructor and Description |
|---|
PrimitiveExpression(TestCase testCase,
VariableReference reference,
VariableReference leftOperand,
PrimitiveExpression.Operator operator,
VariableReference rightOperand)
Constructor for PrimitiveExpression.
|
| Modifier and Type | Method and Description |
|---|---|
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 |
copy(TestCase newTestCase,
int offset)
copy
|
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 |
getCode()
Create a string representing the statement as Java code
|
VariableReference |
getLeftOperand()
Getter for the field
leftOperand. |
PrimitiveExpression.Operator |
getOperator()
Getter for the field
operator. |
VariableReference |
getRightOperand()
Getter for the field
rightOperand. |
List<VariableReference> |
getUniqueVariableReferences()
getUniqueVariableReferences
|
Set<VariableReference> |
getVariableReferences()
getVariableReferences
|
boolean |
isAssignmentStatement()
Returns true if this statement should be handled as an
AssignmentStatement.
|
void |
replace(VariableReference oldVar,
VariableReference newVar)
Replace a VariableReference with another one
|
boolean |
same(Statement s)
Allows the comparing of Statements between TestCases.
|
String |
toString() |
addAssertion, addComment, clone, clone, copyAssertions, exceptionHandler, getAssertionCode, getAssertionReferences, getAssertions, getCode, getComment, getDeclaredExceptions, getExceptionClass, getNumParameters, getPosition, getReturnClass, getReturnType, getReturnValue, getTestCase, hasAssertions, isAccessible, isDeclaredException, isReflectionStatement, isValid, mutate, negate, references, removeAssertion, removeAssertions, setAssertions, setRetvalpublic PrimitiveExpression(TestCase testCase, VariableReference reference, VariableReference leftOperand, PrimitiveExpression.Operator operator, VariableReference rightOperand)
Constructor for PrimitiveExpression.
testCase - a TestCase object.reference - a VariableReference object.leftOperand - a VariableReference object.operator - a PrimitiveExpression.Operator
object.rightOperand - a VariableReference object.public void changeClassLoader(ClassLoader loader)
changeClassLoader in interface StatementchangeClassLoader in class AbstractStatementloader - a ClassLoader 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 GenericAccessibleObject<?> getAccessibleObject()
AccessibleObject object.public String getCode()
getCode in interface StatementgetCode in class AbstractStatementString object.public VariableReference getLeftOperand()
Getter for the field leftOperand.
VariableReference object.public PrimitiveExpression.Operator getOperator()
Getter for the field operator.
PrimitiveExpression.Operator
object.public VariableReference getRightOperand()
Getter for the field rightOperand.
VariableReference object.public List<VariableReference> getUniqueVariableReferences()
getUniqueVariableReferences
List object.public Set<VariableReference> getVariableReferences()
getVariableReferences
Set object.public boolean isAssignmentStatement()
public void replace(VariableReference oldVar, VariableReference newVar)
oldVar - The old variablenewVar - The new variablepublic boolean same(Statement s)
s - a Statement object.Copyright © 2010–2017 EvoSuite. All rights reserved.