Refine loading annotation parameters from java

- Parameter named `value` is always first
- Array parameter represented as vararg iff its name is `value` and all
  other parameters have default values

 #KT-2576 Fixed
 #KT-6641 Fixed
 #KT-6220 Fixed
 #KT-6652 Fixed
This commit is contained in:
Denis Zharkov
2015-04-06 15:41:57 +03:00
parent 84ed0e7255
commit 9b1443954f
15 changed files with 260 additions and 29 deletions
@@ -54,6 +54,7 @@ public class JetDiagnosticsTestWithStdLibGenerated extends AbstractJetDiagnostic
@InnerTestClasses({
Annotations.AnnotationApplicability.class,
Annotations.AnnotationParameterMustBeConstant.class,
Annotations.AnnotationParameters.class,
Annotations.AnnotationWithVarargParameter.class,
Annotations.JvmOverloads.class,
Annotations.PlatformStatic.class,
@@ -130,6 +131,45 @@ public class JetDiagnosticsTestWithStdLibGenerated extends AbstractJetDiagnostic
}
}
@TestMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class AnnotationParameters extends AbstractJetDiagnosticsTestWithStdLib {
public void testAllFilesPresentInAnnotationParameters() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("orderWithValue.kt")
public void testOrderWithValue() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/orderWithValue.kt");
doTest(fileName);
}
@TestMetadata("orderWithoutValue.kt")
public void testOrderWithoutValue() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/orderWithoutValue.kt");
doTest(fileName);
}
@TestMetadata("valueArray.kt")
public void testValueArray() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArray.kt");
doTest(fileName);
}
@TestMetadata("valueArrayAndOtherDefault.kt")
public void testValueArrayAndOtherDefault() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayAndOtherDefault.kt");
doTest(fileName);
}
@TestMetadata("valueArrayOnly.kt")
public void testValueArrayOnly() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayOnly.kt");
doTest(fileName);
}
}
@TestMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/annotationWithVarargParameter")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)