Class RandomTextGenerator
- java.lang.Object
-
- org.nuxeo.ecm.platform.importer.random.RandomTextGenerator
-
public class RandomTextGenerator extends Object
Random text generator to be used for load testing- Author:
- Thierry Delprat
-
-
Field Summary
Fields Modifier and Type Field Description protected static int
BLOC_CACHE_HIT
protected static int
BLOC_CACHE_SIZE
protected static int
BLOC_SIZE
protected Map<String,String>
blockCache
protected DictionaryHolder
dictionaryHolder
protected static int
NB_LINES_PER_PARAGRAPH
protected static int
NB_PAGE_PER_BLOC
protected static int
NB_PARAGRAPH_PER_PAGE
protected static int
NB_WORDS_PER_LINE
protected static int
PAGE_CACHE_HIT
protected static int
PAGE_CACHE_SIZE
protected Map<String,String>
pageCache
protected static int
PARAGRAPH_CACHE_HIT
protected static int
PARAGRAPH_CACHE_SIZE
protected Map<String,String>
paragraphCache
protected static Random
RANDOM
-
Constructor Summary
Constructors Constructor Description RandomTextGenerator(DictionaryHolder dictionary)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
generateBloc()
String
generatePage()
String
generateParagraph()
String
getRandomBloc()
String
getRandomLine()
String
getRandomPage()
String
getRandomParagraph()
String
getRandomText()
String
getRandomText(int avSizeInK)
String
getRandomTitle(int nbWord)
protected int
getTargetPageMaxSizeB()
protected int
getTargetParagraphMaxSizeB()
void
prefilCache()
-
-
-
Field Detail
-
dictionaryHolder
protected DictionaryHolder dictionaryHolder
-
PARAGRAPH_CACHE_SIZE
protected static final int PARAGRAPH_CACHE_SIZE
- See Also:
- Constant Field Values
-
PARAGRAPH_CACHE_HIT
protected static final int PARAGRAPH_CACHE_HIT
- See Also:
- Constant Field Values
-
PAGE_CACHE_SIZE
protected static final int PAGE_CACHE_SIZE
- See Also:
- Constant Field Values
-
PAGE_CACHE_HIT
protected static final int PAGE_CACHE_HIT
- See Also:
- Constant Field Values
-
BLOC_CACHE_SIZE
protected static final int BLOC_CACHE_SIZE
- See Also:
- Constant Field Values
-
BLOC_CACHE_HIT
protected static final int BLOC_CACHE_HIT
- See Also:
- Constant Field Values
-
BLOC_SIZE
protected static final int BLOC_SIZE
- See Also:
- Constant Field Values
-
NB_WORDS_PER_LINE
protected static final int NB_WORDS_PER_LINE
- See Also:
- Constant Field Values
-
NB_LINES_PER_PARAGRAPH
protected static final int NB_LINES_PER_PARAGRAPH
- See Also:
- Constant Field Values
-
NB_PARAGRAPH_PER_PAGE
protected static final int NB_PARAGRAPH_PER_PAGE
- See Also:
- Constant Field Values
-
NB_PAGE_PER_BLOC
protected static final int NB_PAGE_PER_BLOC
- See Also:
- Constant Field Values
-
RANDOM
protected static final Random RANDOM
-
-
Constructor Detail
-
RandomTextGenerator
public RandomTextGenerator(DictionaryHolder dictionary)
-
-
Method Detail
-
getTargetPageMaxSizeB
protected int getTargetPageMaxSizeB()
-
getTargetParagraphMaxSizeB
protected int getTargetParagraphMaxSizeB()
-
getRandomTitle
public String getRandomTitle(int nbWord)
-
getRandomLine
public String getRandomLine()
-
generateParagraph
public String generateParagraph()
-
prefilCache
public void prefilCache()
-
getRandomParagraph
public String getRandomParagraph()
-
generatePage
public String generatePage()
-
getRandomPage
public String getRandomPage()
-
generateBloc
public String generateBloc()
-
getRandomBloc
public String getRandomBloc()
-
getRandomText
public String getRandomText(int avSizeInK)
-
getRandomText
public String getRandomText()
-
-