catch abstract method error to preserve plugins compatibility
authoranna <Anna.Kozlova@jetbrains.com>
Fri, 26 Aug 2011 13:56:50 +0000 (15:56 +0200)
committeranna <Anna.Kozlova@jetbrains.com>
Fri, 26 Aug 2011 13:58:35 +0000 (15:58 +0200)
EA-29421 - AME: TestIconProvider.getIcon

platform/lang-api/src/com/intellij/testIntegration/TestFramework.java
platform/testRunner/src/com/intellij/execution/testframework/TestIconProvider.java

index 0f51a3c7d14fe84bea655addec0d1d28460a0b89..5a7fc14c0ae7b2edea3d9b68bd55beb39bb84555 100644 (file)
@@ -62,7 +62,13 @@ public interface TestFramework {
 
   FileTemplateDescriptor getTestMethodFileTemplateDescriptor();
 
+  /**
+   * should be checked for abstract method error
+   */
   boolean isIgnoredMethod(PsiElement element);
 
+  /**
+   * should be checked for abstract method error
+   */
   boolean isTestMethod(PsiElement element);
 }
index 325c375fbdbaadc60e67208c49b7120a9b221073..7133a8e12c2466f8544edf449c2dcaf967a63137 100644 (file)
@@ -34,15 +34,21 @@ public class TestIconProvider extends IconProvider {
     final TestFramework[] testFrameworks = Extensions.getExtensions(TestFramework.EXTENSION_NAME);
 
     for (TestFramework framework : testFrameworks) {
-      if (framework.isIgnoredMethod(element)) {
-        return TestsUIUtil.loadIcon("ignoredTest");
+      try {
+        if (framework.isIgnoredMethod(element)) {
+          return TestsUIUtil.loadIcon("ignoredTest");
+        }
       }
+      catch (AbstractMethodError ignored) {}
     }
 
     for (TestFramework framework : testFrameworks) {
-      if (framework.isTestMethod(element)) {
-        return new LayeredIcon(PlatformIcons.METHOD_ICON, TestsUIUtil.loadIcon("testMark"));
+      try {
+        if (framework.isTestMethod(element)) {
+          return new LayeredIcon(PlatformIcons.METHOD_ICON, TestsUIUtil.loadIcon("testMark"));
+        }
       }
+      catch (AbstractMethodError ignore) {}
     }
 
     return null;