From d36907bc8fa9658c1e7ece6c9416482641e2718b Mon Sep 17 00:00:00 2001 From: Alexey Tsvetkov Date: Wed, 9 Aug 2017 23:15:51 +0300 Subject: [PATCH] Add proto comparison tests where members annotations are changed Original commit: 0d3b882852e0c71d3c1eecf77341717f8f0f52a9 --- .../JsProtoComparisonTestGenerated.java | 12 +++++++++ .../JvmProtoComparisonTestGenerated.java | 12 +++++++++ .../membersAnnotationListChanged/new.kt | 22 ++++++++++++++++ .../membersAnnotationListChanged/old.kt | 26 +++++++++++++++++++ .../result-js.out | 3 +++ .../membersAnnotationListChanged/result.out | 3 +++ .../membersAnnotationListChanged/new.kt | 20 ++++++++++++++ .../membersAnnotationListChanged/old.kt | 20 ++++++++++++++ .../result-js.out | 3 +++ .../membersAnnotationListChanged/result.out | 3 +++ 10 files changed, 124 insertions(+) create mode 100644 jps/jps-plugin/testData/comparison/classMembersOnlyChanged/membersAnnotationListChanged/new.kt create mode 100644 jps/jps-plugin/testData/comparison/classMembersOnlyChanged/membersAnnotationListChanged/old.kt create mode 100644 jps/jps-plugin/testData/comparison/classMembersOnlyChanged/membersAnnotationListChanged/result-js.out create mode 100644 jps/jps-plugin/testData/comparison/classMembersOnlyChanged/membersAnnotationListChanged/result.out create mode 100644 jps/jps-plugin/testData/comparison/packageMembers/membersAnnotationListChanged/new.kt create mode 100644 jps/jps-plugin/testData/comparison/packageMembers/membersAnnotationListChanged/old.kt create mode 100644 jps/jps-plugin/testData/comparison/packageMembers/membersAnnotationListChanged/result-js.out create mode 100644 jps/jps-plugin/testData/comparison/packageMembers/membersAnnotationListChanged/result.out diff --git a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/incremental/JsProtoComparisonTestGenerated.java b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/incremental/JsProtoComparisonTestGenerated.java index 27376f3b2e9..7274b9c9438 100644 --- a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/incremental/JsProtoComparisonTestGenerated.java +++ b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/incremental/JsProtoComparisonTestGenerated.java @@ -188,6 +188,12 @@ public class JsProtoComparisonTestGenerated extends AbstractJsProtoComparisonTes doTest(fileName); } + @TestMetadata("membersAnnotationListChanged") + public void testMembersAnnotationListChanged() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/comparison/classMembersOnlyChanged/membersAnnotationListChanged/"); + doTest(fileName); + } + @TestMetadata("membersFlagsChanged") public void testMembersFlagsChanged() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/comparison/classMembersOnlyChanged/membersFlagsChanged/"); @@ -221,6 +227,12 @@ public class JsProtoComparisonTestGenerated extends AbstractJsProtoComparisonTes doTest(fileName); } + @TestMetadata("membersAnnotationListChanged") + public void testMembersAnnotationListChanged() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/comparison/packageMembers/membersAnnotationListChanged/"); + doTest(fileName); + } + @TestMetadata("membersFlagsChanged") public void testMembersFlagsChanged() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/comparison/packageMembers/membersFlagsChanged/"); diff --git a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/incremental/JvmProtoComparisonTestGenerated.java b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/incremental/JvmProtoComparisonTestGenerated.java index 422ca0e61fb..47455cfd8c7 100644 --- a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/incremental/JvmProtoComparisonTestGenerated.java +++ b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/incremental/JvmProtoComparisonTestGenerated.java @@ -188,6 +188,12 @@ public class JvmProtoComparisonTestGenerated extends AbstractJvmProtoComparisonT doTest(fileName); } + @TestMetadata("membersAnnotationListChanged") + public void testMembersAnnotationListChanged() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/comparison/classMembersOnlyChanged/membersAnnotationListChanged/"); + doTest(fileName); + } + @TestMetadata("membersFlagsChanged") public void testMembersFlagsChanged() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/comparison/classMembersOnlyChanged/membersFlagsChanged/"); @@ -221,6 +227,12 @@ public class JvmProtoComparisonTestGenerated extends AbstractJvmProtoComparisonT doTest(fileName); } + @TestMetadata("membersAnnotationListChanged") + public void testMembersAnnotationListChanged() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/comparison/packageMembers/membersAnnotationListChanged/"); + doTest(fileName); + } + @TestMetadata("membersFlagsChanged") public void testMembersFlagsChanged() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/comparison/packageMembers/membersFlagsChanged/"); diff --git a/jps/jps-plugin/testData/comparison/classMembersOnlyChanged/membersAnnotationListChanged/new.kt b/jps/jps-plugin/testData/comparison/classMembersOnlyChanged/membersAnnotationListChanged/new.kt new file mode 100644 index 00000000000..b3b358a2685 --- /dev/null +++ b/jps/jps-plugin/testData/comparison/classMembersOnlyChanged/membersAnnotationListChanged/new.kt @@ -0,0 +1,22 @@ +package test + +annotation class Ann1 +annotation class Ann2 + +class A { + @Ann1 + @Ann2 + fun annotationListBecameNotEmpty() {} + + fun annotationListBecameEmpty() {} + + @Ann1 + @Ann2 + fun annotationAdded() {} + + @Ann1 + fun annotationRemoved() {} + + @Ann2 + fun annotationReplaced() {} +} \ No newline at end of file diff --git a/jps/jps-plugin/testData/comparison/classMembersOnlyChanged/membersAnnotationListChanged/old.kt b/jps/jps-plugin/testData/comparison/classMembersOnlyChanged/membersAnnotationListChanged/old.kt new file mode 100644 index 00000000000..555cf728821 --- /dev/null +++ b/jps/jps-plugin/testData/comparison/classMembersOnlyChanged/membersAnnotationListChanged/old.kt @@ -0,0 +1,26 @@ +package test + +annotation class Ann1 +annotation class Ann2 + +class A { + fun annotationListBecameNotEmpty() {} + + @Ann1 + @Ann2 + fun annotationListBecameEmpty() { + } + + @Ann1 + fun annotationAdded() { + } + + @Ann1 + @Ann2 + fun annotationRemoved() { + } + + @Ann1 + fun annotationReplaced() { + } +} diff --git a/jps/jps-plugin/testData/comparison/classMembersOnlyChanged/membersAnnotationListChanged/result-js.out b/jps/jps-plugin/testData/comparison/classMembersOnlyChanged/membersAnnotationListChanged/result-js.out new file mode 100644 index 00000000000..bab37471ef4 --- /dev/null +++ b/jps/jps-plugin/testData/comparison/classMembersOnlyChanged/membersAnnotationListChanged/result-js.out @@ -0,0 +1,3 @@ +PROTO DIFFERENCE in test/A: FUNCTION_LIST +CHANGES in test/A: MEMBERS + [annotationAdded, annotationListBecameEmpty, annotationListBecameNotEmpty, annotationRemoved, annotationReplaced] diff --git a/jps/jps-plugin/testData/comparison/classMembersOnlyChanged/membersAnnotationListChanged/result.out b/jps/jps-plugin/testData/comparison/classMembersOnlyChanged/membersAnnotationListChanged/result.out new file mode 100644 index 00000000000..b5e1a1ed171 --- /dev/null +++ b/jps/jps-plugin/testData/comparison/classMembersOnlyChanged/membersAnnotationListChanged/result.out @@ -0,0 +1,3 @@ +PROTO DIFFERENCE in test/A: FUNCTION_LIST +CHANGES in test/A: MEMBERS + [annotationListBecameEmpty, annotationListBecameNotEmpty] diff --git a/jps/jps-plugin/testData/comparison/packageMembers/membersAnnotationListChanged/new.kt b/jps/jps-plugin/testData/comparison/packageMembers/membersAnnotationListChanged/new.kt new file mode 100644 index 00000000000..51b46517e9a --- /dev/null +++ b/jps/jps-plugin/testData/comparison/packageMembers/membersAnnotationListChanged/new.kt @@ -0,0 +1,20 @@ +package test + +annotation class Ann1 +annotation class Ann2 + +@Ann1 +@Ann2 +fun annotationListBecameNotEmpty() {} + +fun annotationListBecameEmpty() {} + +@Ann1 +@Ann2 +fun annotationAdded() {} + +@Ann1 +fun annotationRemoved() {} + +@Ann2 +fun annotationReplaced() {} diff --git a/jps/jps-plugin/testData/comparison/packageMembers/membersAnnotationListChanged/old.kt b/jps/jps-plugin/testData/comparison/packageMembers/membersAnnotationListChanged/old.kt new file mode 100644 index 00000000000..3d39ec4b409 --- /dev/null +++ b/jps/jps-plugin/testData/comparison/packageMembers/membersAnnotationListChanged/old.kt @@ -0,0 +1,20 @@ +package test + +annotation class Ann1 +annotation class Ann2 + +fun annotationListBecameNotEmpty() {} + +@Ann1 +@Ann2 +fun annotationListBecameEmpty() {} + +@Ann1 +fun annotationAdded() {} + +@Ann1 +@Ann2 +fun annotationRemoved() {} + +@Ann1 +fun annotationReplaced() {} diff --git a/jps/jps-plugin/testData/comparison/packageMembers/membersAnnotationListChanged/result-js.out b/jps/jps-plugin/testData/comparison/packageMembers/membersAnnotationListChanged/result-js.out new file mode 100644 index 00000000000..fb07de09253 --- /dev/null +++ b/jps/jps-plugin/testData/comparison/packageMembers/membersAnnotationListChanged/result-js.out @@ -0,0 +1,3 @@ +PROTO DIFFERENCE in test/MainKt: FUNCTION_LIST +CHANGES in test/MainKt: MEMBERS + [annotationAdded, annotationListBecameEmpty, annotationListBecameNotEmpty, annotationRemoved, annotationReplaced] diff --git a/jps/jps-plugin/testData/comparison/packageMembers/membersAnnotationListChanged/result.out b/jps/jps-plugin/testData/comparison/packageMembers/membersAnnotationListChanged/result.out new file mode 100644 index 00000000000..5a48016fb07 --- /dev/null +++ b/jps/jps-plugin/testData/comparison/packageMembers/membersAnnotationListChanged/result.out @@ -0,0 +1,3 @@ +PROTO DIFFERENCE in test/MainKt: FUNCTION_LIST +CHANGES in test/MainKt: MEMBERS + [annotationListBecameEmpty, annotationListBecameNotEmpty]