public class BranchPool extends Object
| Constructor and Description |
|---|
BranchPool() |
| Modifier and Type | Method and Description |
|---|---|
void |
addBranchlessMethod(String className,
String methodName,
int lineNumber)
Gets called by the CFGMethodAdapter whenever it detects a method without
any branches.
|
void |
clear()
clear
|
void |
clear(String className)
clear
|
void |
clear(String className,
String methodName)
clear
|
int |
getActualBranchIdForNormalBranchInstruction(BytecodeInstruction ins)
getActualBranchIdForNormalBranchInstruction
|
Collection<Branch> |
getAllBranches() |
Branch |
getBranch(int branchId)
Returns the Branch object associated with the given branchID
|
int |
getBranchCounter()
Returns the number of currently known Branches
|
int |
getBranchCountForClass(String className)
Returns the number of known Branches for a given class
|
int |
getBranchCountForMemberClasses(String prefix)
Returns the number of known Branches for a given class
|
int |
getBranchCountForMethod(String className,
String methodName)
Returns the number of known Branches for a given methodName in a given
class.
|
int |
getBranchCountForPrefix(String prefix)
Returns the number of known Branches for a given class
|
Branch |
getBranchForInstruction(BytecodeInstruction instruction)
getBranchForInstruction
|
List<Branch> |
getBranchForLabel(org.objectweb.asm.tree.LabelNode label)
getBranchForLabel
|
Set<Integer> |
getBranchIdsForPrefix(String prefix)
Returns the number of known Branches for a given class
|
int |
getBranchlessMethodLineNumber(String className,
String methodName) |
Set<String> |
getBranchlessMethods()
Returns a set with all unique methodNames of methods without Branches.
|
Set<String> |
getBranchlessMethods(String className)
Returns a set with all unique methodNames of methods without Branches.
|
Set<String> |
getBranchlessMethodsMemberClasses(String className)
Returns a set with all unique methodNames of methods without Branches.
|
Set<String> |
getBranchlessMethodsPrefix(String className)
Returns a set with all unique methodNames of methods without Branches.
|
List<Branch> |
getCaseBranchesForSwitch(BytecodeInstruction instruction)
getCaseBranchesForSwitch
|
Branch |
getDefaultBranchForSwitch(BytecodeInstruction v)
getDefaultBranchForSwitch
|
static BranchPool |
getInstance(ClassLoader classLoader) |
int |
getNonArtificialBranchCountForMethod(String className,
String methodName) |
int |
getNumArtificialBranches() |
int |
getNumBranchlessMethods()
Returns the total number of methods without branches in the instrumented
classes
|
int |
getNumBranchlessMethods(String className)
Returns the number of methods without Branches for class className
|
int |
getNumBranchlessMethodsMemberClasses(String className)
Returns the number of methods without Branches for class className
|
int |
getNumBranchlessMethodsPrefix(String className)
Returns the number of methods without Branches for class className
|
boolean |
isBranchlessMethod(String className,
String methodName) |
boolean |
isKnownAsBranch(BytecodeInstruction instruction)
Checks whether the given instruction has Branch objects associated with
it.
|
boolean |
isKnownAsNormalBranchInstruction(BytecodeInstruction ins)
isKnownAsNormalBranchInstruction
|
boolean |
isKnownAsSwitchBranchInstruction(BytecodeInstruction instruction)
isKnownAsSwitchBranchInstruction
|
Set<String> |
knownClasses()
Returns a Set containing all classes for which this pool knows Branches
for as Strings
|
Set<String> |
knownMethods(String className)
Returns a Set containing all methods in the class represented by the
given String for which this pool knows Branches for as Strings
|
void |
registerAsBranch(BytecodeInstruction instruction)
Called by the BytecodeInstructionPool whenever it detects an instruction
that corresponds to a Branch in the class under test as defined by
BytecodeInstruction.isActualBranch().
|
void |
reset()
Reset all the data structures used to keep track of the branch
information
|
List<Branch> |
retrieveBranchesInMethod(String className,
String methodName)
Returns a List containing all Branches in the given class and method
Should no such Branch exist an empty List is returned
|
public static BranchPool getInstance(ClassLoader classLoader)
public void addBranchlessMethod(String className, String methodName, int lineNumber)
methodName - Unique methodName - consisting of className - a String object.public void registerAsBranch(BytecodeInstruction instruction)
instruction - a BytecodeInstruction object.public boolean isKnownAsBranch(BytecodeInstruction instruction)
instruction - a BytecodeInstruction object.public boolean isKnownAsNormalBranchInstruction(BytecodeInstruction ins)
isKnownAsNormalBranchInstruction
ins - a BytecodeInstruction object.public boolean isKnownAsSwitchBranchInstruction(BytecodeInstruction instruction)
isKnownAsSwitchBranchInstruction
instruction - a BytecodeInstruction object.public int getActualBranchIdForNormalBranchInstruction(BytecodeInstruction ins)
getActualBranchIdForNormalBranchInstruction
ins - a BytecodeInstruction object.public List<Branch> getCaseBranchesForSwitch(BytecodeInstruction instruction)
getCaseBranchesForSwitch
instruction - a BytecodeInstruction object.List object.public Branch getBranchForInstruction(BytecodeInstruction instruction)
getBranchForInstruction
instruction - a BytecodeInstruction object.Branch object.public List<Branch> getBranchForLabel(org.objectweb.asm.tree.LabelNode label)
getBranchForLabel
label - a LabelNode object.List object.public int getBranchCountForMethod(String className, String methodName)
public int getNonArtificialBranchCountForMethod(String className, String methodName)
public int getBranchCountForClass(String className)
className - a String object.public int getBranchCountForPrefix(String prefix)
prefix - a String object.public Set<Integer> getBranchIdsForPrefix(String prefix)
prefix - a String object.public int getBranchCountForMemberClasses(String prefix)
prefix - a String object.public int getBranchCounter()
public int getNumArtificialBranches()
public Branch getBranch(int branchId)
branchId - The ID of a branchpublic Collection<Branch> getAllBranches()
public Set<String> getBranchlessMethods(String className)
className - a String object.public Set<String> getBranchlessMethodsPrefix(String className)
className - a String object.public Set<String> getBranchlessMethodsMemberClasses(String className)
className - a String object.public int getBranchlessMethodLineNumber(String className, String methodName)
public Set<String> getBranchlessMethods()
public int getNumBranchlessMethods(String className)
className - a String object.public int getNumBranchlessMethodsPrefix(String className)
className - a String object.public int getNumBranchlessMethodsMemberClasses(String className)
className - a String object.public int getNumBranchlessMethods()
public Set<String> knownClasses()
Set object.public Set<String> knownMethods(String className)
public List<Branch> retrieveBranchesInMethod(String className, String methodName)
public Branch getDefaultBranchForSwitch(BytecodeInstruction v)
getDefaultBranchForSwitch
v - a BytecodeInstruction object.Branch object.public void reset()
public void clear()
clear
TODO: One of these two methods should goCopyright © 2010–2017 EvoSuite. All rights reserved.