LUCENE-5281: fix test bug

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1531714 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Shai Erera 2013-10-13 17:06:26 +00:00
parent a1d0068a93
commit 894813029f
1 changed files with 3 additions and 0 deletions

View File

@ -473,6 +473,9 @@ public class TestDirectoryTaxonomyReader extends FacetTestCase {
int numCategories = atLeast(10); int numCategories = atLeast(10);
int numA = 0, numB = 0; int numA = 0, numB = 0;
Random random = random(); Random random = random();
// add the two categories for which we'll also add children (so asserts are simpler)
taxoWriter.addCategory(new CategoryPath("a"));
taxoWriter.addCategory(new CategoryPath("b"));
for (int i = 0; i < numCategories; i++) { for (int i = 0; i < numCategories; i++) {
if (random.nextBoolean()) { if (random.nextBoolean()) {
taxoWriter.addCategory(new CategoryPath("a", Integer.toString(i))); taxoWriter.addCategory(new CategoryPath("a", Integer.toString(i)));