Index: trunk/lucene-search-3/src/test/java/org/wikimedia/lsearch/index/WikiIndexModifierTest.java |
— | — | @@ -12,6 +12,7 @@ |
13 | 13 | import org.apache.lucene.analysis.TokenStream; |
14 | 14 | import org.apache.lucene.document.Document; |
15 | 15 | import org.apache.lucene.document.Field; |
| 16 | +import org.junit.Test; |
16 | 17 | import org.wikimedia.lsearch.analyzers.Analyzers; |
17 | 18 | import org.wikimedia.lsearch.analyzers.FieldBuilder; |
18 | 19 | import org.wikimedia.lsearch.beans.Article; |
— | — | @@ -27,6 +28,7 @@ |
28 | 29 | Analyzer analyzer = null; |
29 | 30 | Analyzer highlightAnalyzer = null; |
30 | 31 | |
| 32 | + @Test |
31 | 33 | public void testMakeDocuments(){ |
32 | 34 | IndexId iid = IndexId.get("enwiki"); |
33 | 35 | String text = "Some very [[simple]] text used for testing\n== Heading 1 ==\nParagraph\n[[Category:Category1]]"; |
— | — | @@ -72,6 +74,7 @@ |
73 | 75 | } |
74 | 76 | } |
75 | 77 | |
| 78 | + @Test |
76 | 79 | public void testMakeHighlightDocuments(){ |
77 | 80 | IndexId iid = IndexId.get("enwiki"); |
78 | 81 | String text = "Some very [[simple]] text used for testing\n== Heading 1 ==\nParagraph\n[[Category:Category1]]"; |
— | — | @@ -100,6 +103,7 @@ |
101 | 104 | } |
102 | 105 | } |
103 | 106 | |
| 107 | + @Test |
104 | 108 | public void testMakeTitleDocument(){ |
105 | 109 | IndexId iid = IndexId.get("en-titles"); |
106 | 110 | String text = "Some very simple text used for testing\n== Heading 1 ==\nParagraph\n[[Category:Category1]]"; |
— | — | @@ -140,6 +144,7 @@ |
141 | 145 | } |
142 | 146 | } |
143 | 147 | |
| 148 | + @Test |
144 | 149 | public void testSpellcheck(){ |
145 | 150 | IndexId iid = IndexId.get("enwiki"); |
146 | 151 | String text = "Some very [[simple]] text used for testing, used for testing of something\n== Heading 1 ==\nParagraph\n[[Category:Category1]]"; |
— | — | @@ -178,6 +183,7 @@ |
179 | 184 | } |
180 | 185 | } |
181 | 186 | |
| 187 | + |
182 | 188 | public String tokens(String field){ |
183 | 189 | try{ |
184 | 190 | Field f = doc.getField(field); |