Tests for loading KotlinSignature annotation for constructors

#KT-2774 In Progress
This commit is contained in:
Nikolay Krasko
2012-10-02 18:48:26 +04:00
parent 14b7759a2a
commit 8d608f2887
14 changed files with 120 additions and 8 deletions
@@ -0,0 +1,10 @@
package test;
import java.util.*;
import jet.runtime.typeinfo.KotlinSignature;
public class ConstructorWithNewTypeParams<T> {
@KotlinSignature("fun ConstructorWithNewTypeParams(first : Any)") // TODO: first : U doesn't work
public <U>ConstructorWithNewTypeParams(U first) {
}
}
@@ -0,0 +1,4 @@
package test
public open class ConstructorWithNewTypeParams<T>(p0 : Any) : java.lang.Object() {
}
@@ -0,0 +1,5 @@
namespace test
public open class test.ConstructorWithNewTypeParams</*0*/ T : jet.Any?> : java.lang.Object {
public final /*constructor*/ fun </*0*/ T : jet.Any?><init>(/*0*/ p0: jet.Any): test.ConstructorWithNewTypeParams<T>
}
@@ -0,0 +1,10 @@
package test;
import java.util.*;
import jet.runtime.typeinfo.KotlinSignature;
public class ConstructorWithParentTypeParams<T> {
@KotlinSignature("fun ConstructorWithParentTypeParams(first: T)")
public ConstructorWithParentTypeParams(T first) {
}
}
@@ -0,0 +1,4 @@
package test
public open class ConstructorWithParentTypeParams<T>(p0 : T) : java.lang.Object() {
}
@@ -0,0 +1,5 @@
namespace test
public open class test.ConstructorWithParentTypeParams</*0*/ T : jet.Any?> : java.lang.Object {
public final /*constructor*/ fun </*0*/ T : jet.Any?><init>(/*0*/ p0: T): test.ConstructorWithParentTypeParams<T>
}
@@ -0,0 +1,10 @@
package test;
import java.util.*;
import jet.runtime.typeinfo.KotlinSignature;
public class ConstructorWithSeveralParams {
@KotlinSignature("fun ConstructorWithSeveralParams(integer : Int, intField : Int, collection: ArrayList<String>)")
public ConstructorWithSeveralParams(Integer integer, int intBasic, ArrayList<String> collection) {
}
}
@@ -0,0 +1,6 @@
package test
import java.util.*
public open class ConstructorWithSeveralParams(p0: Int, p1 : Int, p2 : ArrayList<String>) : java.lang.Object() {
}
@@ -0,0 +1,5 @@
namespace test
public open class test.ConstructorWithSeveralParams : java.lang.Object {
public final /*constructor*/ fun <init>(/*0*/ p0: jet.Int, /*1*/ p1: jet.Int, /*2*/ p2: java.util.ArrayList<jet.String>): test.ConstructorWithSeveralParams
}
@@ -0,0 +1,10 @@
package test;
import java.util.*;
import jet.runtime.typeinfo.KotlinSignature;
public class ConstructorWithoutParams {
@KotlinSignature("fun ConstructorWithoutParams()")
public ConstructorWithoutParams() {
}
}
@@ -0,0 +1,4 @@
package test
public open class ConstructorWithoutParams() : java.lang.Object() {
}
@@ -0,0 +1,5 @@
namespace test
public open class test.ConstructorWithoutParams : java.lang.Object {
public final /*constructor*/ fun <init>(): test.ConstructorWithoutParams
}
@@ -15,16 +15,13 @@
*/
package org.jetbrains.jet.jvm.compiler;
import junit.framework.Assert;
import junit.framework.Test;
import junit.framework.TestSuite;
import java.io.File;
import org.jetbrains.jet.JetTestUtils;
import org.jetbrains.jet.test.InnerTestClasses;
import org.jetbrains.jet.test.TestMetadata;
import org.jetbrains.jet.jvm.compiler.AbstractLoadJavaTest;
import java.io.File;
/** This class is generated by {@link org.jetbrains.jet.jvm.compiler.AbstractLoadJavaTest}. DO NOT MODIFY MANUALLY */
@TestMetadata("compiler/testData/loadJava")
@@ -240,6 +237,26 @@ public class LoadJavaTestGenerated extends AbstractLoadJavaTest {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.jvm.compiler.AbstractLoadJavaTest", new File("compiler/testData/loadJava/kotlinSignature"), "java", true);
}
@TestMetadata("ConstructorWithNewTypeParams.java")
public void testConstructorWithNewTypeParams() throws Exception {
doTest("compiler/testData/loadJava/kotlinSignature/ConstructorWithNewTypeParams.java");
}
@TestMetadata("ConstructorWithParentTypeParams.java")
public void testConstructorWithParentTypeParams() throws Exception {
doTest("compiler/testData/loadJava/kotlinSignature/ConstructorWithParentTypeParams.java");
}
@TestMetadata("ConstructorWithSeveralParams.java")
public void testConstructorWithSeveralParams() throws Exception {
doTest("compiler/testData/loadJava/kotlinSignature/ConstructorWithSeveralParams.java");
}
@TestMetadata("ConstructorWithoutParams.java")
public void testConstructorWithoutParams() throws Exception {
doTest("compiler/testData/loadJava/kotlinSignature/ConstructorWithoutParams.java");
}
@TestMetadata("MethodWithFunctionTypes.java")
public void testMethodWithFunctionTypes() throws Exception {
doTest("compiler/testData/loadJava/kotlinSignature/MethodWithFunctionTypes.java");
@@ -15,16 +15,13 @@
*/
package org.jetbrains.jet.lang.resolve.lazy;
import junit.framework.Assert;
import junit.framework.Test;
import junit.framework.TestSuite;
import java.io.File;
import org.jetbrains.jet.JetTestUtils;
import org.jetbrains.jet.test.InnerTestClasses;
import org.jetbrains.jet.test.TestMetadata;
import org.jetbrains.jet.lang.resolve.lazy.AbstractLazyResolveNamespaceComparingTest;
import java.io.File;
/** This class is generated by {@link org.jetbrains.jet.lang.resolve.lazy.AbstractLazyResolveNamespaceComparingTest}. DO NOT MODIFY MANUALLY */
@InnerTestClasses({LazyResolveNamespaceComparingTestGenerated.LoadKotlin.class, LazyResolveNamespaceComparingTestGenerated.LoadJava.class, LazyResolveNamespaceComparingTestGenerated.NamespaceComparator.class})
@@ -1125,6 +1122,26 @@ public class LazyResolveNamespaceComparingTestGenerated extends AbstractLazyReso
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.lang.resolve.lazy.AbstractLazyResolveNamespaceComparingTest", new File("compiler/testData/loadJava/kotlinSignature"), "kt", true);
}
@TestMetadata("ConstructorWithNewTypeParams.kt")
public void testConstructorWithNewTypeParams() throws Exception {
doTestSinglePackage("compiler/testData/loadJava/kotlinSignature/ConstructorWithNewTypeParams.kt");
}
@TestMetadata("ConstructorWithParentTypeParams.kt")
public void testConstructorWithParentTypeParams() throws Exception {
doTestSinglePackage("compiler/testData/loadJava/kotlinSignature/ConstructorWithParentTypeParams.kt");
}
@TestMetadata("ConstructorWithSeveralParams.kt")
public void testConstructorWithSeveralParams() throws Exception {
doTestSinglePackage("compiler/testData/loadJava/kotlinSignature/ConstructorWithSeveralParams.kt");
}
@TestMetadata("ConstructorWithoutParams.kt")
public void testConstructorWithoutParams() throws Exception {
doTestSinglePackage("compiler/testData/loadJava/kotlinSignature/ConstructorWithoutParams.kt");
}
@TestMetadata("MethodWithFunctionTypes.kt")
public void testMethodWithFunctionTypes() throws Exception {
doTestSinglePackage("compiler/testData/loadJava/kotlinSignature/MethodWithFunctionTypes.kt");