Dropped obsolete tests
This commit is contained in:
@@ -1,6 +0,0 @@
|
||||
package some
|
||||
|
||||
import jettesting.data.*;
|
||||
|
||||
fun otherfun() {
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
package some
|
||||
|
||||
import jettesting.data.*;
|
||||
|
||||
fun otherfun() {
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
package some
|
||||
|
||||
import jettesting . data .*;
|
||||
|
||||
fun otherfun() {
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
package some
|
||||
|
||||
import jettesting . data .*;
|
||||
|
||||
fun otherfun() {
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
object some {
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
import java.util.HashSet
|
||||
|
||||
object some {
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
class A {}
|
||||
@@ -1 +0,0 @@
|
||||
class A {}
|
||||
@@ -1,45 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
*
|
||||
* 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 org.jetbrains.kotlin.idea.imports;
|
||||
|
||||
import com.intellij.codeInsight.CodeInsightSettings;
|
||||
import com.intellij.codeInsight.daemon.LightDaemonAnalyzerTestCase;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import org.jetbrains.kotlin.idea.util.ImportInsertHelper;
|
||||
import org.jetbrains.kotlin.name.FqName;
|
||||
import org.jetbrains.kotlin.psi.JetFile;
|
||||
|
||||
public class OptimizeImportsOnFlyTest extends LightDaemonAnalyzerTestCase {
|
||||
|
||||
public void testOptimizeImportsOnFly() throws Exception {
|
||||
configureFromFileText("test.kt", "import java.util.ArrayList");
|
||||
boolean oldValue = CodeInsightSettings.getInstance().OPTIMIZE_IMPORTS_ON_THE_FLY;
|
||||
try {
|
||||
CodeInsightSettings.getInstance().OPTIMIZE_IMPORTS_ON_THE_FLY = true;
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
ImportInsertHelper.getInstance(getProject()).addImportDirectiveIfNeeded(new FqName("java.util.HashSet"), (JetFile) getFile());
|
||||
}
|
||||
});
|
||||
}
|
||||
finally {
|
||||
CodeInsightSettings.getInstance().OPTIMIZE_IMPORTS_ON_THE_FLY = oldValue;
|
||||
}
|
||||
checkResultByText("import java.util.HashSet");
|
||||
}
|
||||
}
|
||||
@@ -1,84 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
*
|
||||
* 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 org.jetbrains.kotlin.idea.quickfix;
|
||||
|
||||
import com.intellij.codeInsight.daemon.LightDaemonAnalyzerTestCase;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import org.jetbrains.kotlin.idea.PluginTestCaseBase;
|
||||
import org.jetbrains.kotlin.idea.util.ImportInsertHelper;
|
||||
import org.jetbrains.kotlin.name.FqName;
|
||||
import org.jetbrains.kotlin.psi.JetFile;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class ImportClassHelperTest extends LightDaemonAnalyzerTestCase {
|
||||
public void testDoNotImportIfGeneralExist() {
|
||||
doFileTest("jettesting.data.testFunction");
|
||||
}
|
||||
|
||||
public void testDoNotImportIfGeneralSpaceExist() {
|
||||
doFileTest("jettesting.data.testFunction");
|
||||
}
|
||||
|
||||
public void testNoDefaultImport() {
|
||||
doFileTest("kotlin.io.println");
|
||||
}
|
||||
|
||||
public void testImportBeforeObject() {
|
||||
doFileTest("java.util.HashSet");
|
||||
}
|
||||
|
||||
public void testInsertInEmptyFile() throws IOException {
|
||||
configureFromFileText("testInsertInEmptyFile.kt", "");
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
ImportInsertHelper.getInstance(getProject()).addImportDirectiveIfNeeded(new FqName("java.util.ArrayList"), (JetFile) getFile());
|
||||
}
|
||||
});
|
||||
|
||||
checkResultByText("import java.util.ArrayList");
|
||||
}
|
||||
|
||||
public void testInsertInPackageOnlyFile() throws IOException {
|
||||
configureFromFileText("testInsertInPackageOnlyFile.kt", "package some");
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
ImportInsertHelper.getInstance(getProject()).addImportDirectiveIfNeeded(new FqName("java.util.ArrayList"), (JetFile) getFile());
|
||||
}
|
||||
});
|
||||
|
||||
checkResultByText("package some\n\nimport java.util.ArrayList");
|
||||
}
|
||||
|
||||
public void doFileTest(final String importString) {
|
||||
configureByFile(getTestName(false) + ".kt");
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
ImportInsertHelper.getInstance(getProject()).addImportDirectiveIfNeeded(new FqName(importString), (JetFile) getFile());
|
||||
}
|
||||
});
|
||||
checkResultByFile(getTestName(false) + ".kt.after");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getTestDataPath() {
|
||||
return PluginTestCaseBase.getTestDataPathBase() + "/quickfix/importHelper/";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user