mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
添加获得类直接声明方法的静态方法
This commit is contained in:
@@ -127,7 +127,7 @@ public class AnnotationUtilTest {
|
||||
@Test
|
||||
public void testGetAnnotationAttributes() {
|
||||
Method[] methods = AnnotationUtil.getAnnotationAttributes(AnnotationForTest.class);
|
||||
Assert.assertSame(methods, AnnotationUtil.getAnnotationAttributes(AnnotationForTest.class));
|
||||
Assert.assertArrayEquals(methods, AnnotationUtil.getAnnotationAttributes(AnnotationForTest.class));
|
||||
Assert.assertEquals(1, methods.length);
|
||||
Assert.assertArrayEquals(AnnotationForTest.class.getDeclaredMethods(), methods);
|
||||
}
|
||||
|
@@ -81,6 +81,18 @@ public class MethodUtilTest {
|
||||
Assert.assertEquals(10, testClass.getA());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getDeclaredMethodsTest() {
|
||||
Class<?> type = ReflectUtilTest.TestBenchClass.class;
|
||||
Method[] methods = type.getDeclaredMethods();
|
||||
Assert.assertArrayEquals(methods, MethodUtil.getDeclaredMethods(type));
|
||||
Assert.assertSame(MethodUtil.getDeclaredMethods(type), MethodUtil.getDeclaredMethods(type));
|
||||
|
||||
type = Object.class;
|
||||
methods = type.getDeclaredMethods();
|
||||
Assert.assertArrayEquals(methods, MethodUtil.getDeclaredMethods(type));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void getMethodBenchTest() {
|
||||
|
Reference in New Issue
Block a user