KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > gui > menu > WebProjectsViewPopupMenu


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 package gui.menu;
21
22 import org.netbeans.jellytools.ProjectsTabOperator;
23 import org.netbeans.jellytools.nodes.Node;
24 import org.netbeans.jellytools.nodes.ProjectRootNode;
25
26 import org.netbeans.junit.NbTestSuite;
27
28 import gui.menu.*;
29
30 /**
31  * Test of popup menu on nodes in Projects View.
32  * @author mmirilovic@netbeans.org
33  */

34 public class WebProjectsViewPopupMenu extends ValidatePopupMenuOnNodes {
35     
36     private static ProjectsTabOperator projectsTab = null;
37     
38     /** Creates a new instance of ProjectsViewPopupMenu */
39     public WebProjectsViewPopupMenu(String JavaDoc testName) {
40         super(testName);
41     }
42     
43     /** Creates a new instance of ProjectsViewPopupMenu */
44     public WebProjectsViewPopupMenu(String JavaDoc testName, String JavaDoc performanceDataName) {
45         super(testName, performanceDataName);
46         
47     }
48     
49     public void testProjectNodePopupMenuProjects() {
50         testNode(getProjectNode());
51     }
52     
53     public void testSourcePackagesPopupMenuProjects(){
54         testNode(new Node(getProjectNode(), "Source Packages"));
55     }
56     
57     public void testPackagePopupMenuProjects(){
58         testNode(new Node(getProjectNode(), "Source Packages" + '|' + "test"));
59     }
60     
61     public void testServletPopupMenuProjects(){
62         testNode(new Node(getProjectNode(), "Source Packages" + '|' + "test" + '|' + "TestServlet.java"));
63     }
64     
65     public void testWebPagesPopupMenuProjects(){
66         testNode(new Node(getProjectNode(), "Web Pages"));
67     }
68      
69     public void testJspFilePopupMenuProjects(){
70         testNode(new Node(getProjectNode(), "Web Pages" + '|' + "Test.jsp"));
71     }
72
73     public void testHtmlFilePopupMenuProjects(){
74         testNode(new Node(getProjectNode(), "Web Pages" + '|' + "HTML.html"));
75     }
76     
77     public void testWebInfPopupMenuProjects(){
78         testNode(new Node(getProjectNode(), "Web Pages" + '|' + "WEB-INF"));
79     }
80     
81     public void testMetaInfPopupMenuProjects(){
82         testNode(new Node(getProjectNode(), "Web Pages" + '|' + "META-INF"));
83     }
84
85     public void testWebXmlFilePopupMenuProjects(){
86         testNode(new Node(getProjectNode(), "Web Pages" + '|' + "WEB-INF" + '|' + "web.xml"));
87     }
88
89     public void testContextXmlFilePopupMenuProjects(){
90         testNode(new Node(getProjectNode(), "Web Pages" + '|' + "META-INF" + '|' + "context.xml"));
91     }
92
93     public void testTagFilePopupMenuProjects(){
94         testNode(new Node(getProjectNode(), "Web Pages" + '|' + "WEB-INF" + '|' + "tags" + '|' + "mytag.tag"));
95     }
96
97     public void testTldPopupMenuProjects(){
98         testNode(new Node(getProjectNode(), "Web Pages" + '|' + "WEB-INF" + '|' + "MyTLD.tld"));
99     }
100     
101     public void testNode(Node node){
102         dataObjectNode = node;
103         doMeasurement();
104     }
105     
106     private Node getProjectNode() {
107         if(projectsTab==null)
108             projectsTab = new ProjectsTabOperator();
109         
110         return projectsTab.getProjectRootNode("TestWebProject");
111     }
112
113     
114 }
115
Popular Tags