--- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaMethod.java Thu Jan 21 15:07:42 2016 +0100
+++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaMethod.java Thu Jan 21 22:23:22 2016 +0300
@@ -264,21 +264,37 @@
}
}
- @Test(timeout = 1000L)
+ @Retention(RetentionPolicy.RUNTIME)
+ @Target(ElementType.METHOD)
+ @interface TestAnnotation {
+ long value();
+ }
+
+ @Test
+ @TestAnnotation(value = 1000L)
public void getAnnotationTest() throws NoSuchMethodException {
ResolvedJavaMethod method = metaAccess.lookupJavaMethod(getClass().getDeclaredMethod("getAnnotationTest"));
- Test annotation = method.getAnnotation(Test.class);
+ TestAnnotation annotation = method.getAnnotation(TestAnnotation.class);
assertNotNull(annotation);
- assertEquals(1000L, annotation.timeout());
+ assertEquals(1000L, annotation.value());
}
- @Test(timeout = 1000L)
+ @Test
+ @TestAnnotation(value = 1000L)
public void getAnnotationsTest() throws NoSuchMethodException {
ResolvedJavaMethod method = metaAccess.lookupJavaMethod(getClass().getDeclaredMethod("getAnnotationsTest"));
Annotation[] annotations = method.getAnnotations();
assertNotNull(annotations);
- assertEquals(1, annotations.length);
- assertEquals(1000L, ((Test) annotations[0]).timeout());
+ assertEquals(2, annotations.length);
+ TestAnnotation annotation = null;
+ for (Annotation a : annotations) {
+ if (a instanceof TestAnnotation) {
+ annotation = (TestAnnotation) a;
+ break;
+ }
+ }
+ assertNotNull(annotation);
+ assertEquals(1000L, annotation.value());
}
@Retention(RetentionPolicy.RUNTIME)