/lucene-3.6.0/lucene/test-framework/src/java/org/apache/lucene/analysis/ |
H A D | MockVariableLengthPayloadFilter.java | 27 * TokenFilter that adds random variable-length payloads. 33 private final Random random; field in class:MockVariableLengthPayloadFilter 37 public MockVariableLengthPayloadFilter(Random random, TokenStream in) { argument 39 this.random = random; 46 random.nextBytes(bytes); 47 payload.setData(bytes, 0, random.nextInt(MAXLENGTH));
|
H A D | MockFixedLengthPayloadFilter.java | 27 * TokenFilter that adds random fixed-length payloads. 31 private final Random random; field in class:MockFixedLengthPayloadFilter 35 public MockFixedLengthPayloadFilter(Random random, TokenStream in, int length) { argument 37 this.random = random; 45 random.nextBytes(bytes);
|
H A D | MockAnalyzer.java | 50 private final Random random; field in class:MockAnalyzer 58 * @param random Random for payloads behavior 64 public MockAnalyzer(Random random, int pattern, boolean lowerCase, CharArraySet filter, boolean enablePositionIncrements) { argument 65 this.random = random; 74 * MockAnalyzer(random, pattern, lowerCase, CharArraySet.EMPTY_STOPSET, false}). 76 public MockAnalyzer(Random random, int pattern, boolean lowerCase) { argument 77 this(random, pattern, lowerCase, CharArraySet.EMPTY_SET, false); 84 * MockAnalyzer(random, MockTokenizer.WHITESPACE, true)}. 86 public MockAnalyzer(Random random) { argument [all...] |
H A D | MockReaderWrapper.java | 26 /** Wraps a Reader, and can throw random or fixed 32 private final Random random; field in class:MockReaderWrapper 38 public MockReaderWrapper(Random random, Reader in) { argument 40 this.random = random; 71 realLen = _TestUtil.nextInt(random, 1, len);
|
/lucene-3.6.0/lucene/backwards/src/test-framework/java/org/apache/lucene/analysis/ |
H A D | MockVariableLengthPayloadFilter.java | 30 private final Random random; field in class:MockVariableLengthPayloadFilter 34 public MockVariableLengthPayloadFilter(Random random, TokenStream in) { argument 36 this.random = random; 43 random.nextBytes(bytes); 44 payload.setData(bytes, 0, random.nextInt(MAXLENGTH));
|
H A D | MockFixedLengthPayloadFilter.java | 28 private final Random random; field in class:MockFixedLengthPayloadFilter 32 public MockFixedLengthPayloadFilter(Random random, TokenStream in, int length) { argument 34 this.random = random; 42 random.nextBytes(bytes);
|
H A D | MockAnalyzer.java | 50 private final Random random; field in class:MockAnalyzer 57 * @param random Random for payloads behavior 63 public MockAnalyzer(Random random, int pattern, boolean lowerCase, CharArraySet filter, boolean enablePositionIncrements) { argument 64 this.random = random; 73 * MockAnalyzer(random, pattern, lowerCase, CharArraySet.EMPTY_STOPSET, false}). 75 public MockAnalyzer(Random random, int pattern, boolean lowerCase) { argument 76 this(random, pattern, lowerCase, CharArraySet.EMPTY_SET, false); 83 * MockAnalyzer(random, MockTokenizer.WHITESPACE, true)}. 85 public MockAnalyzer(Random random) { argument [all...] |
/lucene-3.6.0/lucene/core/src/test/org/apache/lucene/util/ |
H A D | TestRollingCharBuffer.java | 30 final int stringLen = random.nextBoolean() ? random.nextInt(50) : random.nextInt(20000); 35 s = _TestUtil.randomUnicodeString(random, stringLen); 47 if (availCount == 0 || random.nextBoolean()) { 55 } else if (random.nextBoolean()) { 57 int pos = _TestUtil.nextInt(random, nextRead-availCount, nextRead-1); 68 length = _TestUtil.nextInt(random, 1, availCount); 74 start = nextRead - availCount + random.nextInt(availCount-length); 83 if (availCount > 0 && random [all...] |
H A D | TestPagedBytes.java | 31 final int blockBits = _TestUtil.nextInt(random, 1, 20); 35 final int numBytes = random.nextInt(10000000); 38 random.nextBytes(answer); 41 if (random.nextInt(10) == 7) { 44 int chunk = Math.min(random.nextInt(1000), numBytes - written); 50 final PagedBytes.Reader reader = p.freeze(random.nextBoolean()); 57 if (random.nextInt(10) == 7) { 60 int chunk = Math.min(random.nextInt(1000), numBytes - read); 69 final int pos = random.nextInt(numBytes-1); 70 final int len = random [all...] |
/lucene-3.6.0/lucene/backwards/src/test/org/apache/lucene/analysis/ |
H A D | TestMockAnalyzer.java | 26 Analyzer a = new MockAnalyzer(random); 37 Analyzer a = new MockAnalyzer(random, MockTokenizer.SIMPLE, true); 48 Analyzer a = new MockAnalyzer(random, MockTokenizer.KEYWORD, false); 59 Analyzer a = new MockAnalyzer(random, MockTokenizer.SIMPLE, true, (CharArraySet) StopAnalyzer.ENGLISH_STOP_WORDS_SET, true); 65 a = new MockAnalyzer(random, MockTokenizer.SIMPLE, true, (CharArraySet) StopAnalyzer.ENGLISH_STOP_WORDS_SET, false); 74 Analyzer analyzer = new MockAnalyzer(random); 86 /** blast some random strings through the analyzer */ 88 checkRandomData(random, new MockAnalyzer(random), atLeast(1000));
|
/lucene-3.6.0/lucene/backwards/src/test/org/apache/lucene/util/ |
H A D | TestPagedBytes.java | 29 final PagedBytes p = new PagedBytes(_TestUtil.nextInt(random, 1, 20)); 31 final int numBytes = random.nextInt(10000000); 34 random.nextBytes(answer); 37 if (random.nextInt(10) == 7) { 40 int chunk = Math.min(random.nextInt(1000), numBytes - written); 46 p.freeze(random.nextBoolean()); 53 if (random.nextInt(10) == 7) { 56 int chunk = Math.min(random.nextInt(1000), numBytes - read);
|
/lucene-3.6.0/lucene/core/src/test/org/apache/lucene/analysis/ |
H A D | TestMockAnalyzer.java | 28 Analyzer a = new MockAnalyzer(random); 39 Analyzer a = new MockAnalyzer(random, MockTokenizer.SIMPLE, true); 50 Analyzer a = new MockAnalyzer(random, MockTokenizer.KEYWORD, false); 61 Analyzer a = new MockAnalyzer(random, MockTokenizer.SIMPLE, true, (CharArraySet) StopAnalyzer.ENGLISH_STOP_WORDS_SET, true); 67 a = new MockAnalyzer(random, MockTokenizer.SIMPLE, true, (CharArraySet) StopAnalyzer.ENGLISH_STOP_WORDS_SET, false); 76 Analyzer analyzer = new MockAnalyzer(random); 88 /** blast some random strings through the analyzer */ 90 checkRandomData(random, new MockAnalyzer(random), atLeast(1000)); 96 String s = _TestUtil.randomHtmlishString(random, 2 [all...] |
/lucene-3.6.0/lucene/contrib/facet/src/java/org/apache/lucene/facet/search/sampling/ |
H A D | RandomSampler.java | 28 * Simple random sampler 32 private final Random random; field in class:RandomSampler 36 this.random = new Random(); 39 public RandomSampler(SamplingParams params, Random random) throws IllegalArgumentException { argument 41 this.random = random; 51 // select sample docs with random skipStep, make sure to leave sufficient #docs for selection after last skip 53 int skipStep = 1 + random.nextInt(maxStep);
|
/lucene-3.6.0/lucene/test-framework/src/java/org/apache/lucene/index/ |
H A D | MockRandomMergePolicy.java | 30 * MergePolicy that makes random decisions for testing. 33 private final Random random; field in class:MockRandomMergePolicy 35 public MockRandomMergePolicy(Random random) { argument 36 // fork a private random, since we are called 38 this.random = new Random(random.nextLong()); 46 if (segmentInfos.size() > 1 && random.nextInt(5) == 3) { 49 Collections.shuffle(segments, random); 53 final int segsToMerge = _TestUtil.nextInt(random, 1, segmentInfos.size()); 78 Collections.shuffle(eligibleSegments, random); [all...] |
/lucene-3.6.0/lucene/backwards/src/test-framework/java/org/apache/lucene/index/ |
H A D | MockRandomMergePolicy.java | 30 private final Random random; field in class:MockRandomMergePolicy 32 public MockRandomMergePolicy(Random random) { argument 33 // fork a private random, since we are called 35 this.random = new Random(random.nextLong()); 43 if (segmentInfos.size() > 1 && random.nextInt(5) == 3) { 46 Collections.shuffle(segments, random); 50 final int segsToMerge = _TestUtil.nextInt(random, 1, segmentInfos.size()); 75 Collections.shuffle(eligibleSegments, random); 79 int inc = max <= 2 ? max : _TestUtil.nextInt(random, [all...] |
/lucene-3.6.0/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/ |
H A D | TestThreaded.java | 73 assertQ(req("id:"+ new String[]{"1","2","3","4"}[random.nextInt(4)]), 84 Collections.shuffle(shuffle, random); 90 runFullImport(getCachedConfig(random.nextBoolean(), random.nextBoolean(), 0)); 95 runFullImport(getCachedConfig(random.nextBoolean(), random.nextBoolean(), 1)); 100 int numThreads = random.nextInt(8) + 2; // between 2 and 10 101 String config = getCachedConfig(random.nextBoolean(), random.nextBoolean(), numThreads);
|
/lucene-3.6.0/lucene/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/ |
H A D | RandomFacetSource.java | 28 * Simple implementation of a random facet source 41 Random random; field in class:RandomFacetSource 54 int numFacets = 1 + random.nextInt(maxDocFacets-1); // at least one facet to each doc 57 int depth = 1 + random.nextInt(maxFacetDepth-1); // depth 0 is not useful 59 cp.add(Integer.toString(random.nextInt(maxValue))); 76 random = new Random(config.get("rand.seed", 13));
|
/lucene-3.6.0/lucene/contrib/analyzers/kuromoji/src/test/org/apache/lucene/analysis/ja/ |
H A D | TestJapaneseAnalyzer.java | 124 * blast random strings against the analyzer 130 checkRandomData(random, a, atLeast(10000)); 133 /** blast some random large strings through the analyzer */ 138 checkRandomData(random, a, 200*RANDOM_MULTIPLIER, 8192); 164 checkAnalysisConsistency(random, a, random.nextBoolean(), s); 174 checkAnalysisConsistency(random, a, random.nextBoolean(), s); 184 checkAnalysisConsistency(random, a, random [all...] |
/lucene-3.6.0/lucene/contrib/spellchecker/src/test/org/apache/lucene/search/suggest/fst/ |
H A D | FSTCompletionTest.java | 74 assertMatchEquals(completion.lookup(_TestUtil.stringToCharSequence("two", random), 1), 79 assertMatchEquals(completion.lookup(_TestUtil.stringToCharSequence("one", random), 2), 86 assertMatchEquals(completion.lookup(_TestUtil.stringToCharSequence("four", random), 4), 95 assertMatchEquals(completion.lookup(_TestUtil.stringToCharSequence("one", random), 2), 100 assertMatchEquals(completion.lookup(_TestUtil.stringToCharSequence("four", random), 2), 105 assertMatchEquals(completion.lookup(_TestUtil.stringToCharSequence("four", random), 4), 112 assertMatchEquals(completionAlphabetical.lookup(_TestUtil.stringToCharSequence("one", random), 2), 118 assertMatchEquals(noPromotion.lookup(_TestUtil.stringToCharSequence("one", random), 2), 123 assertMatchEquals(completionAlphabetical.lookup(_TestUtil.stringToCharSequence("one", random), 2), 129 assertMatchEquals(completion.lookup(_TestUtil.stringToCharSequence("xyz", random), [all...] |
/lucene-3.6.0/lucene/core/src/test/org/apache/lucene/index/ |
H A D | TestPayloadProcessorProvider.java | 123 private IndexWriterConfig getConfig(Random random) { argument 124 return newIndexWriterConfig(random, TEST_VERSION_CURRENT, new WhitespaceAnalyzer( 128 private void populateDirs(Random random, Directory[] dirs, boolean multipleCommits) argument 132 populateDocs(random, dirs[i], multipleCommits); 138 private void populateDocs(Random random, Directory dir, boolean multipleCommits) argument 142 newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random, MockTokenizer.WHITESPACE, false)). 183 private void doTest(Random random, boolean addToEmptyIndex, argument 186 populateDirs(random, dirs, multipleCommits); 190 populateDocs(random, dir, multipleCommits); 201 IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random, MockTokenize [all...] |
H A D | TestLongPostings.java | 38 // Produces a realistic unicode random string that 41 Analyzer a = new MockAnalyzer(random); 43 String s = _TestUtil.randomRealisticUnicodeString(random); 66 Directory dir = newFSDirectory(_TestUtil.getTempDir("longpostings" + "." + random.nextLong())); 91 if (random.nextBoolean()) { 98 final IndexWriterConfig iwc = newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random)) 101 iwc.setRAMBufferSizeMB(16.0 + 16.0 * random.nextDouble()); 103 final RandomIndexWriter riw = new RandomIndexWriter(random, dir, iwc); 109 final int count = _TestUtil.nextInt(random, 1, 4); 150 if (random [all...] |
/lucene-3.6.0/lucene/core/src/test/org/apache/lucene/search/ |
H A D | BaseTestRangeFilter.java | 44 * one which can't have negative random integers, for testing collated ranges, 45 * and the other which can have negative random integers, for all other tests. 53 TestIndex(Random random, int minR, int maxR, boolean allowNegativeRandomInts) { argument 58 index = newDirectory(random); 97 signedIndexDir = new TestIndex(random, Integer.MAX_VALUE, Integer.MIN_VALUE, true); 98 unsignedIndexDir = new TestIndex(random, Integer.MAX_VALUE, 0, false); 99 signedIndexReader = build(random, signedIndexDir); 100 unsignedIndexReader = build(random, unsignedIndexDir); 115 private static IndexReader build(Random random, TestIndex index) throws IOException { argument 119 Field idField = newField(random, "i [all...] |
H A D | TestMultiValuedNumericRangeQuery.java | 43 RandomIndexWriter writer = new RandomIndexWriter(random, directory, 44 newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random)) 45 .setMaxBufferedDocs(_TestUtil.nextInt(random, 50, 1000))); 52 for (int m=0, c=random.nextInt(10); m<=c; m++) { 53 int value = random.nextInt(Integer.MAX_VALUE); 65 int lower=random.nextInt(Integer.MAX_VALUE); 66 int upper=random.nextInt(Integer.MAX_VALUE);
|
/lucene-3.6.0/lucene/backwards/src/test/org/apache/lucene/index/ |
H A D | TestPayloadProcessorProvider.java | 123 private IndexWriterConfig getConfig(Random random) { argument 124 return newIndexWriterConfig(random, TEST_VERSION_CURRENT, new WhitespaceAnalyzer( 128 private void populateDirs(Random random, Directory[] dirs, boolean multipleCommits) argument 132 populateDocs(random, dirs[i], multipleCommits); 138 private void populateDocs(Random random, Directory dir, boolean multipleCommits) argument 142 newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random, MockTokenizer.WHITESPACE, false)). 183 private void doTest(Random random, boolean addToEmptyIndex, argument 186 populateDirs(random, dirs, multipleCommits); 190 populateDocs(random, dir, multipleCommits); 201 IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random, MockTokenize [all...] |
/lucene-3.6.0/lucene/backwards/src/test/org/apache/lucene/search/ |
H A D | BaseTestRangeFilter.java | 44 * one which can't have negative random integers, for testing collated ranges, 45 * and the other which can have negative random integers, for all other tests. 53 TestIndex(Random random, int minR, int maxR, boolean allowNegativeRandomInts) { argument 58 index = newDirectory(random); 97 signedIndexDir = new TestIndex(random, Integer.MAX_VALUE, Integer.MIN_VALUE, true); 98 unsignedIndexDir = new TestIndex(random, Integer.MAX_VALUE, 0, false); 99 signedIndexReader = build(random, signedIndexDir); 100 unsignedIndexReader = build(random, unsignedIndexDir); 115 private static IndexReader build(Random random, TestIndex index) throws IOException { argument 119 Field idField = newField(random, "i [all...] |