mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-10-01 19:02:13 +07:00
fail predictably when asked for nonregistered index
This commit is contained in:
@@ -698,6 +698,12 @@ class IndexTest extends JavaCodeInsightFixtureTestCase {
|
||||
assert JavaFileElementType.isInSourceContent(myFixture.tempDirFixture.getFile('another/doo/A.java'))
|
||||
}
|
||||
|
||||
void "test requesting nonexisted index fails as expected"() {
|
||||
ID<?, ?> myId = ID.create("my.id")
|
||||
FileBasedIndex.instance.getContainingFiles(myId, "null", GlobalSearchScope.allScope(project))
|
||||
FileBasedIndex.instance.processAllKeys(myId, Processor.TRUE, project)
|
||||
}
|
||||
|
||||
void "test read-only index access"() {
|
||||
StringIndex index = createIndex(getTestName(false), new EnumeratorStringDescriptor(), true)
|
||||
|
||||
|
||||
@@ -39,10 +39,8 @@ class IndexConfiguration {
|
||||
assert myFreezed;
|
||||
final Pair<UpdatableIndex<?, ?, FileContent>, FileBasedIndex.InputFilter> pair = myIndices.get(indexId);
|
||||
|
||||
assert pair != null : "Index data is absent for index " + indexId;
|
||||
|
||||
//noinspection unchecked
|
||||
return (UpdatableIndex<K, V, FileContent>)pair.getFirst();
|
||||
return pair != null ? (UpdatableIndex<K, V, FileContent>)pair.getFirst() : null;
|
||||
}
|
||||
|
||||
FileBasedIndex.InputFilter getInputFilter(@NotNull ID<?, ?> indexId) {
|
||||
|
||||
Reference in New Issue
Block a user