package de.plushnikov.intellij.plugin.processor;

import de.plushnikov.intellij.plugin.AbstractLombokParsingTestCase;

import java.io.IOException;

/**
 * Unit tests for IntelliJPlugin for Lombok, based on lombok test classes
 */
public class BuilderToBuilderTest extends AbstractLombokParsingTestCase {
  @Override
  public void setUp() throws Exception {
    super.setUp();
    // Add dummy classes, which are absent in mockJDK
    myFixture.addClass("package java.util;\n  public interface NavigableMap<K,V> extends java.util.SortedMap<K,V> {}");
  }

  public void testBuilder$BuilderWithToBuilder() throws IOException {
    doTest(true);
  }

  public void testBuilder$BuilderWithToBuilderOnClass() throws IOException {
    doTest(true);
  }

  public void testBuilder$BuilderWithToBuilderOnConstructor() throws IOException {
    doTest(true);
  }

  public void testBuilder$BuilderWithToBuilderOnMethod() throws IOException {
    doTest(true);
  }
}

@@ -946,11 +946,1073 @@
 ue);%0A  %7D
+%0A%0A//  public void testBuilderTime() throws InvocationTargetException, IllegalAccessException %7B%0A//    final String testName = %22builder$BuilderWithToBuilderOnMethod%22;%0A//    final PsiJavaFile beforeLombokFile = loadBeforeLombokFile(testName);%0A//    final PsiJavaFile afterDelombokFile = loadAfterDeLombokFile(testName);%0A//%0A//    final PsiClass%5B%5D beforeLombokFileClasses = beforeLombokFile.getClasses();%0A//%0A//    final Method clearUserDataMethod = ReflectionUtil.getDeclaredMethod(UserDataHolderBase.class, %22clearUserData%22);%0A//    for (int i = 0; i %3C 20; i++) %7B%0A//      compareFiles(beforeLombokFile, afterDelombokFile);%0A//      clearUserDataMethod.invoke(beforeLombokFileClasses%5B0%5D);%0A//    %7D%0A//%0A////    PlatformTestUtil.startPerformanceTest(%22Test Performance%22, 100, new ThrowableRunnable() %7B%0A////      @Override%0A////      public void run() throws Throwable %7B%0A////        compareFiles(beforeLombokFile, afterDelombokFile);%0A////        clearUserDataMethod.invoke(beforeLombokFileClasses%5B0%5D);%0A////      %7D%0A////    %7D).useLegacyScaling().attempts(3).assertTiming();%0A//  %7D
 %0A%7D%0A

test performance