KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > gui > window > InvokeWSAction


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.EditorOperator;
24 import org.netbeans.jellytools.EditorWindowOperator;
25 import org.netbeans.jellytools.NbDialogOperator;
26 import org.netbeans.jellytools.ProjectsTabOperator;
27 import org.netbeans.jellytools.actions.OpenAction;
28 import org.netbeans.jellytools.nodes.Node;
29
30 import org.netbeans.jemmy.operators.ComponentOperator;
31 import org.netbeans.performance.test.utilities.PerformanceTestCase;
32
33 /**
34  * Test of dialogs from WS source editor.
35  *
36  * @author lmartinek@netbeans.org
37  */

38 public class InvokeWSAction extends PerformanceTestCase {
39     
40     private static EditorOperator editor;
41     private static Node node;
42     
43     private String JavaDoc popupMenu = null;
44     private String JavaDoc dialogTitle = null;
45     
46     /**
47      * Creates a new instance of InvokeWSAction
48      */

49     public InvokeWSAction(String JavaDoc testName) {
50         super(testName);
51         expectedTime = WINDOW_OPEN;
52         WAIT_AFTER_OPEN = 1000;
53     }
54     
55     /**
56      * Creates a new instance of InvokeWSAction
57      */

58     public InvokeWSAction(String JavaDoc testName, String JavaDoc performanceDataName) {
59         super(testName, performanceDataName);
60         expectedTime = WINDOW_OPEN;
61         WAIT_AFTER_OPEN = 1000;
62     }
63     
64     public void testAddOperationDialog(){
65         popupMenu = Bundle.getString(
66                 "org.netbeans.modules.websvc.core.webservices.action.Bundle",
67                 "LBL_OperationAction");
68         dialogTitle = Bundle.getString(
69                 "org.netbeans.modules.websvc.core.webservices.action.Bundle",
70                 "TTL_AddOperation");
71         doMeasurement();
72     }
73
74     public void initialize() {
75         //MENU = org.netbeans.jellytools.Bundle.getStringTrimmed("org.netbeans.core.Bundle","Menu/Edit") + "|" + org.netbeans.jellytools.Bundle.getStringTrimmed("org.netbeans.modules.search.project.Bundle","LBL_SearchProjects");
76
//TITLE = org.netbeans.jellytools.Bundle.getStringTrimmed("org.netbeans.editor.Bundle", "find");
77

78         // open a java file in the editor
79
node = new Node(new ProjectsTabOperator().getProjectRootNode("TestApplication-WebModule"),"Web Services|TestWebService");
80         new OpenAction().performPopup(node);
81         editor = new EditorWindowOperator().getEditor("TestWebServiceImpl.java");
82         new org.netbeans.jemmy.EventTool().waitNoEvent(5000);
83         //editor.select(11);
84
}
85     
86     public void prepare() {
87         // do nothing
88
}
89     
90     public ComponentOperator open(){
91         node.performPopupActionNoBlock(popupMenu);
92         return new NbDialogOperator(dialogTitle);
93     }
94
95     public void shutdown(){
96         editor.closeDiscard();
97     }
98     
99 }
100
Popular Tags