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 intBLOC_CACHE_HITprotected static intBLOC_CACHE_SIZEprotected static intBLOC_SIZEprotected Map<String,String>blockCacheprotected DictionaryHolderdictionaryHolderprotected static intNB_LINES_PER_PARAGRAPHprotected static intNB_PAGE_PER_BLOCprotected static intNB_PARAGRAPH_PER_PAGEprotected static intNB_WORDS_PER_LINEprotected static intPAGE_CACHE_HITprotected static intPAGE_CACHE_SIZEprotected Map<String,String>pageCacheprotected static intPARAGRAPH_CACHE_HITprotected static intPARAGRAPH_CACHE_SIZEprotected Map<String,String>paragraphCacheprotected static RandomRANDOM
-
Constructor Summary
Constructors Constructor Description RandomTextGenerator(DictionaryHolder dictionary)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgenerateBloc()StringgeneratePage()StringgenerateParagraph()StringgetRandomBloc()StringgetRandomLine()StringgetRandomPage()StringgetRandomParagraph()StringgetRandomText()StringgetRandomText(int avSizeInK)StringgetRandomTitle(int nbWord)protected intgetTargetPageMaxSizeB()protected intgetTargetParagraphMaxSizeB()voidprefilCache()
-
-
-
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()
-
-