Don't break the world if enum in annotation isn't found
This commit is contained in:
+3
-1
@@ -34,6 +34,7 @@ import org.jetbrains.jet.lang.resolve.BindingContext;
|
||||
import org.jetbrains.jet.lang.resolve.java.AnalyzerFacadeForJVM;
|
||||
import org.jetbrains.jet.lang.resolve.name.FqName;
|
||||
import org.jetbrains.jet.test.TestCaseWithTmpdir;
|
||||
import org.jetbrains.jet.test.util.DescriptorValidator;
|
||||
import org.jetbrains.jet.test.util.NamespaceComparator;
|
||||
import org.junit.Assert;
|
||||
|
||||
@@ -70,7 +71,8 @@ public abstract class AbstractCompileKotlinAgainstCustomJavaTest extends TestCas
|
||||
NamespaceDescriptor namespaceDescriptor = bindingContext.get(BindingContext.FQNAME_TO_NAMESPACE_DESCRIPTOR, namespaceFqn);
|
||||
assertNotNull("Failed to find namespace: " + namespaceFqn, namespaceDescriptor);
|
||||
|
||||
validateAndCompareNamespaceWithFile(namespaceDescriptor, NamespaceComparator.DONT_INCLUDE_METHODS_OF_OBJECT, expectedFile);
|
||||
validateAndCompareNamespaceWithFile(namespaceDescriptor, NamespaceComparator.DONT_INCLUDE_METHODS_OF_OBJECT.withValidationStrategy(
|
||||
DescriptorValidator.ValidationVisitor.ALLOW_ERROR_TYPES), expectedFile);
|
||||
}
|
||||
|
||||
private JetCoreEnvironment getEnvironment(File ktFile) {
|
||||
|
||||
+15
-1
@@ -31,7 +31,7 @@ import org.jetbrains.jet.jvm.compiler.AbstractCompileKotlinAgainstCustomJavaTest
|
||||
/** This class is generated by {@link org.jetbrains.jet.generators.tests.GenerateTests}. DO NOT MODIFY MANUALLY */
|
||||
@SuppressWarnings("all")
|
||||
@TestMetadata("compiler/testData/compileKotlinAgainstCustomJava")
|
||||
@InnerTestClasses({CompileKotlinAgainstCustomJavaGenerated.DuplicateLibraries.class})
|
||||
@InnerTestClasses({CompileKotlinAgainstCustomJavaGenerated.DuplicateLibraries.class, CompileKotlinAgainstCustomJavaGenerated.MissingEnumReferencedInAnnotation.class})
|
||||
public class CompileKotlinAgainstCustomJavaGenerated extends AbstractCompileKotlinAgainstCustomJavaTest {
|
||||
public void testAllFilesPresentInCompileKotlinAgainstCustomJava() throws Exception {
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/compileKotlinAgainstCustomJava"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
@@ -50,10 +50,24 @@ public class CompileKotlinAgainstCustomJavaGenerated extends AbstractCompileKotl
|
||||
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/compileKotlinAgainstCustomJava/missingEnumReferencedInAnnotation")
|
||||
public static class MissingEnumReferencedInAnnotation extends AbstractCompileKotlinAgainstCustomJavaTest {
|
||||
public void testAllFilesPresentInMissingEnumReferencedInAnnotation() throws Exception {
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/compileKotlinAgainstCustomJava/missingEnumReferencedInAnnotation"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("MissingEnumReferencedInAnnotation.kt")
|
||||
public void testMissingEnumReferencedInAnnotation() throws Exception {
|
||||
doTest("compiler/testData/compileKotlinAgainstCustomJava/missingEnumReferencedInAnnotation/MissingEnumReferencedInAnnotation.kt");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static Test suite() {
|
||||
TestSuite suite = new TestSuite("CompileKotlinAgainstCustomJavaGenerated");
|
||||
suite.addTestSuite(CompileKotlinAgainstCustomJavaGenerated.class);
|
||||
suite.addTestSuite(DuplicateLibraries.class);
|
||||
suite.addTestSuite(MissingEnumReferencedInAnnotation.class);
|
||||
return suite;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user