Test for static
This commit is contained in:
@@ -29,6 +29,7 @@ import org.jetbrains.jet.lang.psi.JetFile;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static org.jetbrains.jet.InTextDirectivesUtils.findListWithPrefixes;
|
||||
@@ -39,7 +40,17 @@ import static org.jetbrains.jet.InTextDirectivesUtils.findStringWithPrefixes;
|
||||
*
|
||||
* TESTED_OBJECT_KIND - maybe class, function or property
|
||||
* TESTED_OBJECTS - className, [function/property name]
|
||||
* FLAGS - only flags which must be true
|
||||
* FLAGS - only flags which must be true (could be skipped if ABSENT is TRUE)
|
||||
* ABSENT - true or false, optional (false by default)
|
||||
*
|
||||
* There is could be specified several tested objects separated by empty line, e.g:
|
||||
* TESTED_OBJECT_KIND: property
|
||||
* TESTED_OBJECTS: Test$object, prop
|
||||
* ABSENT: TRUE
|
||||
*
|
||||
* TESTED_OBJECT_KIND: property
|
||||
* TESTED_OBJECTS: Test, prop$delegate
|
||||
* FLAGS: ACC_STATIC, ACC_FINAL, ACC_PRIVATE
|
||||
*/
|
||||
public abstract class AbstractWriteFlagsTest extends UsefulTestCase {
|
||||
|
||||
@@ -61,59 +72,78 @@ public abstract class AbstractWriteFlagsTest extends UsefulTestCase {
|
||||
File ktFile = new File(path);
|
||||
assertTrue("Cannot find a file " + ktFile.getAbsolutePath(), ktFile.exists());
|
||||
|
||||
String fileText = FileUtil.loadFile(ktFile);
|
||||
String fileText = FileUtil.loadFile(ktFile, true);
|
||||
|
||||
JetFile psiFile = JetTestUtils.createFile(ktFile.getName(), fileText, jetCoreEnvironment.getProject());
|
||||
assertTrue("Cannot create JetFile from text", psiFile != null);
|
||||
|
||||
ClassFileFactory factory = GenerationUtils.compileFileGetClassFileFactoryForTest(psiFile);
|
||||
|
||||
TestedObject testedObject = parseExpectedTestedObject(fileText);
|
||||
|
||||
String className = null;
|
||||
for (String filename : factory.files()) {
|
||||
if (testedObject.isFullContainingClassName && filename.equals(testedObject.containingClass + ".class")) {
|
||||
className = filename;
|
||||
List<TestedObject> testedObjects = parseExpectedTestedObject(fileText);
|
||||
for (TestedObject testedObject : testedObjects) {
|
||||
String className = null;
|
||||
for (String filename : factory.files()) {
|
||||
if (testedObject.isFullContainingClassName && filename.equals(testedObject.containingClass + ".class")) {
|
||||
className = filename;
|
||||
}
|
||||
else if (!testedObject.isFullContainingClassName && filename.startsWith(testedObject.containingClass)) {
|
||||
className = filename;
|
||||
}
|
||||
}
|
||||
else if (!testedObject.isFullContainingClassName && filename.startsWith(testedObject.containingClass)) {
|
||||
className = filename;
|
||||
|
||||
if (className == null) {
|
||||
throw new AssertionError("Couldn't find a class file with name " + testedObject.containingClass);
|
||||
}
|
||||
|
||||
ClassReader cr = new ClassReader(factory.asBytes(className));
|
||||
TestClassVisitor classVisitor;
|
||||
classVisitor = getClassVisitor(testedObject.kind, testedObject.name);
|
||||
cr.accept(classVisitor, ClassReader.SKIP_CODE);
|
||||
|
||||
boolean isObjectExists = false == Boolean.valueOf(findStringWithPrefixes(testedObject.textData, "// ABSENT: "));
|
||||
assertEquals( "Wrong object existence state: " + testedObject, isObjectExists, classVisitor.isExists());
|
||||
int expectedAccess = getExpectedFlags(testedObject.textData);
|
||||
|
||||
if (isObjectExists) {
|
||||
assertEquals("Wrong access flag \n" + factory.asText(className), expectedAccess, classVisitor.getAccess());
|
||||
}
|
||||
}
|
||||
|
||||
if (className == null) {
|
||||
throw new AssertionError("Couldn't find a class file with name " + testedObject.containingClass);
|
||||
}
|
||||
|
||||
ClassReader cr = new ClassReader(factory.asBytes(className));
|
||||
TestClassVisitor classVisitor;
|
||||
classVisitor = getClassVisitor(testedObject.kind, testedObject.name);
|
||||
cr.accept(classVisitor, ClassReader.SKIP_CODE);
|
||||
int expectedAccess = getExpectedFlags(fileText);
|
||||
assertEquals("Wrong access flag \n" + factory.asText(className), expectedAccess, classVisitor.getAccess());
|
||||
}
|
||||
|
||||
private static TestedObject parseExpectedTestedObject(String fileText) {
|
||||
TestedObject result = new TestedObject();
|
||||
List<String> testedObjects = findListWithPrefixes(fileText, "// TESTED_OBJECTS: ");
|
||||
assertTrue("Cannot find TESTED_OBJECTS instruction", !testedObjects.isEmpty());
|
||||
result.containingClass = testedObjects.get(0);
|
||||
if (testedObjects.size() == 1) {
|
||||
result.name = testedObjects.get(0);
|
||||
}
|
||||
else if (testedObjects.size() == 2) {
|
||||
result.name = testedObjects.get(1);
|
||||
}
|
||||
else {
|
||||
throw new IllegalArgumentException(
|
||||
"TESTED_OBJECTS instruction must contains one (for class) or two (for function and property) values");
|
||||
}
|
||||
private static List<TestedObject> parseExpectedTestedObject(String testDescription) {
|
||||
testDescription = testDescription.substring(testDescription.indexOf("// TESTED_OBJECT_KIND"));
|
||||
String [] testObjectData = testDescription.split("\n\n");
|
||||
ArrayList<TestedObject> objects = new ArrayList<TestedObject>();
|
||||
|
||||
result.kind = findStringWithPrefixes(fileText, "// TESTED_OBJECT_KIND: ");
|
||||
List<String> isFullName = findListWithPrefixes(fileText, "// IS_FULL_CONTAINING_CLASS_NAME: ");
|
||||
if (isFullName.size() == 1) {
|
||||
result.isFullContainingClassName = Boolean.parseBoolean(isFullName.get(0));
|
||||
for (int i = 0; i < testObjectData.length; i++) {
|
||||
String testData = testObjectData[i];
|
||||
if (!testData.isEmpty()) {
|
||||
TestedObject testObject = new TestedObject();
|
||||
testObject.textData = testData;
|
||||
List<String> testedObjects = findListWithPrefixes(testData, "// TESTED_OBJECTS: ");
|
||||
assertTrue("Cannot find TESTED_OBJECTS instruction", !testedObjects.isEmpty());
|
||||
testObject.containingClass = testedObjects.get(0);
|
||||
if (testedObjects.size() == 1) {
|
||||
testObject.name = testedObjects.get(0);
|
||||
}
|
||||
else if (testedObjects.size() == 2) {
|
||||
testObject.name = testedObjects.get(1);
|
||||
}
|
||||
else {
|
||||
throw new IllegalArgumentException(
|
||||
"TESTED_OBJECTS instruction must contains one (for class) or two (for function and property) values");
|
||||
}
|
||||
|
||||
testObject.kind = findStringWithPrefixes(testData, "// TESTED_OBJECT_KIND: ");
|
||||
List<String> isFullName = findListWithPrefixes(testData, "// IS_FULL_CONTAINING_CLASS_NAME: ");
|
||||
if (isFullName.size() == 1) {
|
||||
testObject.isFullContainingClassName = Boolean.parseBoolean(isFullName.get(0));
|
||||
}
|
||||
objects.add(testObject);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
assertTrue("Test description not present!", !objects.isEmpty());
|
||||
return objects;
|
||||
}
|
||||
|
||||
private static class TestedObject {
|
||||
@@ -121,6 +151,12 @@ public abstract class AbstractWriteFlagsTest extends UsefulTestCase {
|
||||
public String containingClass = "";
|
||||
public boolean isFullContainingClassName = true;
|
||||
public String kind;
|
||||
public String textData;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Class = " + containingClass + ", name = " + name + ", kind = " + kind;
|
||||
}
|
||||
}
|
||||
|
||||
private static TestClassVisitor getClassVisitor(String visitorKind, String testedObjectName) {
|
||||
@@ -136,15 +172,23 @@ public abstract class AbstractWriteFlagsTest extends UsefulTestCase {
|
||||
else if (visitorKind.equals("innerClass")) {
|
||||
return new InnerClassFlagsVisitor(testedObjectName);
|
||||
}
|
||||
|
||||
throw new IllegalArgumentException("Value of TESTED_OBJECT_KIND is incorrect: " + visitorKind);
|
||||
}
|
||||
|
||||
protected static abstract class TestClassVisitor extends ClassVisitor {
|
||||
|
||||
protected boolean isExists;
|
||||
|
||||
public TestClassVisitor() {
|
||||
super(Opcodes.ASM4);
|
||||
}
|
||||
|
||||
abstract public int getAccess();
|
||||
|
||||
public boolean isExists() {
|
||||
return isExists;
|
||||
}
|
||||
}
|
||||
|
||||
private static int getExpectedFlags(String text) {
|
||||
@@ -172,6 +216,7 @@ public abstract class AbstractWriteFlagsTest extends UsefulTestCase {
|
||||
@Override
|
||||
public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
|
||||
this.access = access;
|
||||
isExists = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -192,6 +237,7 @@ public abstract class AbstractWriteFlagsTest extends UsefulTestCase {
|
||||
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
|
||||
if (name.equals(funName)) {
|
||||
this.access = access;
|
||||
isExists = true;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -214,6 +260,7 @@ public abstract class AbstractWriteFlagsTest extends UsefulTestCase {
|
||||
public FieldVisitor visitField(int access, String name, String desc, String signature, Object value) {
|
||||
if (name.equals(propertyName)) {
|
||||
this.access = access;
|
||||
isExists = true;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -236,6 +283,7 @@ public abstract class AbstractWriteFlagsTest extends UsefulTestCase {
|
||||
public void visitInnerClass(String innerClassInternalName, String outerClassInternalName, String name, int access) {
|
||||
if (name.equals(innerClassName)) {
|
||||
this.access = access;
|
||||
isExists = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -466,12 +466,234 @@ public class WriteFlagsTestGenerated extends AbstractWriteFlagsTest {
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/writeFlags/property")
|
||||
@InnerTestClasses({Property.DeprecatedFlag.class, Property.Visibility.class})
|
||||
@InnerTestClasses({Property.ClassObject.class, Property.DeprecatedFlag.class, Property.Visibility.class})
|
||||
public static class Property extends AbstractWriteFlagsTest {
|
||||
public void testAllFilesPresentInProperty() throws Exception {
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/writeFlags/property"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/writeFlags/property/classObject")
|
||||
@InnerTestClasses({ClassObject.Class.class, ClassObject.Trait.class})
|
||||
public static class ClassObject extends AbstractWriteFlagsTest {
|
||||
public void testAllFilesPresentInClassObject() throws Exception {
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/writeFlags/property/classObject"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/writeFlags/property/classObject/class")
|
||||
public static class Class extends AbstractWriteFlagsTest {
|
||||
public void testAllFilesPresentInClass() throws Exception {
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/writeFlags/property/classObject/class"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("delegatedProtectedVar.kt")
|
||||
public void testDelegatedProtectedVar() throws Exception {
|
||||
doTest("compiler/testData/writeFlags/property/classObject/class/delegatedProtectedVar.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("delegatedPublicVal.kt")
|
||||
public void testDelegatedPublicVal() throws Exception {
|
||||
doTest("compiler/testData/writeFlags/property/classObject/class/delegatedPublicVal.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("extensionPublicVal.kt")
|
||||
public void testExtensionPublicVal() throws Exception {
|
||||
doTest("compiler/testData/writeFlags/property/classObject/class/extensionPublicVal.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("extensionPublicVar.kt")
|
||||
public void testExtensionPublicVar() throws Exception {
|
||||
doTest("compiler/testData/writeFlags/property/classObject/class/extensionPublicVar.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("internalVal.kt")
|
||||
public void testInternalVal() throws Exception {
|
||||
doTest("compiler/testData/writeFlags/property/classObject/class/internalVal.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("internalVar.kt")
|
||||
public void testInternalVar() throws Exception {
|
||||
doTest("compiler/testData/writeFlags/property/classObject/class/internalVar.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("internalVarPrivateSet.kt")
|
||||
public void testInternalVarPrivateSet() throws Exception {
|
||||
doTest("compiler/testData/writeFlags/property/classObject/class/internalVarPrivateSet.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("noBackingField.kt")
|
||||
public void testNoBackingField() throws Exception {
|
||||
doTest("compiler/testData/writeFlags/property/classObject/class/noBackingField.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("privateVal.kt")
|
||||
public void testPrivateVal() throws Exception {
|
||||
doTest("compiler/testData/writeFlags/property/classObject/class/privateVal.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("privateVar.kt")
|
||||
public void testPrivateVar() throws Exception {
|
||||
doTest("compiler/testData/writeFlags/property/classObject/class/privateVar.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("protectedVal.kt")
|
||||
public void testProtectedVal() throws Exception {
|
||||
doTest("compiler/testData/writeFlags/property/classObject/class/protectedVal.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("protectedVarPrivateSet.kt")
|
||||
public void testProtectedVarPrivateSet() throws Exception {
|
||||
doTest("compiler/testData/writeFlags/property/classObject/class/protectedVarPrivateSet.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("publicVal.kt")
|
||||
public void testPublicVal() throws Exception {
|
||||
doTest("compiler/testData/writeFlags/property/classObject/class/publicVal.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("publicValNonDefault.kt")
|
||||
public void testPublicValNonDefault() throws Exception {
|
||||
doTest("compiler/testData/writeFlags/property/classObject/class/publicValNonDefault.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("publicVar.kt")
|
||||
public void testPublicVar() throws Exception {
|
||||
doTest("compiler/testData/writeFlags/property/classObject/class/publicVar.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("publicVarNonDefault.kt")
|
||||
public void testPublicVarNonDefault() throws Exception {
|
||||
doTest("compiler/testData/writeFlags/property/classObject/class/publicVarNonDefault.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("publicVarPrivateSet.kt")
|
||||
public void testPublicVarPrivateSet() throws Exception {
|
||||
doTest("compiler/testData/writeFlags/property/classObject/class/publicVarPrivateSet.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("publicVarProtectedSet.kt")
|
||||
public void testPublicVarProtectedSet() throws Exception {
|
||||
doTest("compiler/testData/writeFlags/property/classObject/class/publicVarProtectedSet.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("publicVarPublicSet.kt")
|
||||
public void testPublicVarPublicSet() throws Exception {
|
||||
doTest("compiler/testData/writeFlags/property/classObject/class/publicVarPublicSet.kt");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/writeFlags/property/classObject/trait")
|
||||
public static class Trait extends AbstractWriteFlagsTest {
|
||||
public void testAllFilesPresentInTrait() throws Exception {
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/writeFlags/property/classObject/trait"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("delegatedProtectedVar.kt")
|
||||
public void testDelegatedProtectedVar() throws Exception {
|
||||
doTest("compiler/testData/writeFlags/property/classObject/trait/delegatedProtectedVar.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("delegatedPublicVal.kt")
|
||||
public void testDelegatedPublicVal() throws Exception {
|
||||
doTest("compiler/testData/writeFlags/property/classObject/trait/delegatedPublicVal.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("extensionPublicVal.kt")
|
||||
public void testExtensionPublicVal() throws Exception {
|
||||
doTest("compiler/testData/writeFlags/property/classObject/trait/extensionPublicVal.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("extensionPublicVar.kt")
|
||||
public void testExtensionPublicVar() throws Exception {
|
||||
doTest("compiler/testData/writeFlags/property/classObject/trait/extensionPublicVar.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("internalVal.kt")
|
||||
public void testInternalVal() throws Exception {
|
||||
doTest("compiler/testData/writeFlags/property/classObject/trait/internalVal.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("internalVar.kt")
|
||||
public void testInternalVar() throws Exception {
|
||||
doTest("compiler/testData/writeFlags/property/classObject/trait/internalVar.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("internalVarPrivateSet.kt")
|
||||
public void testInternalVarPrivateSet() throws Exception {
|
||||
doTest("compiler/testData/writeFlags/property/classObject/trait/internalVarPrivateSet.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("noBackingField.kt")
|
||||
public void testNoBackingField() throws Exception {
|
||||
doTest("compiler/testData/writeFlags/property/classObject/trait/noBackingField.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("privateVal.kt")
|
||||
public void testPrivateVal() throws Exception {
|
||||
doTest("compiler/testData/writeFlags/property/classObject/trait/privateVal.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("privateVar.kt")
|
||||
public void testPrivateVar() throws Exception {
|
||||
doTest("compiler/testData/writeFlags/property/classObject/trait/privateVar.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("protectedVal.kt")
|
||||
public void testProtectedVal() throws Exception {
|
||||
doTest("compiler/testData/writeFlags/property/classObject/trait/protectedVal.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("protectedVarPrivateSet.kt")
|
||||
public void testProtectedVarPrivateSet() throws Exception {
|
||||
doTest("compiler/testData/writeFlags/property/classObject/trait/protectedVarPrivateSet.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("publicVal.kt")
|
||||
public void testPublicVal() throws Exception {
|
||||
doTest("compiler/testData/writeFlags/property/classObject/trait/publicVal.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("publicValNonDefault.kt")
|
||||
public void testPublicValNonDefault() throws Exception {
|
||||
doTest("compiler/testData/writeFlags/property/classObject/trait/publicValNonDefault.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("publicVar.kt")
|
||||
public void testPublicVar() throws Exception {
|
||||
doTest("compiler/testData/writeFlags/property/classObject/trait/publicVar.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("publicVarNonDefault.kt")
|
||||
public void testPublicVarNonDefault() throws Exception {
|
||||
doTest("compiler/testData/writeFlags/property/classObject/trait/publicVarNonDefault.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("publicVarPrivateSet.kt")
|
||||
public void testPublicVarPrivateSet() throws Exception {
|
||||
doTest("compiler/testData/writeFlags/property/classObject/trait/publicVarPrivateSet.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("publicVarProtectedSet.kt")
|
||||
public void testPublicVarProtectedSet() throws Exception {
|
||||
doTest("compiler/testData/writeFlags/property/classObject/trait/publicVarProtectedSet.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("publicVarPublicSet.kt")
|
||||
public void testPublicVarPublicSet() throws Exception {
|
||||
doTest("compiler/testData/writeFlags/property/classObject/trait/publicVarPublicSet.kt");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static Test innerSuite() {
|
||||
TestSuite suite = new TestSuite("ClassObject");
|
||||
suite.addTestSuite(ClassObject.class);
|
||||
suite.addTestSuite(Class.class);
|
||||
suite.addTestSuite(Trait.class);
|
||||
return suite;
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/writeFlags/property/deprecatedFlag")
|
||||
public static class DeprecatedFlag extends AbstractWriteFlagsTest {
|
||||
public void testAllFilesPresentInDeprecatedFlag() throws Exception {
|
||||
@@ -516,6 +738,7 @@ public class WriteFlagsTestGenerated extends AbstractWriteFlagsTest {
|
||||
public static Test innerSuite() {
|
||||
TestSuite suite = new TestSuite("Property");
|
||||
suite.addTestSuite(Property.class);
|
||||
suite.addTest(ClassObject.innerSuite());
|
||||
suite.addTestSuite(DeprecatedFlag.class);
|
||||
suite.addTestSuite(Visibility.class);
|
||||
return suite;
|
||||
|
||||
@@ -3459,6 +3459,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/codegen/box/properties"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("classObjectProperties.kt")
|
||||
public void testClassObjectProperties() throws Exception {
|
||||
doTest("compiler/testData/codegen/box/properties/classObjectProperties.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("generalAccess.kt")
|
||||
public void testGeneralAccess() throws Exception {
|
||||
doTest("compiler/testData/codegen/box/properties/generalAccess.kt");
|
||||
|
||||
+20
-1
@@ -31,7 +31,7 @@ import org.jetbrains.jet.jvm.compiler.AbstractCompileJavaAgainstKotlinTest;
|
||||
/** This class is generated by {@link org.jetbrains.jet.generators.tests.GenerateTests}. DO NOT MODIFY MANUALLY */
|
||||
@SuppressWarnings("all")
|
||||
@TestMetadata("compiler/testData/compileJavaAgainstKotlin")
|
||||
@InnerTestClasses({CompileJavaAgainstKotlinTestGenerated.Class.class, CompileJavaAgainstKotlinTestGenerated.Method.class})
|
||||
@InnerTestClasses({CompileJavaAgainstKotlinTestGenerated.Class.class, CompileJavaAgainstKotlinTestGenerated.Method.class, CompileJavaAgainstKotlinTestGenerated.StaticFields.class})
|
||||
public class CompileJavaAgainstKotlinTestGenerated extends AbstractCompileJavaAgainstKotlinTest {
|
||||
public void testAllFilesPresentInCompileJavaAgainstKotlin() throws Exception {
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/compileJavaAgainstKotlin"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
@@ -183,11 +183,30 @@ public class CompileJavaAgainstKotlinTestGenerated extends AbstractCompileJavaAg
|
||||
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/compileJavaAgainstKotlin/staticFields")
|
||||
public static class StaticFields extends AbstractCompileJavaAgainstKotlinTest {
|
||||
public void testAllFilesPresentInStaticFields() throws Exception {
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/compileJavaAgainstKotlin/staticFields"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("staticClassProperty.kt")
|
||||
public void testStaticClassProperty() throws Exception {
|
||||
doTest("compiler/testData/compileJavaAgainstKotlin/staticFields/staticClassProperty.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("staticTraitProperty.kt")
|
||||
public void testStaticTraitProperty() throws Exception {
|
||||
doTest("compiler/testData/compileJavaAgainstKotlin/staticFields/staticTraitProperty.kt");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static Test suite() {
|
||||
TestSuite suite = new TestSuite("CompileJavaAgainstKotlinTestGenerated");
|
||||
suite.addTestSuite(CompileJavaAgainstKotlinTestGenerated.class);
|
||||
suite.addTestSuite(Class.class);
|
||||
suite.addTestSuite(Method.class);
|
||||
suite.addTestSuite(StaticFields.class);
|
||||
return suite;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -269,6 +269,16 @@ public class LoadCompiledKotlinTestGenerated extends AbstractLoadCompiledKotlinT
|
||||
doTestWithAccessors("compiler/testData/loadKotlin/classObject/ClassObjectExtendsTraitWithTP.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("classObjectInClassStaticFields.kt")
|
||||
public void testClassObjectInClassStaticFields() throws Exception {
|
||||
doTestWithAccessors("compiler/testData/loadKotlin/classObject/classObjectInClassStaticFields.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("classObjectInTraitStaticFields.kt")
|
||||
public void testClassObjectInTraitStaticFields() throws Exception {
|
||||
doTestWithAccessors("compiler/testData/loadKotlin/classObject/classObjectInTraitStaticFields.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("ClassObjectPropertyInClass.kt")
|
||||
public void testClassObjectPropertyInClass() throws Exception {
|
||||
doTestWithAccessors("compiler/testData/loadKotlin/classObject/ClassObjectPropertyInClass.kt");
|
||||
|
||||
+10
@@ -271,6 +271,16 @@ public class LazyResolveNamespaceComparingTestGenerated extends AbstractLazyReso
|
||||
doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/classObject/ClassObjectExtendsTraitWithTP.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("classObjectInClassStaticFields.kt")
|
||||
public void testClassObjectInClassStaticFields() throws Exception {
|
||||
doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/classObject/classObjectInClassStaticFields.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("classObjectInTraitStaticFields.kt")
|
||||
public void testClassObjectInTraitStaticFields() throws Exception {
|
||||
doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/classObject/classObjectInTraitStaticFields.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("ClassObjectPropertyInClass.kt")
|
||||
public void testClassObjectPropertyInClass() throws Exception {
|
||||
doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/classObject/ClassObjectPropertyInClass.kt");
|
||||
|
||||
Reference in New Issue
Block a user