|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jwalk.gen.RedirectInGenerator
public class RedirectInGenerator
RedirectInGenerator is a custom generator that redirects standard input. If the test class has methods that expect the user to type in text, this can be inconvenient to enter multiple times. RedirectInGenerator redirects standard input System.in to refer to a text file called "input.txt", which the tester can fill with suitable data (whether numbers or text) for the test class's methods. If no pre-existing "input.txt" file can be found, RedirectInGenerator creates a sample file containing lines of text that contain integer digits and strings. This default file can be edited later to suit the desired kind of input. The input file is always placed in the same directory as the test class, so that different input files may be created for different classes.
Constructor Summary | |
---|---|
RedirectInGenerator()
Creates a RedirectInGenerator that redirects standard input. |
Method Summary | |
---|---|
boolean |
canCreate(java.lang.Class<?> type)
Reports whether this RedirectInGenerator can create values of the requested type. |
protected void |
finalize()
Secret method to reset standard input. |
java.lang.Object |
nextValue(java.lang.Class<?> type)
Creates the next quasi-unique value in sequence for a particular type. |
void |
setOwner(MasterGenerator generator)
Registers a MasterGenerator as the owner of this RedirectInGenerator. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RedirectInGenerator()
Method Detail |
---|
protected void finalize()
finalize
in class java.lang.Object
public void setOwner(MasterGenerator generator)
setOwner
in interface CustomGenerator
public boolean canCreate(java.lang.Class<?> type)
canCreate
in interface Generator
type
- the requested type.
public java.lang.Object nextValue(java.lang.Class<?> type) throws GeneratorException
nextValue
in interface Generator
type
- the requested type.
GeneratorException,
- since no value of this type could be
synthesised.
GeneratorException
- if no value of this type could be
synthesised.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |