KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > gui > window > SelectJ2EEModuleDialog


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.window;
21
22 import org.netbeans.jellytools.Bundle;
23 import org.netbeans.jellytools.nodes.Node;
24 import org.netbeans.jellytools.ProjectsTabOperator;
25 import org.netbeans.jellytools.NbDialogOperator;
26 import org.netbeans.jellytools.nodes.ProjectRootNode;
27 import org.netbeans.jemmy.operators.ComponentOperator;
28 import org.netbeans.jemmy.operators.JTreeOperator;
29 import org.netbeans.jemmy.operators.Operator;
30
31 /**
32  * Test of Project Properties Window
33  *
34  * @author mmirilovic@netbeans.org
35  */

36 public class SelectJ2EEModuleDialog extends org.netbeans.performance.test.utilities.PerformanceTestCase {
37     
38     private static Node testNode;
39     private String JavaDoc TITLE;
40     
41     /**
42      * Creates a new instance of SelectJ2EEModuleDialog
43      */

44     public SelectJ2EEModuleDialog(String JavaDoc testName) {
45         super(testName);
46         expectedTime = WINDOW_OPEN;
47         WAIT_AFTER_OPEN = 2000;
48     }
49     
50     /**
51      * Creates a new instance of SelectJ2EEModuleDialog
52      */

53     public SelectJ2EEModuleDialog(String JavaDoc testName, String JavaDoc performanceDataName) {
54         super(testName,performanceDataName);
55         expectedTime = WINDOW_OPEN;
56         WAIT_AFTER_OPEN = 2000;
57     }
58     
59     public void initialize() {
60         JTreeOperator tree = new ProjectsTabOperator().tree();
61         tree.setComparator(new Operator.DefaultStringComparator(true, true));
62         String JavaDoc JAVA_EE_MODULES = Bundle.getStringTrimmed(
63                 "org.netbeans.modules.j2ee.earproject.ui.Bundle",
64                 "LBL_LogicalViewNode");
65         testNode = new Node(new ProjectRootNode(tree, "TestApplication"), JAVA_EE_MODULES);
66     }
67     
68     public void prepare() {
69         // do nothing
70
}
71     
72     public ComponentOperator open() {
73         // invoke Window / Properties from the main menu
74
testNode.performPopupActionNoBlock("Add J2EE Module...");
75         return new NbDialogOperator("Add J2ee Module");
76     }
77     
78 }
79
Popular Tags