add methods

This commit is contained in:
Looly
2020-03-17 15:39:25 +08:00
parent 87167a07d0
commit 8fda7fe8bd
8 changed files with 82 additions and 19 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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);
}
}