< prev index next >
test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaMethod.java
Print this page
rev 9940 : 8141557: TestResolvedJavaMethod.java times out after 1000 ms
Reviewed-by:
rev 9802 : 8143072: [JVMCI] Port JVMCI to AArch64
Reviewed-by: gdub, rschatz, twisti, kvn
Contributed-by: aph@redhat.com
rev 9232 : 8139170: JVMCI refresh
Reviewed-by: kvn
rev 9037 : 8136421: JEP 243: Java-Level JVM Compiler Interface
Reviewed-by: ihse, alanb, roland, coleenp, iveresov, kvn, kbarrett
@@ -262,25 +262,41 @@
ConstantPool cp = m.getConstantPool();
assertTrue(cp.length() > 0);
}
}
- @Test(timeout = 1000L)
+ @Retention(RetentionPolicy.RUNTIME)
+ @Target(ElementType.METHOD)
+ @interface TestAnnotionation {
+ long value();
+ }
+
+ @Test
+ @TestAnnotionation(1000L)
public void getAnnotationTest() throws NoSuchMethodException {
ResolvedJavaMethod method = metaAccess.lookupJavaMethod(getClass().getDeclaredMethod("getAnnotationTest"));
- Test annotation = method.getAnnotation(Test.class);
+ TestAnnotionation annotation = method.getAnnotation(TestAnnotionation.class);
assertNotNull(annotation);
- assertEquals(1000L, annotation.timeout());
+ assertEquals(1000L, annotation.value());
}
- @Test(timeout = 1000L)
+ @Test
+ @TestAnnotionation(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);
+ TestAnnotionation annotation = null;
+ for (Annotation a : annotations) {
+ if (a instanceof TestAnnotionation) {
+ annotation = (TestAnnotionation) a;
+ break;
+ }
+ }
+ assertNotNull(annotation);
+ assertEquals(1000L, annotation.value());
}
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.PARAMETER)
@interface NonNull {
< prev index next >