mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
separate create field from usage tests
This commit is contained in:
+14
@@ -0,0 +1,14 @@
|
||||
// "Create Field 'field'" "true"
|
||||
class A {
|
||||
|
||||
private MyCloserMap field;
|
||||
|
||||
void bar() {
|
||||
field.put("a", "b");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class MyCloserMap {
|
||||
void put(String a, String b) {}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// "Create Field 'field'" "true"
|
||||
class A {
|
||||
|
||||
void bar() {
|
||||
f<caret>ield.put("a", "b");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class MyCloserMap {
|
||||
void put(String a, String b) {}
|
||||
}
|
||||
+13
-1
@@ -5,7 +5,19 @@ package com.intellij.codeInsight.daemon.quickFix;
|
||||
*/
|
||||
public class CreateFieldFromUsageTest extends LightQuickFixTestCase{
|
||||
|
||||
public void test() throws Exception { doAllTests(); }
|
||||
public void testAnonymousClass() throws Exception { doSingleTest(); }
|
||||
public void testExpectedTypes() throws Exception { doSingleTest(); }
|
||||
public void testInterface() throws Exception { doSingleTest(); }
|
||||
public void testMultipleTypes() throws Exception { doSingleTest(); }
|
||||
public void testMultipleTypes2() throws Exception { doSingleTest(); }
|
||||
public void testParametericMethod() throws Exception { doSingleTest(); }
|
||||
public void testQualifyInner() throws Exception { doSingleTest(); }
|
||||
public void testSortByRelevance() throws Exception { doSingleTest(); }
|
||||
public void testTypeArgsFormatted() throws Exception { doSingleTest(); }
|
||||
|
||||
protected void doSingleTest() {
|
||||
doSingleTest(getTestName(false) + ".java");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBasePath() {
|
||||
|
||||
+11
-4
@@ -30,7 +30,6 @@ import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.CharsetToolkit;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil;
|
||||
import com.intellij.testFramework.LightCodeInsightTestCase;
|
||||
import com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
@@ -90,7 +89,6 @@ public abstract class LightQuickFixTestCase extends LightDaemonAnalyzerTestCase
|
||||
}
|
||||
}
|
||||
}, "", "");
|
||||
System.out.println(testFile.getPath());
|
||||
}
|
||||
|
||||
protected void afterActionCompleted(final String testName, final String contents) {
|
||||
@@ -196,12 +194,21 @@ public abstract class LightQuickFixTestCase extends LightDaemonAnalyzerTestCase
|
||||
for (File file : files) {
|
||||
final String testName = file.getName().substring(BEFORE_PREFIX.length());
|
||||
doTestFor(testName, testCase);
|
||||
System.out.println(file.getPath());
|
||||
}
|
||||
assertTrue("Test files not found in "+testDirPath,files.length != 0);
|
||||
}
|
||||
|
||||
protected void doSingleTest(String fileSuffix) {
|
||||
doTestFor(fileSuffix, createWrapper());
|
||||
}
|
||||
|
||||
protected void doAllTests() throws Exception {
|
||||
doAllTests(new QuickFixTestCase() {
|
||||
doAllTests(createWrapper());
|
||||
}
|
||||
|
||||
private QuickFixTestCase createWrapper() {
|
||||
return new QuickFixTestCase() {
|
||||
@Override
|
||||
public String getBasePath() {
|
||||
return LightQuickFixTestCase.this.getBasePath();
|
||||
@@ -281,7 +288,7 @@ public abstract class LightQuickFixTestCase extends LightDaemonAnalyzerTestCase
|
||||
public void bringRealEditorBack() {
|
||||
LightQuickFixTestCase.bringRealEditorBack();
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
protected List<IntentionAction> getAvailableActions() {
|
||||
|
||||
Reference in New Issue
Block a user