File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed
opengrok-indexer/src/test/java/org/opengrok/indexer/index Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -210,21 +210,27 @@ void testGetDefinitions() throws Exception {
210
210
*/
211
211
private void checkDataExistence (String fileName , boolean shouldExist ) {
212
212
RuntimeEnvironment env = RuntimeEnvironment .getInstance ();
213
+ HistoryGuru historyGuru = HistoryGuru .getInstance ();
213
214
214
215
for (String dirName : new String [] {"historycache" , "annotationcache" , IndexDatabase .XREF_DIR }) {
215
216
File dataDir = new File (env .getDataRootFile (), dirName );
217
+ File file = new File (env .getServerName (), fileName );
216
218
String cacheFile ;
217
219
if (dirName .equals ("annotationcache" )) {
218
- cacheFile = fileName ;
220
+ if (shouldExist ) {
221
+ assertTrue (historyGuru .hasAnnotationCacheForFile (file ));
222
+ } else {
223
+ assertFalse (historyGuru .hasAnnotationCacheForFile (file ));
224
+ }
219
225
} else {
220
226
cacheFile = TandemPath .join (fileName , ".gz" );
221
- }
222
- File dataFile = new File (dataDir , cacheFile );
227
+ File dataFile = new File (dataDir , cacheFile );
223
228
224
- if (shouldExist ) {
225
- assertTrue (dataFile .exists (), "file " + fileName + " not found in " + dirName );
226
- } else {
227
- assertFalse (dataFile .exists (), "file " + fileName + " found in " + dirName );
229
+ if (shouldExist ) {
230
+ assertTrue (dataFile .exists (), "file " + fileName + " not found in " + dirName );
231
+ } else {
232
+ assertFalse (dataFile .exists (), "file " + fileName + " found in " + dirName );
233
+ }
228
234
}
229
235
}
230
236
}
You can’t perform that action at this time.
0 commit comments