|
JET | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.utep.cs.jet.rat.gen.ClassValueGenerator
public class ClassValueGenerator
A class to generate class values.
| Field Summary | |
|---|---|
protected Context |
context
The testing context. |
protected ValueFactory |
factory
Factory to create various types of values. |
protected List<Method> |
mutators
Mutators 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. |
protected Denotable[] |
generateArguments(Class<?>[] types,
int maxHeight)
Generates arguments of the given types. |
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. |
protected Denotable |
simpleMutate(Denotable value,
int maxHeight)
Mutates the given value by calling one of its mutator methods. |
| 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
protected List<Method> mutators
protected 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 ratemutated - True if the object has already been mutatedmaxHeight - Maximum height of the mutated object (viewed
as a tree)
protected Denotable simpleMutate(Denotable value,
int maxHeight)
value - Object to be mutatedmaxHeight - Maximum height of the mutated object (viewed
as a tree)protected Denotable createNullValue()
protected Denotable[] generateArguments(Class<?>[] types,
int maxHeight)
maxHeight - Maximum height of generated objects
(viewed as trees)
|
JET | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||