/**
* Test of equals method, of class TreeNode.
*
* @throws java.io.IOException
*/
@Test
public void testEquals() throws IOException {
Object object = null;
TreeNode instance = new TreeNode(new ParserRuleContext());
boolean expResult = false;
boolean result = instance.equals(object);
assertEquals("equals method, of class TreeNode's expected result is wrong.", expResult,
result);
object = new Object();
expResult = false;
result = instance.equals(object);
assertEquals("equals method, of class TreeNode's expected result is wrong.", expResult,
result);
ClassLoader classLoader = getClass().getClassLoader();
File file = new File(classLoader.getResource(SAMPLE_CLASS_PATH).getFile());
byte[] encoded = Files.readAllBytes(Paths.get(file.getAbsolutePath()));
String code = new String(encoded, Charset.defaultCharset());
Forest forest1 = TreeViewGenerator.generate(code);
Forest forest2 = TreeViewGenerator.generate(code);
expResult = true;
object = forest1.getTree(0).getRoot();
instance = forest2.getTree(0).getRoot();
result = instance.equals(object);
assertEquals("equals method, of class TreeNode's expected result is wrong.", expResult,
result);
}
TreeNodeTest.java 文件源码
java
阅读 26
收藏 0
点赞 0
评论 0
项目:Blindfold
作者:
评论列表
文章目录