001    package aima.test.search;
002    
003    import java.util.List;
004    
005    import junit.framework.TestCase;
006    import aima.search.framework.Node;
007    
008    /**
009     * @author Ravi Mohan
010     * 
011     */
012    
013    public class NodeTest extends TestCase {
014            public void testRootNode() {
015                    Node node1 = new Node("state1");
016                    assertTrue(node1.isRootNode());
017                    Node node2 = new Node(node1, "state2");
018                    assertTrue(node1.isRootNode());
019                    assertFalse(node2.isRootNode());
020                    assertEquals(node1, node2.getParent());
021            }
022    
023            public void testGetPathFromRoot() {
024                    Node node1 = new Node("state1");
025                    Node node2 = new Node(node1, "state2");
026                    Node node3 = new Node(node2, "state3");
027                    List path = node3.getPathFromRoot();
028            }
029    
030    }