📄 nodetest.java
字号:
/*
* NodeTest.java
* JUnit based test
*
* Created on 18 octobre 2007, 10:36
*/
package ming.trees.base;
import junit.framework.*;
import java.util.ArrayList;
import java.lang.Object;
import java.util.Iterator;
import ming.trees.interfaces.*;
import psl.util.ObjectPsl;
/**
*
* @author liu zhufu
* @author lachiheb aymen
*/
public class NodeTest extends TestCase {
// initialise plusieurs Node de diff閞ents types
//n1, n3, n5 et n6 sont des Node<String>
private Node<String> n1,n3,n5,n6;
// n2 est un Node<Boolean>
private Node<Boolean> n2;
// n4 est un Node<Integer>
private Node<Integer> n4;
private Exception xcObject = null ;
public NodeTest(String testName) {
super(testName);
}
/**
* initialise un arbre de test
*/
protected void setUp() throws Exception {
n1 = new Node<String>("1");
n2 = new Node<Boolean>(true);
n3 = new Node<String>("3");
n4 = new Node<Integer>(4);
n5 = new Node<String>("5");
n6 = new Node<String>("6");
n2.addChild(n4);
n2.addChild(n5);
n3.addChild(n6);
n1.addChild(n2);
n1.addChild(n3);
/* /////////////////////////////////////////
* // '1' //
* // / \ //
* // true '3' //
* // /\ \ //
* // 4 '5' '6' //
* /////////////////////////////////////////
*/
}
protected void tearDown() throws Exception {
}
/**
* Service : m閙orise dans le champ exception un objet Exception intercept
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -