1 19 package org.openide.loaders; 20 import javax.swing.JFrame ; 21 22 import javax.swing.event.ChangeEvent ; 23 24 import javax.swing.event.ChangeListener ; 25 26 import org.netbeans.junit.NbTestCase; 27 28 32 public class NewObjectPanelTest extends NbTestCase{ 33 34 private static class MyChangeListener implements ChangeListener { 35 public void stateChanged(ChangeEvent event) {} 36 } 37 38 public NewObjectPanelTest(String name) { 39 super(name); 40 } 41 42 public void testNewObjectPanelTest() { 43 NewObjectPanel panel = new NewObjectPanel(); 44 JFrame frame = new JFrame ("sss"); 45 46 frame.getContentPane().add(panel, java.awt.BorderLayout.CENTER); 47 frame.pack(); 48 frame.setVisible(true); 49 assertNotNull(panel.getNewObjectName()); 50 assertNotNull(panel.getPreferredSize()); 51 MyChangeListener list = new MyChangeListener(); 52 panel.addChangeListener(list); 53 panel.removeChangeListener(list); 54 panel.addNotify(); 55 assertNotNull(panel.defaultNewObjectName()); 56 frame.dispose(); 57 58 } 59 60 63 public static void main(String [] args) { 64 } 66 67 } 68 | Popular Tags |