mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
add methods
This commit is contained in:
@@ -37,6 +37,11 @@ public class TreeTest {
|
||||
for (Tree<String> tree : treeNodes) {
|
||||
Assert.assertNotNull(tree);
|
||||
}
|
||||
|
||||
// 测试通过子节点查找父节点
|
||||
final Tree<String> rootNode0 = treeNodes.get(0);
|
||||
final Tree<String> parent = rootNode0.getChildren().get(0).getParent();
|
||||
Assert.assertEquals(rootNode0, parent);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@@ -1,10 +1,8 @@
|
||||
package cn.hutool.core.lang;
|
||||
package cn.hutool.core.lang.caller;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import cn.hutool.core.lang.caller.CallerUtil;
|
||||
|
||||
/**
|
||||
* {@link CallerUtil} 单元测试
|
||||
* @author Looly
|
@@ -0,0 +1,16 @@
|
||||
package cn.hutool.core.lang.caller;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
public class CallerUtilTest {
|
||||
|
||||
@Test
|
||||
public void getCallerMethodNameTest() {
|
||||
final String callerMethodName = CallerUtil.getCallerMethodName(false);
|
||||
Assert.assertEquals("getCallerMethodNameTest", callerMethodName);
|
||||
|
||||
final String fullCallerMethodName = CallerUtil.getCallerMethodName(true);
|
||||
Assert.assertEquals("cn.hutool.core.lang.caller.CallerUtilTest.getCallerMethodNameTest", fullCallerMethodName);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user