This commit is contained in:
Looly
2023-04-03 13:17:55 +08:00
parent 3e67df0d20
commit c93c6a2b77
18 changed files with 2621 additions and 12 deletions

View File

@@ -8,7 +8,7 @@ public class ClassLoaderUtilTest {
@Test
public void isPresentTest() {
final boolean present = ClassLoaderUtil.isPresent("classloader.org.dromara.hutool.core.ClassLoaderUtil");
final boolean present = ClassLoaderUtil.isPresent("org.dromara.hutool.core.classloader.ClassLoaderUtil");
Assertions.assertTrue(present);
}

View File

@@ -311,7 +311,7 @@ public class ConvertTest {
@Test
public void toClassTest(){
final Class<?> convert = Convert.convert(Class.class, "convert.org.dromara.hutool.core.ConvertTest.Product");
final Class<?> convert = Convert.convert(Class.class, "org.dromara.hutool.core.convert.ConvertTest.Product");
Assertions.assertSame(Product.class, convert);
}

View File

@@ -11,6 +11,6 @@ public class CallerUtilTest {
Assertions.assertEquals("getCallerMethodNameTest", callerMethodName);
final String fullCallerMethodName = CallerUtil.getCallerMethodName(true);
Assertions.assertEquals("caller.lang.org.dromara.hutool.core.CallerUtilTest.getCallerMethodNameTest", fullCallerMethodName);
Assertions.assertEquals("org.dromara.hutool.core.lang.caller.CallerUtilTest.getCallerMethodNameTest", fullCallerMethodName);
}
}

View File

@@ -149,11 +149,11 @@ public class MethodUtilTest {
Assertions.assertEquals(3, methods.length);
// getA属于本类
Assertions.assertEquals("public void reflect.org.dromara.hutool.core.ReflectUtilTest$C2.getA()", methods[0].toString());
Assertions.assertEquals("public void org.dromara.hutool.core.reflect.ReflectUtilTest$C2.getA()", methods[0].toString());
// getB属于父类
Assertions.assertEquals("public void reflect.org.dromara.hutool.core.ReflectUtilTest$C1.getB()", methods[1].toString());
Assertions.assertEquals("public void org.dromara.hutool.core.reflect.ReflectUtilTest$C1.getB()", methods[1].toString());
// getC属于接口中的默认方法
Assertions.assertEquals("public default void reflect.org.dromara.hutool.core.ReflectUtilTest$TestInterface1.getC()", methods[2].toString());
Assertions.assertEquals("public default void org.dromara.hutool.core.reflect.ReflectUtilTest$TestInterface1.getC()", methods[2].toString());
}
@Test

View File

@@ -17,7 +17,7 @@ public class ClassUtilTest {
@Test
public void getClassNameTest() {
final String className = ClassUtil.getClassName(ClassUtil.class, false);
Assertions.assertEquals("reflect.org.dromara.hutool.core.ClassUtil", className);
Assertions.assertEquals("org.dromara.hutool.core.reflect.ClassUtil", className);
final String simpleClassName = ClassUtil.getClassName(ClassUtil.class, true);
Assertions.assertEquals("ClassUtil", simpleClassName);
@@ -31,9 +31,9 @@ public class ClassUtilTest {
@Test
public void getShortClassNameTest() {
final String className = "text.org.dromara.hutool.core.StrUtil";
final String className = "org.dromara.hutool.core.text.StrUtil";
final String result = ClassUtil.getShortClassName(className);
Assertions.assertEquals("c.h.c.t.StrUtil", result);
Assertions.assertEquals("o.d.h.c.t.StrUtil", result);
}
@Test