|
JET | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.utep.cs.et.rat.gen.ClassValueGenerator
class ClassValueGenerator
A class to generate class values.
| Field Summary | |
|---|---|
private List<Constructor> |
constructors
Constructors of the class under test. |
protected Context |
context
The testing context. |
private ValueFactory |
factory
Factory to create various types of values. |
private ValueGenerator |
generator
Generator to generate various types of values randomly. |
private List<Method> |
mutators
Mutators of the class under test. |
private List<Method> |
staticConstructors
Static constructors of the class under test. |
protected Class |
type
The class of which a value is to be generated. |
| Constructor Summary | |
|---|---|
ClassValueGenerator(ValueFactory factory,
ValueGenerator generator)
Creates a generic class generator. |
|
| Method Summary | |
|---|---|
protected Denotable |
construct(int maxHeight)
Constructs and returns an instance of the target class. |
protected Denotable |
createNullValue()
Creates a null value. |
Denotable |
generate(Class type,
Context ctx,
int maxHeight)
Generates a value of the given class type under the given testing context. |
private Denotable[] |
generateArguments(Class[] types,
int maxHeight)
Generates arguments of the given types. |
private boolean |
isConstructor(Constructor c)
Returns true if the given constructor is a constructor that can be used to build an object dynamically. |
private boolean |
isMutator(Method m)
Returns true if the given method is a mutator. |
private boolean |
isStaticConstructor(Method m)
Returns true if the given method is a basic static constructor. |
protected Denotable |
mutate(Denotable value,
double rate,
boolean mutated,
int maxHeight)
Mutates the given value by calling a sequence of mutators. |
protected void |
reset(Class type,
Context ctx)
Reconfigures this object to be able to create an object of the given type in the given testing context. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Context context
protected Class type
private List<Method> staticConstructors
private List<Constructor> constructors
private List<Method> mutators
private final ValueGenerator generator
private final ValueFactory factory
| Constructor Detail |
|---|
public ClassValueGenerator(ValueFactory factory,
ValueGenerator generator)
| Method Detail |
|---|
public Denotable generate(Class type,
Context ctx,
int maxHeight)
maxHeight to prevent
an infinite or excessive recursion.
protected void reset(Class type,
Context ctx)
protected Denotable construct(int maxHeight)
protected Denotable mutate(Denotable value,
double rate,
boolean mutated,
int maxHeight)
value - Object to be mutatedrate - Mutation ratemutate - True if the object has already been mutatedmaxHeight - Maximum height of the mutated object (viewed
as a tree)protected Denotable createNullValue()
private Denotable[] generateArguments(Class[] types,
int maxHeight)
maxHeight - Maximum height of generated objects
(viewed as trees)private boolean isStaticConstructor(Method m)
private boolean isConstructor(Constructor c)
private boolean isMutator(Method m)
|
JET | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||