test: reset count1=0 in beforeClass

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1617625 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2014-08-12 23:36:45 +00:00
parent a644d9d073
commit 3aa3ae6073
1 changed files with 6 additions and 5 deletions

View File

@ -40,13 +40,14 @@ public class TestBooleanUnevenly extends LuceneTestCase {
public static final String field = "field";
private static Directory directory;
private static int count1 = 0;
private static int count1;
@BeforeClass
public static void beforeClass() throws Exception {
directory = newDirectory();
RandomIndexWriter w = new RandomIndexWriter(random(), directory, new MockAnalyzer(random()));
Document doc;
count1 = 0;
for (int i=0;i<2;i++) {
for (int j=0;j<2048;j++) {
doc = new Document();
@ -102,8 +103,8 @@ public class TestBooleanUnevenly extends LuceneTestCase {
ScoreDoc[] hits2 = tops2.scoreDocs;
int hitsNum2 = tops2.totalHits;
assertEquals(hitsNum1, count1);
assertEquals(hitsNum2, count1);
assertEquals(count1, hitsNum1);
assertEquals(count1, hitsNum2);
CheckHits.checkEqual(query, hits1, hits2);
}
@ -125,8 +126,8 @@ public class TestBooleanUnevenly extends LuceneTestCase {
ScoreDoc[] hits2 = tops2.scoreDocs;
int hitsNum2 = tops2.totalHits;
assertEquals(hitsNum1, count1);
assertEquals(hitsNum2, count1);
assertEquals(count1, hitsNum1);
assertEquals(count1, hitsNum2);
CheckHits.checkEqual(query, hits1, hits2);
}
}