 |
Synthia
Generic and flexible data structure generator
|
Go to the documentation of this file.
19 package ca.uqac.lif.synthia.test;
21 import java.io.PrintStream;
22 import java.util.ArrayList;
23 import java.util.List;
135 this(object, actions, decision,
null);
140 boolean error_found =
false;
142 for (
int try_counter = 0; try_counter <
s_maxTries; try_counter++)
144 println(
"Attempt " + try_counter);
147 for (
int i = 0; i < 100; i++)
170 boolean shrink_again =
false;
173 Exception last_ex =
null;
177 boolean success =
false;
230 protected void print(Object message)
234 m_out.print(message);
246 m_out.println(message);
Picker that records and returns the values produced by another picker.
Picker< Float > m_decision
A picker passed to the action picker for the shrinking process.
Monkey(Resettable object, Picker< Action > actions, Picker< Float > decision)
Creates a new instance of the monkey.
int m_bestThreshold
The length of the sequence under which the monkey is allowed to stop searching.
Miscellaneous pickers performing various functions.
Signals that an object can be put back into its initial state.
Performs monkey testing by interacting with a component.
boolean isDone()
Signals if the picker enumerates all values from a set.
void reset()
Puts the object back into its initial state.
Signals that a picker can shrink the sequence of values it has produced since its last reset.
Resettable m_object
The object on which the actions are applied.
Monkey(Resettable object, Picker< Action > actions, Picker< Float > decision, PrintStream ps)
Creates a new instance of the monkey.
Picker< Action > m_actionPicker
The picker producing the actions to be applied.
static void wait(float duration)
Waits for some time.
PrintStream m_out
A print stream where the monkey outputs status messages during its execution.
Picker that does not produce any value, but causes the thread to wait for a moment on every call to p...
Exception m_lastException
The exception thrown at the end of the "best" sequence of actions found by the monkey so far.
void doAction()
Performs an action on a component.
T pick()
Picks a value, records it and returns the value.
void clear()
Clears the values recorded so far.
List< Action > m_bestSequence
The "best" sequence of actions found by the monkey so far.
Interface signaling that an object can perform an "action".
SequenceShrinkable< T > shrink(Picker< Float > d, float magnitude)
Shrinks a picker.
List< Action > getShrunk()
void println(Object message)
Prints a message to the print stream.
List< T > getSequence()
Gets the sequence of values that the picker has produced so far.
static final int s_maxShrinkingPhases
The maximum number of shrinking phases the monkey will attempt.
void print(Object message)
Prints a message to the print stream.
List< T > getSequence()
Gets the sequence of values that the picker has produced so far.
Pickers related to the generation of a sequence of values.
static final int s_maxTries
The maximum number of attempts at producing a sequence in each shrinking phase.