24
24
25
25
package org .opengrok .indexer .search ;
26
26
27
+ import static org .junit .Assert .assertEquals ;
28
+ import static org .junit .Assert .assertFalse ;
29
+ import static org .junit .Assert .assertNull ;
30
+ import static org .junit .Assert .assertTrue ;
31
+ import static org .junit .Assert .fail ;
32
+
27
33
import java .io .File ;
34
+ import java .util .ArrayList ;
28
35
import java .util .Collections ;
36
+ import java .util .List ;
29
37
import java .util .TreeSet ;
30
- import org .junit .After ;
31
38
import org .junit .AfterClass ;
32
- import org .junit .Before ;
33
39
import org .junit .BeforeClass ;
40
+ import org .junit .Ignore ;
34
41
import org .junit .Test ;
35
42
import org .opengrok .indexer .configuration .RuntimeEnvironment ;
36
43
import org .opengrok .indexer .history .HistoryGuru ;
44
+ import org .opengrok .indexer .history .RepositoryFactory ;
37
45
import org .opengrok .indexer .index .Indexer ;
38
46
import org .opengrok .indexer .util .TestRepository ;
39
47
40
- import static org .junit .Assert .*;
41
- import org .opengrok .indexer .history .RepositoryFactory ;
42
-
43
48
/**
44
49
* Do basic testing of the SearchEngine
45
50
*
46
51
* @author Trond Norbye
47
52
*/
48
53
public class SearchEngineTest {
49
54
50
- static TestRepository repository ;
51
- static File configFile ;
55
+ private static TestRepository repository ;
56
+ private static File configFile ;
52
57
53
58
@ BeforeClass
54
59
public static void setUpClass () throws Exception {
@@ -75,19 +80,11 @@ public static void setUpClass() throws Exception {
75
80
}
76
81
77
82
@ AfterClass
78
- public static void tearDownClass () throws Exception {
83
+ public static void tearDownClass () {
79
84
repository .destroy ();
80
85
configFile .delete ();
81
86
}
82
87
83
- @ Before
84
- public void setUp () {
85
- }
86
-
87
- @ After
88
- public void tearDown () {
89
- }
90
-
91
88
@ Test
92
89
public void testIsValidQuery () {
93
90
SearchEngine instance = new SearchEngine ();
@@ -142,7 +139,7 @@ public void testSymbol() {
142
139
}
143
140
144
141
@ Test
145
- public void testGetQuery () throws Exception {
142
+ public void testGetQuery () {
146
143
SearchEngine instance = new SearchEngine ();
147
144
instance .setHistory ("Once upon a time" );
148
145
instance .setFile ("Makefile" );
@@ -154,8 +151,8 @@ public void testGetQuery() throws Exception {
154
151
instance .getQuery ());
155
152
}
156
153
157
- /* see https://github.com/oracle/opengrok/issues/2030
158
154
@ Test
155
+ @ Ignore ("See https://github.com/oracle/opengrok/issues/2030" )
159
156
public void testSearch () {
160
157
List <Hit > hits = new ArrayList <>();
161
158
@@ -282,5 +279,4 @@ public void testSearch() {
282
279
assertEquals (1 , instance .search ());
283
280
instance .destroy ();
284
281
}
285
- */
286
282
}
0 commit comments