@@ -46,16 +46,6 @@ public class IndexerRepoTest {
46
46
TestRepository repository ;
47
47
private final String ctagsProperty = "org.opensolaris.opengrok.analysis.Ctags" ;
48
48
49
- @ BeforeClass
50
- public static void setUpClass () throws Exception {
51
- assertTrue ("No point in running indexer tests without valid ctags" ,
52
- RuntimeEnvironment .getInstance ().validateExuberantCtags ());
53
- }
54
-
55
- @ AfterClass
56
- public static void tearDownClass () throws Exception {
57
- }
58
-
59
49
@ Before
60
50
public void setUp () throws IOException {
61
51
repository = new TestRepository ();
@@ -79,7 +69,7 @@ private void checkNumberOfThreads() {
79
69
Thread [] threads = new Thread [mainGroup .activeCount ()];
80
70
mainGroup .enumerate (threads );
81
71
for (int i = 0 ; i < threads .length ; i ++) {
82
- if (threads [i ].getName () == null ) {
72
+ if (threads [i ] == null || threads [ i ] .getName () == null ) {
83
73
continue ;
84
74
}
85
75
assertEquals (false , threads [i ].getName ().contains ("renamed-handling" ));
@@ -93,11 +83,11 @@ public void testMainWithH() throws IOException {
93
83
env .setCtags (System .getProperty (ctagsProperty , "ctags" ));
94
84
if (env .validateExuberantCtags ()) {
95
85
String [] argv = {"-S" , "-H" , "-s" , repository .getSourceRoot (),
96
- "-d" , repository .getDataRoot (), "-v" };
86
+ "-d" , repository .getDataRoot (), "-v" , "-c" , env . getCtags () };
97
87
Indexer .main (argv );
98
88
checkNumberOfThreads ();
99
89
} else {
100
- System .out .println ("Skipping test. Could not find a ctags I could use in path ." );
90
+ System .out .println ("Skipping test. Could not find a ctags I could use." );
101
91
}
102
92
}
103
93
@@ -108,11 +98,11 @@ public void testMainWithoutH() throws IOException {
108
98
env .setCtags (System .getProperty (ctagsProperty , "ctags" ));
109
99
if (env .validateExuberantCtags ()) {
110
100
String [] argv = {"-S" , "-P" , "-s" , repository .getSourceRoot (),
111
- "-d" , repository .getDataRoot (), "-v" };
101
+ "-d" , repository .getDataRoot (), "-v" , "-c" , env . getCtags () };
112
102
Indexer .main (argv );
113
103
checkNumberOfThreads ();
114
104
} else {
115
- System .out .println ("Skipping test. Could not find a ctags I could use in path ." );
105
+ System .out .println ("Skipping test. Could not find a ctags I could use." );
116
106
}
117
107
}
118
108
}
0 commit comments