Retype: better results presentation, fixed a couple more desync cases, add failing test

This commit is contained in:
Dmitry Jemerov
2018-07-20 18:55:57 +02:00
parent b837540690
commit a36c018c11
7 changed files with 150 additions and 74 deletions
@@ -0,0 +1,9 @@
class Braces {
void bar() {
}
void baz() {
}
}
@@ -0,0 +1,10 @@
public class Import {
public void foo() {
Arrays.asList();
}
private static class Arrays {
public static void asList() {
}
}
}
@@ -0,0 +1,32 @@
// Copyright 2000-2018 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.
package com.intellij.internal.retype
import com.intellij.JavaTestUtil
import com.intellij.ide.IdeEventQueue
import com.intellij.openapi.editor.impl.EditorImpl
import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase
/**
* @author yole
*/
abstract class JavaRetypeTest : LightCodeInsightFixtureTestCase() {
override fun getBasePath(): String = JavaTestUtil.getRelativeJavaTestDataPath()
fun _testBraces() {
doTest()
}
fun _testImport() {
doTest()
}
private fun doTest() {
val filePath = "/retype/${getTestName(false)}.java"
myFixture.configureByFile(filePath)
RetypeSession(project, myFixture.editor as EditorImpl, 0, 0).start()
while (editor.getUserData(RETYPE_SESSION_KEY) != null) {
IdeEventQueue.getInstance().flushQueue()
}
myFixture.checkResultByFile(filePath)
}
}