KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > core > multiview > MultiViewsTest


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20
21 package org.netbeans.core.multiview;
22
23 import java.awt.Image JavaDoc;
24 import javax.swing.Action JavaDoc;
25 import javax.swing.JPanel JavaDoc;
26 import javax.swing.JToolBar JavaDoc;
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 /**
40  *
41  * @author Milos Kleint
42  */

43 public class MultiViewsTest extends NbTestCase {
44     
45     /** Creates a new instance of SFSTest */
46     public MultiViewsTest(String JavaDoc name) {
47         super (name);
48     }
49     
50     /**
51      * @param args the command line arguments
52      */

53     public static void main(java.lang.String JavaDoc[] 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 JavaDoc {
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