1 53 package org.swixml; 54 55 import junit.framework.TestCase; 56 57 import javax.swing.*; 58 import java.awt.*; 59 60 63 public class MappingTest extends TestCase { 64 public static final String DESCRIPTOR = "xml/test1.xml"; 65 private Container container; 66 67 public JButton b1; 68 public transient JButton b2; 69 private JButton b3; 70 private transient JButton b4; 71 72 public MappingTest() { 73 super("Test Mapping og XML Tags to JComponent Objects in the SwingEngine's Client" ); 74 } 75 public MappingTest(String s) { 76 super(s); 77 } 78 79 85 public void setUp() throws Exception { 86 SwingEngine se = new SwingEngine(this); 87 container = se.render(MappingTest.DESCRIPTOR); 88 } 89 90 93 public void teardown() { 94 container.removeAll(); 95 container=null; 96 } 97 98 101 public void testMappingPublicFields() { 102 TestCase.assertNotNull("Public Fields, whose names have matching ids the the XML descriptor should be initializd by the SwingEngine.", b1); 103 TestCase.assertNull("Transient Fields must not be initializd by the SwingEngine.", b2); 104 TestCase.assertNotNull("Private Field, whose names have a matching ids the the XML descriptor should be initializd by the SwingEngine.", b3); 105 TestCase.assertNull("Transient Fields must not be initializd by the SwingEngine.", b4); 106 } 107 108 109 } 110 | Popular Tags |