@@ -0,0 +1,2212 @@
+// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.%0Apackage com.intellij.testFramework;%0A%0Aimport org.junit.internal.MethodSorter;%0Aimport org.junit.runners.BlockJUnit4ClassRunner;%0Aimport org.junit.runners.model.FrameworkField;%0Aimport org.junit.runners.model.FrameworkMethod;%0Aimport org.junit.runners.model.InitializationError;%0Aimport org.junit.runners.model.TestClass;%0A%0Aimport java.lang.annotation.Annotation;%0Aimport java.lang.reflect.Method;%0Aimport java.util.List;%0Aimport java.util.Map;%0A%0A/**%0A * JUnit4 test runner that supports test methods declared in interfaces%0A */%0Apublic class MixinAwareJUnitRunner extends BlockJUnit4ClassRunner %7B%0A  public MixinAwareJUnitRunner(Class%3C?%3E clazz) throws InitializationError %7B%0A    super(clazz);%0A  %7D%0A%0A  @Override%0A  protected TestClass createTestClass(Class%3C?%3E testClass) %7B%0A    return new MixinAwareTestClass(testClass);%0A  %7D%0A%0A  static class MixinAwareTestClass extends TestClass %7B%0A    MixinAwareTestClass(Class%3C?%3E clazz) %7B%0A      super(clazz);%0A    %7D%0A%0A    @Override%0A    protected void scanAnnotatedMembers(Map%3CClass%3C? extends Annotation%3E, List%3CFrameworkMethod%3E%3E methodsForAnnotations,%0A                                        Map%3CClass%3C? extends Annotation%3E, List%3CFrameworkField%3E%3E fieldsForAnnotations) %7B%0A      super.scanAnnotatedMembers(methodsForAnnotations, fieldsForAnnotations);%0A      scanAnnotatedMethodsInInterfaces(getJavaClass(), methodsForAnnotations);%0A    %7D%0A%0A    private static void scanAnnotatedMethodsInInterfaces(Class%3C?%3E clazz,%0A                                                         Map%3CClass%3C? extends Annotation%3E, List%3CFrameworkMethod%3E%3E methodsForAnnotations) %7B%0A      for (Class%3C?%3E superInterface : clazz.getInterfaces()) %7B%0A        for (Method eachMethod : MethodSorter.getDeclaredMethods(superInterface)) %7B%0A          addToAnnotationLists(new FrameworkMethod(eachMethod), methodsForAnnotations);%0A        %7D%0A        scanAnnotatedMethodsInInterfaces(superInterface, methodsForAnnotations);%0A      %7D%0A      Class%3C?%3E superClass = clazz.getSuperclass();%0A      if (superClass != null) %7B%0A        scanAnnotatedMethodsInInterfaces(superClass, methodsForAnnotations);%0A      %7D%0A    %7D%0A  %7D%0A%7D%0A

Add JUnit test runner with support for mixins