Smart completion handlers tests made generated
This commit is contained in:
@@ -82,6 +82,7 @@ import org.jetbrains.jet.j2k.test.AbstractJavaToKotlinConverterPluginTest
|
|||||||
import org.jetbrains.jet.j2k.test.AbstractJavaToKotlinConverterBasicTest
|
import org.jetbrains.jet.j2k.test.AbstractJavaToKotlinConverterBasicTest
|
||||||
import org.jetbrains.jet.plugin.conversion.copy.AbstractJavaToKotlinCopyPasteConversionTest
|
import org.jetbrains.jet.plugin.conversion.copy.AbstractJavaToKotlinCopyPasteConversionTest
|
||||||
import org.jetbrains.jet.shortenRefs.AbstractShortenRefsTest
|
import org.jetbrains.jet.shortenRefs.AbstractShortenRefsTest
|
||||||
|
import org.jetbrains.jet.completion.handlers.AbstractSmartCompletionHandlerTest
|
||||||
|
|
||||||
fun main(args: Array<String>) {
|
fun main(args: Array<String>) {
|
||||||
System.setProperty("java.awt.headless", "true")
|
System.setProperty("java.awt.headless", "true")
|
||||||
@@ -268,6 +269,10 @@ fun main(args: Array<String>) {
|
|||||||
model("completion/basic/custom", recursive = false)
|
model("completion/basic/custom", recursive = false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
testClass(javaClass<AbstractSmartCompletionHandlerTest>()) {
|
||||||
|
model("completion/handlers/smart")
|
||||||
|
}
|
||||||
|
|
||||||
testClass(javaClass<AbstractGotoSuperTest>()) {
|
testClass(javaClass<AbstractGotoSuperTest>()) {
|
||||||
model("navigation/gotoSuper", extension = "test")
|
model("navigation/gotoSuper", extension = "test")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
trait Foo
|
trait Foo
|
||||||
|
|
||||||
var a : Foo = <caret>
|
var a : Foo = <caret>
|
||||||
|
|
||||||
|
//ELEMENT: object
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
trait Foo
|
trait Foo
|
||||||
|
|
||||||
var a : Foo = object: Foo {<caret>}
|
var a : Foo = object: Foo {<caret>}
|
||||||
|
|
||||||
|
//ELEMENT: object
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
abstract class Foo
|
abstract class Foo
|
||||||
|
|
||||||
var a : Foo = <caret>
|
var a : Foo = <caret>
|
||||||
|
|
||||||
|
//ELEMENT: object
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
abstract class Foo
|
abstract class Foo
|
||||||
|
|
||||||
var a : Foo = object: Foo() {<caret>}
|
var a : Foo = object: Foo() {<caret>}
|
||||||
|
|
||||||
|
//ELEMENT: object
|
||||||
|
|||||||
@@ -1 +1,3 @@
|
|||||||
var r : Runnable = <caret>
|
var r : Runnable = <caret>
|
||||||
|
|
||||||
|
//ELEMENT: object
|
||||||
|
|||||||
@@ -3,3 +3,5 @@ var r : Runnable = object: Runnable {
|
|||||||
throw UnsupportedOperationException()
|
throw UnsupportedOperationException()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//ELEMENT: object
|
||||||
|
|||||||
@@ -1 +1,3 @@
|
|||||||
val c: java.io.Closeable = <caret>
|
val c: java.io.Closeable = <caret>
|
||||||
|
|
||||||
|
//ELEMENT: object
|
||||||
|
|||||||
@@ -4,4 +4,6 @@ val c: java.io.Closeable = object: Closeable {
|
|||||||
override fun close() {
|
override fun close() {
|
||||||
throw UnsupportedOperationException()
|
throw UnsupportedOperationException()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//ELEMENT: object
|
||||||
|
|||||||
@@ -9,3 +9,5 @@ class K {
|
|||||||
fun foo(){
|
fun foo(){
|
||||||
val k : K = <caret>
|
val k : K = <caret>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ELEMENT: K.bar
|
||||||
|
|||||||
@@ -9,3 +9,5 @@ class K {
|
|||||||
fun foo(){
|
fun foo(){
|
||||||
val k : K = K.bar()<caret>
|
val k : K = K.bar()<caret>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ELEMENT: K.bar
|
||||||
|
|||||||
@@ -9,3 +9,5 @@ class K {
|
|||||||
fun foo(){
|
fun foo(){
|
||||||
val k : K = <caret>
|
val k : K = <caret>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ELEMENT: K.bar
|
||||||
|
|||||||
@@ -9,3 +9,5 @@ class K {
|
|||||||
fun foo(){
|
fun foo(){
|
||||||
val k : K = K.bar(<caret>)
|
val k : K = K.bar(<caret>)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ELEMENT: K.bar
|
||||||
|
|||||||
@@ -6,3 +6,5 @@ enum class Foo {
|
|||||||
fun foo(){
|
fun foo(){
|
||||||
val f : Foo = <caret>
|
val f : Foo = <caret>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ELEMENT: Foo.X
|
||||||
|
|||||||
@@ -6,3 +6,5 @@ enum class Foo {
|
|||||||
fun foo(){
|
fun foo(){
|
||||||
val f : Foo = Foo.X<caret>
|
val f : Foo = Foo.X<caret>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ELEMENT: Foo.X
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
fun foo(){
|
fun foo(){
|
||||||
val e : java.lang.annotation.ElementType = <caret>
|
val e : java.lang.annotation.ElementType = <caret>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ELEMENT: ElementType.FIELD
|
||||||
|
|||||||
@@ -3,3 +3,5 @@ import java.lang.annotation.ElementType
|
|||||||
fun foo(){
|
fun foo(){
|
||||||
val e : java.lang.annotation.ElementType = ElementType.FIELD<caret>
|
val e : java.lang.annotation.ElementType = ElementType.FIELD<caret>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ELEMENT: ElementType.FIELD
|
||||||
|
|||||||
@@ -3,3 +3,5 @@ import java.util.Locale
|
|||||||
fun foo(){
|
fun foo(){
|
||||||
var l : Locale = <caret>
|
var l : Locale = <caret>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ELEMENT: Locale.ENGLISH
|
||||||
|
|||||||
@@ -3,3 +3,5 @@ import java.util.Locale
|
|||||||
fun foo(){
|
fun foo(){
|
||||||
var l : Locale = Locale.ENGLISH<caret>
|
var l : Locale = Locale.ENGLISH<caret>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ELEMENT: Locale.ENGLISH
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
fun foo(){
|
fun foo(){
|
||||||
var l : java.util.Locale = <caret>
|
var l : java.util.Locale = <caret>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ELEMENT: Locale.ENGLISH
|
||||||
|
|||||||
@@ -3,3 +3,5 @@ import java.util.Locale
|
|||||||
fun foo(){
|
fun foo(){
|
||||||
var l : java.util.Locale = Locale.ENGLISH<caret>
|
var l : java.util.Locale = Locale.ENGLISH<caret>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ELEMENT: Locale.ENGLISH
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
fun foo(){
|
fun foo(){
|
||||||
val l : java.lang.Thread = <caret>
|
val l : java.lang.Thread = <caret>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ELEMENT: Thread.currentThread
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
fun foo(){
|
fun foo(){
|
||||||
val l : java.lang.Thread = Thread.currentThread()<caret>
|
val l : java.lang.Thread = Thread.currentThread()<caret>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ELEMENT: Thread.currentThread
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
fun foo(){
|
fun foo(){
|
||||||
val l : java.util.Calendar = <caret>
|
val l : java.util.Calendar = <caret>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ELEMENT: Calendar.getInstance
|
||||||
|
// TAIL_TEXT: (TimeZone)
|
||||||
|
|||||||
@@ -3,3 +3,6 @@ import java.util.Calendar
|
|||||||
fun foo(){
|
fun foo(){
|
||||||
val l : java.util.Calendar = Calendar.getInstance(<caret>)
|
val l : java.util.Calendar = Calendar.getInstance(<caret>)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ELEMENT: Calendar.getInstance
|
||||||
|
// TAIL_TEXT: (TimeZone)
|
||||||
|
|||||||
@@ -3,3 +3,6 @@ fun foo(s: String){ }
|
|||||||
fun bar(sss: String) {
|
fun bar(sss: String) {
|
||||||
foo(<caret>x.y())
|
foo(<caret>x.y())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//ELEMENT: sss
|
||||||
|
//CHAR: \t
|
||||||
|
|||||||
@@ -3,3 +3,6 @@ fun foo(s: String){ }
|
|||||||
fun bar(sss: String) {
|
fun bar(sss: String) {
|
||||||
foo(sss<caret>)
|
foo(sss<caret>)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//ELEMENT: sss
|
||||||
|
//CHAR: \t
|
||||||
|
|||||||
@@ -3,3 +3,6 @@ fun foo(s: String){ }
|
|||||||
fun bar(sss: String) {
|
fun bar(sss: String) {
|
||||||
foo(<caret>1 + x)
|
foo(<caret>1 + x)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//ELEMENT: sss
|
||||||
|
//CHAR: \t
|
||||||
|
|||||||
@@ -3,3 +3,6 @@ fun foo(s: String){ }
|
|||||||
fun bar(sss: String) {
|
fun bar(sss: String) {
|
||||||
foo(sss<caret>)
|
foo(sss<caret>)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//ELEMENT: sss
|
||||||
|
//CHAR: \t
|
||||||
|
|||||||
@@ -3,3 +3,6 @@ fun foo(s: String){ }
|
|||||||
fun bar(sss: String) {
|
fun bar(sss: String) {
|
||||||
foo(<caret>x().y.z())
|
foo(<caret>x().y.z())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//ELEMENT: sss
|
||||||
|
//CHAR: \t
|
||||||
|
|||||||
@@ -3,3 +3,6 @@ fun foo(s: String){ }
|
|||||||
fun bar(sss: String) {
|
fun bar(sss: String) {
|
||||||
foo(sss<caret>)
|
foo(sss<caret>)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//ELEMENT: sss
|
||||||
|
//CHAR: \t
|
||||||
|
|||||||
@@ -3,3 +3,6 @@ fun foo(s: String){ }
|
|||||||
fun bar(ss: String) {
|
fun bar(ss: String) {
|
||||||
foo(<caret>xxx)
|
foo(<caret>xxx)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//ELEMENT: ss
|
||||||
|
//CHAR: \t
|
||||||
|
|||||||
@@ -3,3 +3,6 @@ fun foo(s: String){ }
|
|||||||
fun bar(ss: String) {
|
fun bar(ss: String) {
|
||||||
foo(ss<caret>)
|
foo(ss<caret>)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//ELEMENT: ss
|
||||||
|
//CHAR: \t
|
||||||
|
|||||||
@@ -6,3 +6,6 @@ val c: String = ""
|
|||||||
fun bar() {
|
fun bar() {
|
||||||
if (b1 && <caret>b2 && b3) {}
|
if (b1 && <caret>b2 && b3) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//ELEMENT: b3
|
||||||
|
//CHAR: \t
|
||||||
|
|||||||
@@ -6,3 +6,6 @@ val c: String = ""
|
|||||||
fun bar() {
|
fun bar() {
|
||||||
if (b1 && b3 && b3) {}
|
if (b1 && b3 && b3) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//ELEMENT: b3
|
||||||
|
//CHAR: \t
|
||||||
|
|||||||
+22
-25
@@ -32,33 +32,30 @@ import org.junit.Assert
|
|||||||
import com.intellij.openapi.application.Result
|
import com.intellij.openapi.application.Result
|
||||||
import com.intellij.testFramework.fixtures.JavaCodeInsightTestFixture
|
import com.intellij.testFramework.fixtures.JavaCodeInsightTestFixture
|
||||||
import kotlin.properties.Delegates
|
import kotlin.properties.Delegates
|
||||||
|
import org.jetbrains.jet.InTextDirectivesUtils
|
||||||
|
|
||||||
|
abstract class AbstractSmartCompletionHandlerTest() : CompletionHandlerTestBase() {
|
||||||
|
private val INVOCATION_COUNT_PREFIX = "INVOCATION_COUNT:"
|
||||||
|
private val LOOKUP_STRING_PREFIX = "ELEMENT:"
|
||||||
|
private val TAIL_TEXT_PREFIX = "TAIL_TEXT:"
|
||||||
|
private val COMPLETION_CHAR_PREFIX = "CHAR:"
|
||||||
|
|
||||||
public class SmartCompletionHandlerTest() : CompletionHandlerTestBase() {
|
|
||||||
override val completionType: CompletionType = CompletionType.SMART
|
override val completionType: CompletionType = CompletionType.SMART
|
||||||
override val testDataRelativePath: String = "/completion/handlers/smart"
|
override val testDataRelativePath: String = "/completion/handlers/smart"
|
||||||
|
|
||||||
fun testConstructor() = doTest()
|
protected fun doTest(testPath: String) {
|
||||||
fun testConstructorWithParameters() = doTest()
|
fixture.configureByFile(testPath)
|
||||||
fun testConstructorForNullable() = doTest()
|
|
||||||
fun testConstructorForJavaClass() = doTest()
|
val fileText = fixture.getFile()!!.getText()
|
||||||
fun testConstructorForGenericType() = doTest()
|
val invocationCount = InTextDirectivesUtils.getPrefixedInt(fileText, INVOCATION_COUNT_PREFIX) ?: 1
|
||||||
fun testConstructorInsertsImport() = doTest()
|
val lookupString = InTextDirectivesUtils.findStringWithPrefixes(fileText, LOOKUP_STRING_PREFIX)
|
||||||
fun testConstructorInsertsImport2() = doTest()
|
val tailText = InTextDirectivesUtils.findStringWithPrefixes(fileText, TAIL_TEXT_PREFIX)
|
||||||
fun testJavaStaticMethod() = doTest(1, "Thread.currentThread", null, '\n')
|
val completionCharString = InTextDirectivesUtils.findStringWithPrefixes(fileText, COMPLETION_CHAR_PREFIX)
|
||||||
fun testJavaStaticMethodInsertsImport() = doTest(1, "Calendar.getInstance", "(TimeZone)", '\n')
|
val completionChar = when(completionCharString) {
|
||||||
fun testClassObjectMethod1() = doTest(1, "K.bar", null, '\n')
|
"\\n", null -> '\n'
|
||||||
fun testClassObjectMethod2() = doTest(1, "K.bar", null, '\n')
|
"\\t" -> '\t'
|
||||||
fun testEnumMember() = doTest(1, "Foo.X", null, '\n')
|
else -> error("Uknown completion char")
|
||||||
fun testJavaEnumMemberInsertsImport() = doTest(1, "ElementType.FIELD", null, '\n')
|
}
|
||||||
fun testJavaStaticField() = doTest(1, "Locale.ENGLISH", null, '\n')
|
doTestWithTextLoaded(invocationCount, lookupString, tailText, completionChar)
|
||||||
fun testJavaStaticFieldInsertImport() = doTest(1, "Locale.ENGLISH", null, '\n')
|
}
|
||||||
fun testTabReplaceIdentifier() = doTest(1, "ss", null, '\t')
|
|
||||||
fun testTabReplaceExpression() = doTest(1, "sss", null, '\t')
|
|
||||||
fun testTabReplaceExpression2() = doTest(1, "sss", null, '\t')
|
|
||||||
fun testTabReplaceExpression3() = doTest(1, "sss", null, '\t')
|
|
||||||
fun testTabReplaceOperand() = doTest(1, "b3", null, '\t')
|
|
||||||
fun testAnonymousObject1() = doTest(1, "object", null, '\t')
|
|
||||||
fun testAnonymousObject2() = doTest(1, "object", null, '\t')
|
|
||||||
fun testAnonymousObject3() = doTest(1, "object", null, '\t')
|
|
||||||
fun testAnonymousObjectInsertsImport() = doTest(1, "object", null, '\t')
|
|
||||||
}
|
}
|
||||||
@@ -47,8 +47,12 @@ public abstract class CompletionHandlerTestBase() : JetLightCodeInsightFixtureTe
|
|||||||
|
|
||||||
protected fun doTest() : Unit = doTest(2, null, null, '\n')
|
protected fun doTest() : Unit = doTest(2, null, null, '\n')
|
||||||
|
|
||||||
protected fun doTest(time : Int, lookupString : String?, tailText : String?, completionChar : Char) : Unit {
|
protected fun doTest(time : Int, lookupString : String?, tailText : String?, completionChar : Char) {
|
||||||
fixture.configureByFile(fileName())
|
fixture.configureByFile(fileName())
|
||||||
|
doTestWithTextLoaded(time, lookupString, tailText, completionChar)
|
||||||
|
}
|
||||||
|
|
||||||
|
protected fun doTestWithTextLoaded(time : Int, lookupString : String?, tailText : String?, completionChar : Char) {
|
||||||
if (lookupString != null || tailText != null) {
|
if (lookupString != null || tailText != null) {
|
||||||
fixture.complete(completionType, time)
|
fixture.complete(completionType, time)
|
||||||
val item = getExistentLookupElement(lookupString, tailText)
|
val item = getExistentLookupElement(lookupString, tailText)
|
||||||
|
|||||||
+159
@@ -0,0 +1,159 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2013 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.jet.completion.handlers;
|
||||||
|
|
||||||
|
import junit.framework.Assert;
|
||||||
|
import junit.framework.Test;
|
||||||
|
import junit.framework.TestSuite;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
import org.jetbrains.jet.JetTestUtils;
|
||||||
|
import org.jetbrains.jet.test.InnerTestClasses;
|
||||||
|
import org.jetbrains.jet.test.TestMetadata;
|
||||||
|
|
||||||
|
import org.jetbrains.jet.completion.handlers.AbstractSmartCompletionHandlerTest;
|
||||||
|
|
||||||
|
/** This class is generated by {@link org.jetbrains.jet.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */
|
||||||
|
@SuppressWarnings("all")
|
||||||
|
@TestMetadata("idea/testData/completion/handlers/smart")
|
||||||
|
public class SmartCompletionHandlerTestGenerated extends AbstractSmartCompletionHandlerTest {
|
||||||
|
public void testAllFilesPresentInSmart() throws Exception {
|
||||||
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/completion/handlers/smart"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("AnonymousObject1.kt")
|
||||||
|
public void testAnonymousObject1() throws Exception {
|
||||||
|
doTest("idea/testData/completion/handlers/smart/AnonymousObject1.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("AnonymousObject2.kt")
|
||||||
|
public void testAnonymousObject2() throws Exception {
|
||||||
|
doTest("idea/testData/completion/handlers/smart/AnonymousObject2.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("AnonymousObject3.kt")
|
||||||
|
public void testAnonymousObject3() throws Exception {
|
||||||
|
doTest("idea/testData/completion/handlers/smart/AnonymousObject3.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("AnonymousObjectInsertsImport.kt")
|
||||||
|
public void testAnonymousObjectInsertsImport() throws Exception {
|
||||||
|
doTest("idea/testData/completion/handlers/smart/AnonymousObjectInsertsImport.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("ClassObjectMethod1.kt")
|
||||||
|
public void testClassObjectMethod1() throws Exception {
|
||||||
|
doTest("idea/testData/completion/handlers/smart/ClassObjectMethod1.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("ClassObjectMethod2.kt")
|
||||||
|
public void testClassObjectMethod2() throws Exception {
|
||||||
|
doTest("idea/testData/completion/handlers/smart/ClassObjectMethod2.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("Constructor.kt")
|
||||||
|
public void testConstructor() throws Exception {
|
||||||
|
doTest("idea/testData/completion/handlers/smart/Constructor.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("ConstructorForGenericType.kt")
|
||||||
|
public void testConstructorForGenericType() throws Exception {
|
||||||
|
doTest("idea/testData/completion/handlers/smart/ConstructorForGenericType.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("ConstructorForJavaClass.kt")
|
||||||
|
public void testConstructorForJavaClass() throws Exception {
|
||||||
|
doTest("idea/testData/completion/handlers/smart/ConstructorForJavaClass.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("ConstructorForNullable.kt")
|
||||||
|
public void testConstructorForNullable() throws Exception {
|
||||||
|
doTest("idea/testData/completion/handlers/smart/ConstructorForNullable.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("ConstructorInsertsImport.kt")
|
||||||
|
public void testConstructorInsertsImport() throws Exception {
|
||||||
|
doTest("idea/testData/completion/handlers/smart/ConstructorInsertsImport.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("ConstructorInsertsImport2.kt")
|
||||||
|
public void testConstructorInsertsImport2() throws Exception {
|
||||||
|
doTest("idea/testData/completion/handlers/smart/ConstructorInsertsImport2.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("ConstructorWithParameters.kt")
|
||||||
|
public void testConstructorWithParameters() throws Exception {
|
||||||
|
doTest("idea/testData/completion/handlers/smart/ConstructorWithParameters.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("EnumMember.kt")
|
||||||
|
public void testEnumMember() throws Exception {
|
||||||
|
doTest("idea/testData/completion/handlers/smart/EnumMember.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("JavaEnumMemberInsertsImport.kt")
|
||||||
|
public void testJavaEnumMemberInsertsImport() throws Exception {
|
||||||
|
doTest("idea/testData/completion/handlers/smart/JavaEnumMemberInsertsImport.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("JavaStaticField.kt")
|
||||||
|
public void testJavaStaticField() throws Exception {
|
||||||
|
doTest("idea/testData/completion/handlers/smart/JavaStaticField.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("JavaStaticFieldInsertImport.kt")
|
||||||
|
public void testJavaStaticFieldInsertImport() throws Exception {
|
||||||
|
doTest("idea/testData/completion/handlers/smart/JavaStaticFieldInsertImport.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("JavaStaticMethod.kt")
|
||||||
|
public void testJavaStaticMethod() throws Exception {
|
||||||
|
doTest("idea/testData/completion/handlers/smart/JavaStaticMethod.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("JavaStaticMethodInsertsImport.kt")
|
||||||
|
public void testJavaStaticMethodInsertsImport() throws Exception {
|
||||||
|
doTest("idea/testData/completion/handlers/smart/JavaStaticMethodInsertsImport.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("TabReplaceExpression.kt")
|
||||||
|
public void testTabReplaceExpression() throws Exception {
|
||||||
|
doTest("idea/testData/completion/handlers/smart/TabReplaceExpression.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("TabReplaceExpression2.kt")
|
||||||
|
public void testTabReplaceExpression2() throws Exception {
|
||||||
|
doTest("idea/testData/completion/handlers/smart/TabReplaceExpression2.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("TabReplaceExpression3.kt")
|
||||||
|
public void testTabReplaceExpression3() throws Exception {
|
||||||
|
doTest("idea/testData/completion/handlers/smart/TabReplaceExpression3.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("TabReplaceIdentifier.kt")
|
||||||
|
public void testTabReplaceIdentifier() throws Exception {
|
||||||
|
doTest("idea/testData/completion/handlers/smart/TabReplaceIdentifier.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("TabReplaceOperand.kt")
|
||||||
|
public void testTabReplaceOperand() throws Exception {
|
||||||
|
doTest("idea/testData/completion/handlers/smart/TabReplaceOperand.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -27,19 +27,21 @@ import org.jetbrains.jet.InTextDirectivesUtils;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
public abstract class JetLightCodeInsightFixtureTestCase extends LightCodeInsightFixtureTestCase {
|
public abstract class JetLightCodeInsightFixtureTestCase extends LightCodeInsightFixtureTestCase {
|
||||||
LightProjectDescriptor projectDescriptor = null;
|
LightProjectDescriptor projectDescriptor = JetLightProjectDescriptor.INSTANCE;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
String fileText = FileUtil.loadFile(new File(getTestDataPath(), fileName()));
|
if (!getTestName(false).startsWith("AllFilesPresentIn")) {
|
||||||
if (InTextDirectivesUtils.isDirectiveDefined(fileText, "RUNTIME")) {
|
String fileText = FileUtil.loadFile(new File(getTestDataPath(), fileName()));
|
||||||
projectDescriptor = JetWithJdkAndRuntimeLightProjectDescriptor.INSTANCE;
|
if (InTextDirectivesUtils.isDirectiveDefined(fileText, "RUNTIME")) {
|
||||||
}
|
projectDescriptor = JetWithJdkAndRuntimeLightProjectDescriptor.INSTANCE;
|
||||||
else if (InTextDirectivesUtils.isDirectiveDefined(fileText, "JS")) {
|
}
|
||||||
projectDescriptor = JetStdJSProjectDescriptor.INSTANCE;
|
else if (InTextDirectivesUtils.isDirectiveDefined(fileText, "JS")) {
|
||||||
}
|
projectDescriptor = JetStdJSProjectDescriptor.INSTANCE;
|
||||||
else {
|
}
|
||||||
projectDescriptor = JetLightProjectDescriptor.INSTANCE;
|
else {
|
||||||
|
projectDescriptor = JetLightProjectDescriptor.INSTANCE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
super.setUp();
|
super.setUp();
|
||||||
|
|||||||
Reference in New Issue
Block a user