/*
 * Copyright 2013 must-be.org
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.intellij.execution.testframework;

import com.intellij.icons.AllIcons;
import com.intellij.ide.IconDescriptor;
import com.intellij.ide.IconDescriptorUpdater;
import com.intellij.psi.PsiElement;
import com.intellij.testIntegration.TestFramework;
import org.jetbrains.annotations.NotNull;

/**
 * @author VISTALL
 * @since 1:22/19.07.13
 */
public class TestIconDescriptorUpdater implements IconDescriptorUpdater {
  @Override
  public void updateIcon(@NotNull IconDescriptor iconDescriptor, @NotNull PsiElement element, int flags) {
    final TestFramework[] testFrameworks = TestFramework.EXTENSION_NAME.getExtensions();

    for (TestFramework framework : testFrameworks) {
      if (framework.isIgnoredMethod(element)) {
        iconDescriptor.setMainIcon(AllIcons.RunConfigurations.IgnoredTest);
      }
    }

    for (TestFramework framework : testFrameworks) {
      if (framework.isTestMethod(element)) {
        iconDescriptor.addLayerIcon(AllIcons.RunConfigurations.TestMark);
      }
    }
  }
}

@@ -1137,13 +1137,12 @@
    f
-inal 
+or (
 Test
@@ -1154,24 +1154,18 @@
 work
-%5B%5D testF
+ f
 ramework
 s = 
@@ -1164,11 +1164,10 @@
 work
-s =
+ :
  Tes
@@ -1211,60 +1211,8 @@
 ns()
-;%0A%0A    for (TestFramework framework : testFrameworks
 ) %7B%0A
@@ -1347,78 +1347,54 @@
   %7D%0A
-    %7D%0A%0A    for (TestFramework framework : testFrameworks) %7B%0A      if (
+%0A      if (framework.isTestMethod(element) %7C%7C 
 fram
@@ -1397,38 +1397,37 @@
 framework.isTest
-Method
+Class
 (element)) %7B%0A   

add icon if class test too