-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathlucene43.test.patch
127 lines (119 loc) · 5.77 KB
/
lucene43.test.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
Index: lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
===================================================================
--- lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java (revision 1491585)
+++ lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java (working copy)
@@ -1271,7 +1271,8 @@
throw new AssertionError(e);
}
}
- IndexSearcher ret = random.nextBoolean() ? new AssertingIndexSearcher(random, r) : new AssertingIndexSearcher(random, r.getContext());
+ //IndexSearcher ret = random.nextBoolean() ? new AssertingIndexSearcher(random, r) : new AssertingIndexSearcher(random, r.getContext());
+ IndexSearcher ret = new IndexSearcher(r);
ret.setSimilarity(classEnvRule.similarity);
return ret;
} else {
@@ -1298,9 +1299,12 @@
}
});
}
+ /*
IndexSearcher ret = random.nextBoolean()
? new AssertingIndexSearcher(random, r, ex)
: new AssertingIndexSearcher(random, r.getContext(), ex);
+ */
+ IndexSearcher ret = new IndexSearcher(r, ex);
ret.setSimilarity(classEnvRule.similarity);
return ret;
}
Index: lucene/test-framework/src/java/org/apache/lucene/util/_TestUtil.java
===================================================================
--- lucene/test-framework/src/java/org/apache/lucene/util/_TestUtil.java (revision 1491585)
+++ lucene/test-framework/src/java/org/apache/lucene/util/_TestUtil.java (working copy)
@@ -851,13 +851,13 @@
public static void assertEquals(TopDocs expected, TopDocs actual) {
Assert.assertEquals("wrong total hits", expected.totalHits, actual.totalHits);
- Assert.assertEquals("wrong maxScore", expected.getMaxScore(), actual.getMaxScore(), 0.0);
+ Assert.assertEquals("wrong maxScore", expected.getMaxScore(), actual.getMaxScore(), 0.00001);
Assert.assertEquals("wrong hit count", expected.scoreDocs.length, actual.scoreDocs.length);
for(int hitIDX=0;hitIDX<expected.scoreDocs.length;hitIDX++) {
final ScoreDoc expectedSD = expected.scoreDocs[hitIDX];
final ScoreDoc actualSD = actual.scoreDocs[hitIDX];
Assert.assertEquals("wrong hit docID", expectedSD.doc, actualSD.doc);
- Assert.assertEquals("wrong hit score", expectedSD.score, actualSD.score, 0.0);
+ Assert.assertEquals("wrong hit score", expectedSD.score, actualSD.score, 0.00001);
if (expectedSD instanceof FieldDoc) {
Assert.assertTrue(actualSD instanceof FieldDoc);
Assert.assertArrayEquals("wrong sort field values",
Index: lucene/test-framework/src/java/org/apache/lucene/util/TestRuleSetupAndRestoreClassEnv.java
===================================================================
--- lucene/test-framework/src/java/org/apache/lucene/util/TestRuleSetupAndRestoreClassEnv.java (revision 1491585)
+++ lucene/test-framework/src/java/org/apache/lucene/util/TestRuleSetupAndRestoreClassEnv.java (working copy)
@@ -236,7 +236,8 @@
TimeZone randomTimeZone = randomTimeZone(random());
timeZone = testTimeZone.equals("random") ? randomTimeZone : TimeZone.getTimeZone(testTimeZone);
TimeZone.setDefault(timeZone);
- similarity = random().nextBoolean() ? new DefaultSimilarity() : new RandomSimilarityProvider(random());
+ //similarity = random().nextBoolean() ? new DefaultSimilarity() : new RandomSimilarityProvider(random());
+ similarity = new DefaultSimilarity();
// Check codec restrictions once at class level.
try {
Index: lucene/core/src/java/org/apache/lucene/search/IndexSearcher.java
===================================================================
--- lucene/core/src/java/org/apache/lucene/search/IndexSearcher.java (revision 1491585)
+++ lucene/core/src/java/org/apache/lucene/search/IndexSearcher.java (working copy)
@@ -266,7 +266,7 @@
*/
public TopDocs search(Query query, int n)
throws IOException {
- return search(query, null, n);
+ return NativeSearch.search(this, query, n);
}
Index: lucene/core/build.xml
===================================================================
--- lucene/core/build.xml (revision 1491585)
+++ lucene/core/build.xml (working copy)
@@ -24,9 +24,12 @@
<import file="../common-build.xml"/>
- <path id="classpath"/>
+ <path id="classpath">
+ <pathelement location="/home/mike/src/lucene-c-boost/dist/luceneCBoost-SNAPSHOT.jar"/>
+ </path>
<path id="test.classpath">
+ <pathelement location="/home/mike/src/lucene-c-boost/dist/luceneCBoost-SNAPSHOT.jar"/>
<pathelement location="${common.dir}/build/test-framework/classes/java"/>
<pathelement location="${common.dir}/build/codecs/classes/java"/>
<path refid="junit-path"/>
Index: lucene/core/go.cmd
===================================================================
--- lucene/core/go.cmd (revision 0)
+++ lucene/core/go.cmd (working copy)
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+set -e
+
+pushd /home/mike/src/lucene-c-boost
+
+python3 -u build.py
+
+popd
+
+export LD_LIBRARY_PATH=/home/mike/src/lucene-c-boost/dist
+
+ulimit -c 0
+
+ant test -Dtests.directory=NativeMMapDirectory -Dtests.codec=Lucene42 -Dtests.showSuccess=true
+
+# ant test -Dtestcase=TestExternalCodecs -Dtests.method=testPerFieldCodec -Dtests.seed=16FD845E16DC90D1 -Dtests.slow=true -Dtests.codec=Lucene42 -Dtests.directory=NativeMMapDirectory -Dtests.locale=en_US -Dtests.timezone=Mideast/Riyadh89 -Dtests.file.encoding=UTF-8
+
+# python -u /l/util/repeatLuceneTest.py -nightly -once -dir NativeMMapDirectory -codec Lucene42 -nolog TestExternalCodecs.testPerFieldCodec -seed 634F7D97FE1C86A2
Property changes on: lucene/core/go.cmd
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property