[devkit] PluginXmlFunctionalTest: do not use plain assert

This commit is contained in:
Yann Cébron
2018-09-21 15:19:37 +02:00
parent a9289ece4e
commit 63707eb90e
@@ -215,8 +215,9 @@ class PluginXmlFunctionalTest extends JavaCodeInsightFixtureTestCase {
myFixture.addClass("package foo.goo; public class GooAction extends com.intellij.openapi.actionSystem.AnAction { }")
myFixture.configureByFile(getTestName(false) + ".xml")
myFixture.completeBasic()
assert myFixture.lookupElementStrings == ['bar', 'goo']
assert myFixture.lookup.advertisements.find { it.contains('to see inheritors of com.intellij.openapi.actionSystem.AnAction') }
assertSameElements(myFixture.lookupElementStrings, 'bar', 'goo')
assertNotNull(toString(myFixture.lookup.advertisements),
myFixture.lookup.advertisements.find { it.contains('to see inheritors of com.intellij.openapi.actionSystem.AnAction') })
}
@SuppressWarnings("ComponentNotRegistered")
@@ -226,8 +227,9 @@ class PluginXmlFunctionalTest extends JavaCodeInsightFixtureTestCase {
myFixture.addClass("package another.goo; public class AnotherAction extends com.intellij.openapi.actionSystem.AnAction { }")
myFixture.configureByFile(getTestName(false) + ".xml")
myFixture.complete(CompletionType.SMART)
assert myFixture.lookupElementStrings == ['foo.bar.BarAction', 'foo.goo.GooAction']
assert !myFixture.lookup.advertisements.find { it.contains('to see inheritors of com.intellij.openapi.actionSystem.AnAction') }
assertSameElements(myFixture.lookupElementStrings, ['foo.bar.BarAction', 'foo.goo.GooAction'])
assertNull(toString(myFixture.lookup.advertisements),
myFixture.lookup.advertisements.find { it.contains('to see inheritors of com.intellij.openapi.actionSystem.AnAction') })
}
void testExtensionsSpecifyDefaultExtensionNs() {
@@ -270,8 +272,8 @@ class PluginXmlFunctionalTest extends JavaCodeInsightFixtureTestCase {
private static void assertLookupElement(LookupElement element, String lookupString, String typeText) {
def presentation = new LookupElementPresentation()
element.renderElement(presentation)
assert presentation.itemText == lookupString
assert presentation.typeText == typeText
assertEquals(lookupString, presentation.itemText)
assertEquals(typeText, presentation.typeText)
}
private void configureLanguageAttributeTest() {
@@ -434,7 +436,7 @@ public class MyErrorHandler extends ErrorReportSubmitter {}
myFixture.configureByFile(getTestName(true) + ".xml")
final PsiElement element =
TargetElementUtil.findTargetElement(myFixture.getEditor(), TargetElementUtil.REFERENCED_ELEMENT_ACCEPTED)
assert element != null
assertNotNull(element)
assertEquals("Extension Point", ElementDescriptionUtil.getElementDescription(element, UsageViewTypeLocation.INSTANCE))
assertEquals("Extension Point bar", ElementDescriptionUtil.getElementDescription(element, UsageViewNodeTextLocation.INSTANCE))
}