KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > gui > action > MeasureCallEjbAction


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.action;
21
22 import org.netbeans.jellytools.EditorOperator;
23 import org.netbeans.jellytools.EditorWindowOperator;
24 import org.netbeans.jellytools.MainWindowOperator;
25 import org.netbeans.jellytools.NbDialogOperator;
26 import org.netbeans.jellytools.ProjectsTabOperator;
27 import org.netbeans.jellytools.actions.ActionNoBlock;
28 import org.netbeans.jellytools.actions.OpenAction;
29 import org.netbeans.jellytools.actions.SaveAllAction;
30 import org.netbeans.jellytools.nodes.Node;
31 import org.netbeans.jemmy.JemmyProperties;
32
33 import org.netbeans.jemmy.operators.ComponentOperator;
34 import org.netbeans.jemmy.operators.JMenuBarOperator;
35 import org.netbeans.jemmy.operators.JTextFieldOperator;
36 import org.netbeans.jemmy.operators.JTreeOperator;
37
38 /**
39  * Test of finishing dialogs from WS source editor.
40  *
41  * @author lmartinek@netbeans.org
42  */

43 public class MeasureCallEjbAction extends org.netbeans.performance.test.utilities.PerformanceTestCase {
44     
45     private static EditorOperator editor;
46     private static NbDialogOperator dialog;
47     
48     private int index;
49     
50     /**
51      * Creates a new instance of MeasureWebServiceAction
52      */

53     public MeasureCallEjbAction(String JavaDoc testName) {
54         super(testName);
55         expectedTime = WINDOW_OPEN;
56         WAIT_AFTER_OPEN = 5000;
57     }
58     
59     /**
60      * Creates a new instance of MeasureEntityBeanAction
61      */

62     public MeasureCallEjbAction(String JavaDoc testName, String JavaDoc performanceDataName) {
63         super(testName, performanceDataName);
64         expectedTime = WINDOW_OPEN;
65         WAIT_AFTER_OPEN = 5000;
66     }
67      
68     public void initialize() {
69         index = 1;
70         // open a java file in the editor
71
Node openFile = new Node(new ProjectsTabOperator().getProjectRootNode("TestApplication-EJBModule"),"Enterprise Beans|TestSessionSB");
72         new OpenAction().performAPI(openFile);
73         editor = new EditorWindowOperator().getEditor("TestSessionBean.java");
74         new org.netbeans.jemmy.EventTool().waitNoEvent(5000);
75         editor.select(11);
76         JemmyProperties.setCurrentDispatchingModel(JemmyProperties.ROBOT_MODEL_MASK);
77     }
78     
79     public void prepare() {
80         new ActionNoBlock(null,"Enterprise Resources|" +
81                 org.netbeans.jellytools.Bundle.getStringTrimmed("org.netbeans.modules.j2ee.ejbcore.ui.logicalview.entres.Bundle", "LBL_CallEjbAction")).perform(editor);
82         dialog = new NbDialogOperator("Call Enterprise Bean");
83         new Node(new JTreeOperator(dialog),"TestApplication-EJBModule|ExpandTest00" + (index++) + "SB").select();
84         new org.netbeans.jemmy.EventTool().waitNoEvent(2000);
85    }
86     
87     public ComponentOperator open(){
88         dialog.ok();
89         return null;
90     }
91
92     public void shutdown(){
93         new SaveAllAction().performAPI();
94         editor.closeDiscard();
95     }
96     
97 }
98
Popular Tags