AnnotationTypeMismatchExceptionTest.java 文件源码

java
阅读 32 收藏 0 点赞 0 评论 0

项目:In-the-Box-Fork 作者:
/**
 * @throws ClassNotFoundException
 * @throws SecurityException
 * @tests java.lang.annotation.AnnotationTypeMismatchException#AnnotationTypeMismatchException(Method,
 *        String)
 */
@SuppressWarnings("nls")
public void test_constructorLjava_lang_reflect_MethodLjava_lang_String() throws SecurityException, ClassNotFoundException {
    Method[] methods = Class.forName("java.lang.String").getMethods();
    Method m = methods[0];
    AnnotationTypeMismatchException e = new AnnotationTypeMismatchException(
            m, "some type");
    assertNotNull("can not instantiate AnnotationTypeMismatchException", e);
    assertSame("wrong method name", m, e.element());
    assertEquals("wrong found type", "some type", e.foundType());
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号