1 19 20 21 package org.netbeans.core.multiview; 22 23 import java.awt.Image ; 24 import javax.swing.Action ; 25 import javax.swing.JPanel ; 26 import javax.swing.JToolBar ; 27 import junit.framework.*; 28 import org.netbeans.core.api.multiview.MultiViewHandler; 29 import org.netbeans.core.api.multiview.MultiViews; 30 import org.netbeans.core.spi.multiview.MultiViewDescription; 31 import org.netbeans.core.spi.multiview.MultiViewFactory; 32 import org.netbeans.junit.*; 33 import org.openide.util.HelpCtx; 34 import org.openide.util.lookup.Lookups; 35 36 import org.openide.windows.*; 37 38 39 43 public class MultiViewsTest extends NbTestCase { 44 45 46 public MultiViewsTest(String name) { 47 super (name); 48 } 49 50 53 public static void main(java.lang.String [] args) { 54 junit.textui.TestRunner.run(suite()); 55 } 56 57 public static Test suite() { 58 TestSuite suite = new NbTestSuite(MultiViewsTest.class); 59 60 return suite; 61 } 62 63 protected boolean runInEQ () { 64 return true; 65 } 66 67 68 69 public void testcreateMultiViewHandler () throws Exception { 70 MultiViewDescription desc1 = new MVDesc("desc1", null, 0, new MVElem()); 71 MultiViewDescription[] descs = new MultiViewDescription[] { desc1 }; 72 TopComponent tc = MultiViewFactory.createMultiView(descs, desc1); 73 MultiViewHandler hand = MultiViews.findMultiViewHandler(tc); 74 assertNotNull(hand); 75 76 tc = new TopComponent(); 77 hand = MultiViews.findMultiViewHandler(tc); 78 assertNull(hand); 79 80 hand = MultiViews.findMultiViewHandler(null); 81 assertNull(hand); 82 83 } 84 85 86 } 87 88 | Popular Tags |