1 20 21 package com.methodhead.tree; 22 23 import java.util.*; 24 import junit.framework.*; 25 import org.apache.log4j.*; 26 import com.methodhead.persistable.*; 27 import com.methodhead.test.*; 28 29 public class FoldingTreeNodeTest extends DbTestCase { 30 31 public FoldingTreeNodeTest( String name ) { 32 super( name ); 33 } 34 35 protected void setUp() { 36 try { 38 } 39 catch ( Exception e ) { 40 fail( e.getMessage() ); 41 } 42 } 43 44 protected void tearDown() { 45 } 46 47 public void testConstructor() { 48 try { 49 FoldingTreeNode node = new FoldingTreeNode(); 50 51 assertEquals( "", node.getLabel() ); 52 assertNull( node.getUrl() ); 53 assertNull( node.getIconHint() ); 54 assertTrue( !node.getOpened() ); 55 } 56 catch ( Exception e ) { 57 e.printStackTrace(); 58 fail(); 59 } 60 } 61 62 public void testProperties() { 63 try { 64 FoldingTreeNode node = new FoldingTreeNode(); 65 node.setLabel( "label" ); 66 node.setUrl( "url" ); 67 node.setIconHint( "iconHint" ); 68 node.setOpened( true ); 69 70 assertEquals( "label", node.getLabel() ); 71 assertEquals( "url", node.getUrl() ); 72 assertEquals( "iconHint", node.getIconHint() ); 73 assertTrue( node.getOpened() ); 74 } 75 catch ( Exception e ) { 76 e.printStackTrace(); 77 fail(); 78 } 79 } 80 } 81 | Popular Tags |