|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectpl.kernelpanic.dbmonster.generator.BasicDataGenerator
pl.kernelpanic.dbmonster.generator.DictionaryGenerator
public class DictionaryGenerator
The dictionary generator uses external dictionary as the source of test data.
Dictionary is a flat text file. Each line in this file is a dictionary item. Items must be unique! A file may be compressed using ZIP or GZIP algorithm. The extension of the file (.txt, .zip, .gz) decides which compression method is used.
Dictionary files must be encoded in UTF-8.
| dictFile | Absolute or relative to the schema file path to the dictionary. |
| unique | boolean value which indicates whether generated value should be unique or random (default: false - random item is used). |
| Field Summary |
|---|
| Fields inherited from class pl.kernelpanic.dbmonster.generator.BasicDataGenerator |
|---|
column, nulls |
| Constructor Summary | |
|---|---|
DictionaryGenerator()
|
|
| Method Summary | |
|---|---|
Object |
generate()
Generates the value using a dictionary. |
String |
getDictFile()
Returns the dictionary name. |
boolean |
getUnique()
Returns the unique parameter. |
void |
initialize(DBMonsterContext ctx)
Initializes the generator. |
void |
reset()
Resets the generator. |
void |
setDictFile(String name)
Sets the dictionary name. |
void |
setUnique(boolean b)
Sets the unique parameter. |
| Methods inherited from class pl.kernelpanic.dbmonster.generator.BasicDataGenerator |
|---|
getColumn, getNulls, setColumn, setNulls |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DictionaryGenerator()
| Method Detail |
|---|
public void initialize(DBMonsterContext ctx)
throws Exception
initialize in interface Initializablectx - context
Exception - thrown when this generator cannot be initialized.
public Object generate()
throws Exception
generate in interface DataGeneratorException - if generattion failspublic void setDictFile(String name)
name - the name of the file.public String getDictFile()
public void setUnique(boolean b)
b - uniquepublic boolean getUnique()
true if generated value are unique,
false if generated value are random.public void reset()
reset in interface DataGenerator
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||