Move Lazy Resolve tests to JUnit 3
This commit is contained in:
@@ -21,6 +21,7 @@ import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import junit.framework.TestCase;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.ConfigurationKind;
|
||||
import org.jetbrains.jet.JetTestUtils;
|
||||
@@ -35,14 +36,17 @@ import org.jetbrains.jet.lang.resolve.BindingTraceContext;
|
||||
import org.jetbrains.jet.lang.resolve.TopDownAnalysisParameters;
|
||||
import org.jetbrains.jet.lang.resolve.name.Name;
|
||||
import org.junit.After;
|
||||
import org.junit.BeforeClass;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
/**
|
||||
* @author abreslav
|
||||
*/
|
||||
public abstract class AbstractLazyResolveTest {
|
||||
public abstract class AbstractLazyResolveTest extends TestCase {
|
||||
|
||||
static {
|
||||
System.setProperty("java.awt.headless", "true");
|
||||
}
|
||||
|
||||
private final Disposable rootDisposable = new Disposable() {
|
||||
@Override
|
||||
@@ -51,8 +55,8 @@ public abstract class AbstractLazyResolveTest {
|
||||
};
|
||||
|
||||
public class JetCoreEnvironmentWithDisposable {
|
||||
|
||||
public final JetCoreEnvironment jetCoreEnvironment;
|
||||
|
||||
public final Project project;
|
||||
|
||||
public JetCoreEnvironmentWithDisposable(@NotNull ConfigurationKind configurationKind) {
|
||||
@@ -68,11 +72,6 @@ public abstract class AbstractLazyResolveTest {
|
||||
return regularEnvironment.project;
|
||||
}
|
||||
|
||||
@BeforeClass
|
||||
public static void setUp() throws Exception {
|
||||
System.setProperty("java.awt.headless", "true");
|
||||
}
|
||||
|
||||
@After
|
||||
public void tearDown() throws Exception {
|
||||
Disposer.dispose(rootDisposable);
|
||||
|
||||
+63
-63
@@ -44,16 +44,16 @@ public class LazyResolveNamespaceComparingTestGenerated extends AbstractLazyReso
|
||||
doTestSinglePackage("compiler/testData/readKotlinBinaryClass/class/Class.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("ClassInnerClass.kt")
|
||||
public void testClassInnerClass() throws Exception {
|
||||
doTestSinglePackage("compiler/testData/readKotlinBinaryClass/class/ClassInnerClass.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("ClassInParam.kt")
|
||||
public void testClassInParam() throws Exception {
|
||||
doTestSinglePackage("compiler/testData/readKotlinBinaryClass/class/ClassInParam.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("ClassInnerClass.kt")
|
||||
public void testClassInnerClass() throws Exception {
|
||||
doTestSinglePackage("compiler/testData/readKotlinBinaryClass/class/ClassInnerClass.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("ClassOutParam.kt")
|
||||
public void testClassOutParam() throws Exception {
|
||||
doTestSinglePackage("compiler/testData/readKotlinBinaryClass/class/ClassOutParam.kt");
|
||||
@@ -271,39 +271,6 @@ public class LazyResolveNamespaceComparingTestGenerated extends AbstractLazyReso
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.lang.resolve.lazy.LazyResolveTestGenerator", new File("compiler/testData/readKotlinBinaryClass/fun"), "kt", false);
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/readKotlinBinaryClass/fun/genericWithoutTypeVariables")
|
||||
public static class GenericWithoutTypeVariables extends AbstractLazyResolveNamespaceComparingTest {
|
||||
public void testAllFilesPresentInGenericWithoutTypeVariables() throws Exception {
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.lang.resolve.lazy.LazyResolveTestGenerator", new File("compiler/testData/readKotlinBinaryClass/fun/genericWithoutTypeVariables"), "kt", false);
|
||||
}
|
||||
|
||||
@TestMetadata("FunClassParamNotNull.kt")
|
||||
public void testFunClassParamNotNull() throws Exception {
|
||||
doTestSinglePackage("compiler/testData/readKotlinBinaryClass/fun/genericWithoutTypeVariables/FunClassParamNotNull.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("FunClassParamNullable.kt")
|
||||
public void testFunClassParamNullable() throws Exception {
|
||||
doTestSinglePackage("compiler/testData/readKotlinBinaryClass/fun/genericWithoutTypeVariables/FunClassParamNullable.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("FunParamNullable.kt")
|
||||
public void testFunParamNullable() throws Exception {
|
||||
doTestSinglePackage("compiler/testData/readKotlinBinaryClass/fun/genericWithoutTypeVariables/FunParamNullable.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("ReturnTypeClassParamNotNull.kt")
|
||||
public void testReturnTypeClassParamNotNull() throws Exception {
|
||||
doTestSinglePackage("compiler/testData/readKotlinBinaryClass/fun/genericWithoutTypeVariables/ReturnTypeClassParamNotNull.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("ReturnTypeClassParamNullable.kt")
|
||||
public void testReturnTypeClassParamNullable() throws Exception {
|
||||
doTestSinglePackage("compiler/testData/readKotlinBinaryClass/fun/genericWithoutTypeVariables/ReturnTypeClassParamNullable.kt");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/readKotlinBinaryClass/fun/genericWithTypeVariables")
|
||||
public static class GenericWithTypeVariables extends AbstractLazyResolveNamespaceComparingTest {
|
||||
public void testAllFilesPresentInGenericWithTypeVariables() throws Exception {
|
||||
@@ -387,6 +354,39 @@ public class LazyResolveNamespaceComparingTestGenerated extends AbstractLazyReso
|
||||
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/readKotlinBinaryClass/fun/genericWithoutTypeVariables")
|
||||
public static class GenericWithoutTypeVariables extends AbstractLazyResolveNamespaceComparingTest {
|
||||
public void testAllFilesPresentInGenericWithoutTypeVariables() throws Exception {
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.lang.resolve.lazy.LazyResolveTestGenerator", new File("compiler/testData/readKotlinBinaryClass/fun/genericWithoutTypeVariables"), "kt", false);
|
||||
}
|
||||
|
||||
@TestMetadata("FunClassParamNotNull.kt")
|
||||
public void testFunClassParamNotNull() throws Exception {
|
||||
doTestSinglePackage("compiler/testData/readKotlinBinaryClass/fun/genericWithoutTypeVariables/FunClassParamNotNull.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("FunClassParamNullable.kt")
|
||||
public void testFunClassParamNullable() throws Exception {
|
||||
doTestSinglePackage("compiler/testData/readKotlinBinaryClass/fun/genericWithoutTypeVariables/FunClassParamNullable.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("FunParamNullable.kt")
|
||||
public void testFunParamNullable() throws Exception {
|
||||
doTestSinglePackage("compiler/testData/readKotlinBinaryClass/fun/genericWithoutTypeVariables/FunParamNullable.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("ReturnTypeClassParamNotNull.kt")
|
||||
public void testReturnTypeClassParamNotNull() throws Exception {
|
||||
doTestSinglePackage("compiler/testData/readKotlinBinaryClass/fun/genericWithoutTypeVariables/ReturnTypeClassParamNotNull.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("ReturnTypeClassParamNullable.kt")
|
||||
public void testReturnTypeClassParamNullable() throws Exception {
|
||||
doTestSinglePackage("compiler/testData/readKotlinBinaryClass/fun/genericWithoutTypeVariables/ReturnTypeClassParamNullable.kt");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/readKotlinBinaryClass/fun/nonGeneric")
|
||||
public static class NonGeneric extends AbstractLazyResolveNamespaceComparingTest {
|
||||
public void testAllFilesPresentInNonGeneric() throws Exception {
|
||||
@@ -478,8 +478,8 @@ public class LazyResolveNamespaceComparingTestGenerated extends AbstractLazyReso
|
||||
public static Test suite() {
|
||||
TestSuite suite = new TestSuite("Fun");
|
||||
suite.addTestSuite(Fun.class);
|
||||
suite.addTestSuite(GenericWithoutTypeVariables.class);
|
||||
suite.addTestSuite(GenericWithTypeVariables.class);
|
||||
suite.addTestSuite(GenericWithoutTypeVariables.class);
|
||||
suite.addTestSuite(NonGeneric.class);
|
||||
return suite;
|
||||
}
|
||||
@@ -581,11 +581,6 @@ public class LazyResolveNamespaceComparingTestGenerated extends AbstractLazyReso
|
||||
doTestSinglePackage("compiler/testData/readKotlinBinaryClass/prop/ExtVarIntTQInClass.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("ExtVarl.kt")
|
||||
public void testExtVarl() throws Exception {
|
||||
doTestSinglePackage("compiler/testData/readKotlinBinaryClass/prop/ExtVarl.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("ExtVarMapPQInt.kt")
|
||||
public void testExtVarMapPQInt() throws Exception {
|
||||
doTestSinglePackage("compiler/testData/readKotlinBinaryClass/prop/ExtVarMapPQInt.kt");
|
||||
@@ -601,6 +596,11 @@ public class LazyResolveNamespaceComparingTestGenerated extends AbstractLazyReso
|
||||
doTestSinglePackage("compiler/testData/readKotlinBinaryClass/prop/ExtVarTQIntInClass.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("ExtVarl.kt")
|
||||
public void testExtVarl() throws Exception {
|
||||
doTestSinglePackage("compiler/testData/readKotlinBinaryClass/prop/ExtVarl.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("NsVal.kt")
|
||||
public void testNsVal() throws Exception {
|
||||
doTestSinglePackage("compiler/testData/readKotlinBinaryClass/prop/NsVal.kt");
|
||||
@@ -734,11 +734,6 @@ public class LazyResolveNamespaceComparingTestGenerated extends AbstractLazyReso
|
||||
doTestSinglePackage("compiler/testData/readKotlinBinaryClass/type/ListOfAnyQ.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("ListOfjlString.kt")
|
||||
public void testListOfjlString() throws Exception {
|
||||
doTestSinglePackage("compiler/testData/readKotlinBinaryClass/type/ListOfjlString.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("ListOfStar.kt")
|
||||
public void testListOfStar() throws Exception {
|
||||
doTestSinglePackage("compiler/testData/readKotlinBinaryClass/type/ListOfStar.kt");
|
||||
@@ -749,6 +744,11 @@ public class LazyResolveNamespaceComparingTestGenerated extends AbstractLazyReso
|
||||
doTestSinglePackage("compiler/testData/readKotlinBinaryClass/type/ListOfString.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("ListOfjlString.kt")
|
||||
public void testListOfjlString() throws Exception {
|
||||
doTestSinglePackage("compiler/testData/readKotlinBinaryClass/type/ListOfjlString.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("Nothing.kt")
|
||||
public void testNothing() throws Exception {
|
||||
doTestSinglePackage("compiler/testData/readKotlinBinaryClass/type/Nothing.kt");
|
||||
@@ -905,16 +905,16 @@ public class LazyResolveNamespaceComparingTestGenerated extends AbstractLazyReso
|
||||
doTestSinglePackage("compiler/testData/readJavaBinaryClass/InnerClass.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("InnerClassesInGeneric.kt")
|
||||
public void testInnerClassesInGeneric() throws Exception {
|
||||
doTestSinglePackage("compiler/testData/readJavaBinaryClass/InnerClassesInGeneric.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("InnerClassReferencesOuterTP.kt")
|
||||
public void testInnerClassReferencesOuterTP() throws Exception {
|
||||
doTestSinglePackage("compiler/testData/readJavaBinaryClass/InnerClassReferencesOuterTP.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("InnerClassesInGeneric.kt")
|
||||
public void testInnerClassesInGeneric() throws Exception {
|
||||
doTestSinglePackage("compiler/testData/readJavaBinaryClass/InnerClassesInGeneric.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("MethodReferencesOuterClassTP.kt")
|
||||
public void testMethodReferencesOuterClassTP() throws Exception {
|
||||
doTestSinglePackage("compiler/testData/readJavaBinaryClass/MethodReferencesOuterClassTP.kt");
|
||||
@@ -1082,15 +1082,15 @@ public class LazyResolveNamespaceComparingTestGenerated extends AbstractLazyReso
|
||||
|
||||
@TestMetadata("compiler/testData/readJavaBinaryClass/kotlinSignature/error")
|
||||
public static class Error extends AbstractLazyResolveNamespaceComparingTest {
|
||||
public void testAllFilesPresentInError() throws Exception {
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.lang.resolve.lazy.LazyResolveTestGenerator", new File("compiler/testData/readJavaBinaryClass/kotlinSignature/error"), "kt", false);
|
||||
}
|
||||
|
||||
@TestMetadata("AddingNullability.kt")
|
||||
public void testAddingNullability() throws Exception {
|
||||
doTestSinglePackage("compiler/testData/readJavaBinaryClass/kotlinSignature/error/AddingNullability.kt");
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInError() throws Exception {
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.lang.resolve.lazy.LazyResolveTestGenerator", new File("compiler/testData/readJavaBinaryClass/kotlinSignature/error"), "kt", false);
|
||||
}
|
||||
|
||||
@TestMetadata("ExtraUpperBound.kt")
|
||||
public void testExtraUpperBound() throws Exception {
|
||||
doTestSinglePackage("compiler/testData/readJavaBinaryClass/kotlinSignature/error/ExtraUpperBound.kt");
|
||||
@@ -1166,11 +1166,6 @@ public class LazyResolveNamespaceComparingTestGenerated extends AbstractLazyReso
|
||||
doTestSinglePackage("compiler/testData/readJavaBinaryClass/kotlinSignature/error/WrongTypeVariance.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("WrongValueParametersCount.kt")
|
||||
public void testWrongValueParametersCount() throws Exception {
|
||||
doTestSinglePackage("compiler/testData/readJavaBinaryClass/kotlinSignature/error/WrongValueParametersCount.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("WrongValueParameterStructure1.kt")
|
||||
public void testWrongValueParameterStructure1() throws Exception {
|
||||
doTestSinglePackage("compiler/testData/readJavaBinaryClass/kotlinSignature/error/WrongValueParameterStructure1.kt");
|
||||
@@ -1181,6 +1176,11 @@ public class LazyResolveNamespaceComparingTestGenerated extends AbstractLazyReso
|
||||
doTestSinglePackage("compiler/testData/readJavaBinaryClass/kotlinSignature/error/WrongValueParameterStructure2.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("WrongValueParametersCount.kt")
|
||||
public void testWrongValueParametersCount() throws Exception {
|
||||
doTestSinglePackage("compiler/testData/readJavaBinaryClass/kotlinSignature/error/WrongValueParametersCount.kt");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static Test suite() {
|
||||
|
||||
Reference in New Issue
Block a user