1 53 package org.swixml; 54 55 import junit.framework.TestCase; 56 57 import java.awt.*; 58 59 62 public class MenuTest extends TestCase { 63 public static final String DESCRIPTOR = "xml/dialog.xml"; 64 private Container container; 65 private SwingEngine se; 66 67 public MenuTest() { 68 super("Test inserting a Menu into a container."); 69 } 70 71 public MenuTest(String s) { 72 super(s); 73 } 74 75 public void setUp() throws Exception { 76 se = new SwingEngine(this); 77 container = se.render(MenuTest.DESCRIPTOR); 78 } 79 80 83 public void teardown() { 84 container.removeAll(); 85 container = null; 86 } 87 88 92 public void testInclusioin() { 93 Component menubar = se.find("menubar"); 94 TestCase.assertNotNull("<menubar> tag in the descriptor requires the instantiation of a JMenuBar obj.", menubar); 95 TestCase.assertNotNull("Since <menubar> is not the root tag, it needs a parent container", menubar.getParent()); 96 } 97 } 98 | Popular Tags |