public interface VariableReference extends Comparable<VariableReference>, Serializable
| Modifier and Type | Method and Description |
|---|---|
void |
changeClassLoader(ClassLoader loader)
changeClassLoader
|
VariableReference |
clone()
Create a copy of the current variable
|
VariableReference |
clone(TestCase newTest)
Create a copy of the current variable for new test
|
int |
compareTo(VariableReference other) |
VariableReference |
copy(TestCase newTest,
int offset)
Create a copy of the current variable for new test
|
VariableReference |
getAdditionalVariableReference()
getAdditionalVariableReference
|
String |
getClassName()
Return class name
|
Class<?> |
getComponentClass()
Return raw class of this variable's component
|
String |
getComponentName()
getComponentName
|
Type |
getComponentType()
getComponentType
|
Object |
getDefaultValue()
getDefaultValue
|
String |
getDefaultValueString()
getDefaultValueString
|
int |
getDistance()
Distance metric used to select variables for mutation based on how close
they are to the SUT
|
GenericClass |
getGenericClass()
getGenericClass
|
String |
getName()
Return name for source code representation
|
Object |
getObject(Scope scope)
Return the actual object represented by this variable for a given scope
|
String |
getOriginalCode()
getOriginalCode
|
String |
getSimpleClassName()
Return simple class name
|
int |
getStPosition()
The position of the statement, defining this VariableReference, in the
testcase.
|
TestCase |
getTestCase()
getTestCase
|
Type |
getType()
Return type of this variable
|
Class<?> |
getVariableClass()
Return raw class of this variable
|
boolean |
isAccessible()
Return true if we can validly access this variable.
|
boolean |
isArray()
Return true if variable is an array
|
boolean |
isArrayIndex()
Return true if this is an index into an array variable
|
boolean |
isAssignableFrom(Type other)
Return true if other type can be assigned to this variable
|
boolean |
isAssignableFrom(VariableReference other)
Return true if other type can be assigned to this variable
|
boolean |
isAssignableTo(Type other)
Return true if this variable can by assigned to a variable of other type
|
boolean |
isAssignableTo(VariableReference other)
Return true if this variable can by assigned to a variable of other type
|
boolean |
isEnum()
Return true if variable is an enumeration
|
boolean |
isFieldReference()
Return true if this is a reference to a public field
|
boolean |
isPrimitive()
Return true if variable is a primitive type
|
boolean |
isString()
Return true if variable is a string
|
boolean |
isVoid()
Return true if variable is void
|
boolean |
isWrapperType()
Return true if type of variable is a primitive wrapper
|
void |
loadBytecode(org.objectweb.asm.commons.GeneratorAdapter mg,
Map<Integer,Integer> locals)
loadBytecode
|
void |
replaceAdditionalVariableReference(VariableReference var1,
VariableReference var2)
replaceAdditionalVariableReference
|
boolean |
same(VariableReference r)
same
|
void |
setAdditionalVariableReference(VariableReference var)
setAdditionalVariableReference
|
void |
setDistance(int distance)
Set the distance metric
|
void |
setObject(Scope scope,
Object value)
Set the actual object represented by this variable in a given scope
|
void |
setOriginalCode(String code)
Set the code fragment that defined this variable reference if imported
from an existing test case.
|
void |
setType(Type type)
Set type of this variable
|
void |
storeBytecode(org.objectweb.asm.commons.GeneratorAdapter mg,
Map<Integer,Integer> locals)
storeBytecode
|
String |
toString()
Return string representation of the variable
|
int getStPosition()
int getDistance()
void setDistance(int distance)
distance - a int.VariableReference clone()
VariableReference object.VariableReference clone(TestCase newTest)
newTest - a TestCase object.VariableReference object.VariableReference copy(TestCase newTest, int offset)
newTest - a TestCase object.offset - a int.VariableReference object.GenericClass getGenericClass()
getGenericClass
GenericClass object.boolean isEnum()
boolean isPrimitive()
boolean isVoid()
boolean isArray()
boolean isArrayIndex()
boolean isFieldReference()
boolean isString()
boolean isWrapperType()
boolean isAccessible()
boolean isAssignableFrom(Type other)
other - Right hand side of the assignmentboolean isAssignableTo(Type other)
other - Left hand side of the assignmentboolean isAssignableFrom(VariableReference other)
other - Right hand side of the assignmentboolean isAssignableTo(VariableReference other)
other - Left hand side of the assignmentClass<?> getVariableClass()
Class object.Class<?> getComponentClass()
Class object.Object getObject(Scope scope) throws CodeUnderTestException
scope - The scope of the test case executionObject object.CodeUnderTestException - if code from the class under test throws an exception. (E.g.
the static init of a field)String getOriginalCode()
getOriginalCode
void setObject(Scope scope, Object value) throws CodeUnderTestException
scope - The scope of the test case executionvalue - The value to be assignedCodeUnderTestException - if code from the class under test throws an exception. (E.g.
the static init of a field)void setOriginalCode(String code)
code - The code fragment that defined this variable reference.String toString()
VariableReference getAdditionalVariableReference()
getAdditionalVariableReference
VariableReference object.void setAdditionalVariableReference(VariableReference var)
setAdditionalVariableReference
var - a VariableReference object.void replaceAdditionalVariableReference(VariableReference var1, VariableReference var2)
replaceAdditionalVariableReference
var1 - a VariableReference object.var2 - a VariableReference object.void loadBytecode(org.objectweb.asm.commons.GeneratorAdapter mg,
Map<Integer,Integer> locals)
loadBytecode
mg - a GeneratorAdapter object.locals - a Map object.void storeBytecode(org.objectweb.asm.commons.GeneratorAdapter mg,
Map<Integer,Integer> locals)
storeBytecode
mg - a GeneratorAdapter object.locals - a Map object.void changeClassLoader(ClassLoader loader)
changeClassLoader
loader - a ClassLoader object.String getDefaultValueString()
getDefaultValueString
String object.int compareTo(VariableReference other)
compareTo in interface Comparable<VariableReference>boolean same(VariableReference r)
same
r - a VariableReference object.Copyright © 2010–2017 EvoSuite. All rights reserved.