mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[tests] test cases added
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
|
||||
// IntelliJ API Decompiler stub source generated from a class file
|
||||
// Implementation of methods is not available
|
||||
|
||||
package pkg;
|
||||
|
||||
class MemberAnnotations {
|
||||
@pkg.MemberAnnotations.A("const")
|
||||
public static final int CONST = 42;
|
||||
@pkg.MemberAnnotations.A("field")
|
||||
private int f;
|
||||
|
||||
MemberAnnotations() { /* compiled code */ }
|
||||
|
||||
@pkg.MemberAnnotations.A("return")
|
||||
private int f(@pkg.MemberAnnotations.A("arg") int i) { /* compiled code */ }
|
||||
|
||||
@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME)
|
||||
static @interface A {
|
||||
java.lang.String value() default "";
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,13 @@
|
||||
package pkg;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
class MemberAnnotations {
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@interface A { String value() default ""; }
|
||||
|
||||
@A("const") public static final int CONST = 42;
|
||||
@A("field") private int f;
|
||||
|
||||
@A("return") private int f(@A("arg") int i) { return i + f + CONST; }
|
||||
}
|
||||
@@ -45,6 +45,7 @@ public class ClsMirrorBuildingTest extends LightIdeaTestCase {
|
||||
public void testDeprecated() { doTest(); }
|
||||
public void testAnnotations() { doTest(); }
|
||||
public void testMoreAnnotations() { doTest(); }
|
||||
public void testMemberAnnotations() { doTest(); }
|
||||
public void testParameterNames() { doTest(); }
|
||||
public void testEmptyEnum() { doTest(); }
|
||||
public void test$BuckClass() { doTest(); }
|
||||
|
||||
+1
@@ -81,6 +81,7 @@ public class SingleClassesTest {
|
||||
@Test public void testJava9StringConcat() { doTest("java9/TestJava9StringConcat"); }
|
||||
@Test public void testMethodReferenceSameName() { doTest("pkg/TestMethodReferenceSameName"); }
|
||||
@Test public void testMethodReferenceLetterClass() { doTest("pkg/TestMethodReferenceLetterClass"); }
|
||||
@Test public void testMemberAnnotations() { doTest("pkg/TestMemberAnnotations"); }
|
||||
|
||||
protected void doTest(String testFile, String... companionFiles) {
|
||||
ConsoleDecompiler decompiler = fixture.getDecompiler();
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,34 @@
|
||||
package pkg;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
class TestMemberAnnotations {
|
||||
@TestMemberAnnotations.A("const")
|
||||
public static final int CONST = 42;
|
||||
@TestMemberAnnotations.A("field")
|
||||
private int f;
|
||||
|
||||
@TestMemberAnnotations.A("return")
|
||||
private int f(@TestMemberAnnotations.A("arg") int var1) {
|
||||
return var1 + this.f + 42;// 12
|
||||
}
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@interface A {
|
||||
String value() default "";
|
||||
}
|
||||
}
|
||||
|
||||
class 'pkg/TestMemberAnnotations' {
|
||||
method 'f (I)I' {
|
||||
2 13
|
||||
5 13
|
||||
6 13
|
||||
8 13
|
||||
9 13
|
||||
}
|
||||
}
|
||||
|
||||
Lines mapping:
|
||||
12 <-> 14
|
||||
@@ -0,0 +1,13 @@
|
||||
package pkg;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
class TestMemberAnnotations {
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@interface A { String value() default ""; }
|
||||
|
||||
@A("const") public static final int CONST = 42;
|
||||
@A("field") private int f;
|
||||
|
||||
@A("return") private int f(@A("arg") int i) { return i + f + CONST; }
|
||||
}
|
||||
Reference in New Issue
Block a user