KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > core > windows > awt > ValidateLayerToolbarTest


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 2003 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.core.windows.awt;
21
22 import java.io.InputStream JavaDoc;
23 import junit.framework.*;
24 import org.netbeans.junit.*;
25 import org.openide.cookies.InstanceCookie;
26
27 import org.openide.filesystems.*;
28 import org.openide.loaders.*;
29
30 /** Checks the consistence of Toolbar folder.
31  *
32  * @author Jaroslav Tulach
33  */

34 public class ValidateLayerToolbarTest extends ValidateLayerMenuTest {
35
36     /** Creates a new instance of SFSTest */
37     public ValidateLayerToolbarTest(String JavaDoc name) {
38         super (name);
39     }
40
41     /**
42      * @param args the command line arguments
43      */

44     public static void main(java.lang.String JavaDoc[] args) {
45         junit.textui.TestRunner.run(suite());
46     }
47     
48     public static Test suite() {
49         TestSuite suite = new NbTestSuite(ValidateLayerToolbarTest.class);
50         
51         return suite;
52     }
53     
54     //
55
// override in subclasses
56
//
57

58     protected String JavaDoc rootName () {
59         return "Toolbars";
60     }
61     
62     /** Allowes to skip filest that are know to be broken */
63     protected boolean skipFile (FileObject fo) {
64         return false;
65     }
66     
67     protected boolean correctInstance (Object JavaDoc obj) {
68         if (obj instanceof javax.swing.Action JavaDoc) {
69             return true;
70         }
71         if (obj instanceof org.openide.util.actions.Presenter.Toolbar) {
72             return true;
73         }
74         if (obj instanceof javax.swing.JToolBar.Separator) {
75             return true;
76         }
77         if (obj instanceof org.openide.awt.ToolbarPool.Configuration) {
78             // definition of configuration
79
return true;
80         }
81         if (obj instanceof java.awt.Component JavaDoc) {
82             // definition of configuration
83
return true;
84         }
85         
86         return false;
87     }
88
89     //
90
// Inherits test from superclass
91
//
92

93 }
94
95
Popular Tags