1 19 20 package gui.action; 21 22 import gui.Utils; 23 import org.netbeans.jellytools.EditorOperator; 24 import org.netbeans.jellytools.EditorWindowOperator; 25 import org.netbeans.jellytools.MainWindowOperator; 26 import org.netbeans.jellytools.NbDialogOperator; 27 import org.netbeans.jellytools.ProjectsTabOperator; 28 import org.netbeans.jellytools.actions.ActionNoBlock; 29 import org.netbeans.jellytools.actions.OpenAction; 30 import org.netbeans.jellytools.actions.SaveAllAction; 31 import org.netbeans.jellytools.nodes.Node; 32 import org.netbeans.jemmy.JemmyProperties; 33 34 import org.netbeans.jemmy.operators.ComponentOperator; 35 import org.netbeans.jemmy.operators.JMenuBarOperator; 36 import org.netbeans.jemmy.operators.JTextFieldOperator; 37 38 43 public class MeasureSessionBeanAction extends org.netbeans.performance.test.utilities.PerformanceTestCase { 44 45 private static EditorOperator editor; 46 private static NbDialogOperator dialog; 47 48 private String popup_menu; 49 private String title; 50 private String name; 51 52 55 public MeasureSessionBeanAction(String testName) { 56 super(testName); 57 expectedTime = WINDOW_OPEN; 58 } 59 60 63 public MeasureSessionBeanAction(String testName, String performanceDataName) { 64 super(testName, performanceDataName); 65 expectedTime = WINDOW_OPEN; 66 } 67 68 public void testAddBusinessMethod(){ 69 WAIT_AFTER_OPEN = 5000; 70 popup_menu = "EJB Methods|Add Business Method"; 71 title = "Add Business Method"; 72 name = "testBusinessMethod"; 73 doMeasurement(); 74 } 75 76 public void initialize() { 77 Node openFile = new Node(new ProjectsTabOperator().getProjectRootNode("TestApplication-EJBModule"),"Enterprise Beans|TestSessionSB"); 79 new OpenAction().performAPI(openFile); 80 editor = new EditorWindowOperator().getEditor("TestSessionBean.java"); 81 new org.netbeans.jemmy.EventTool().waitNoEvent(5000); 82 editor.select(11); 83 JemmyProperties.setCurrentDispatchingModel(JemmyProperties.ROBOT_MODEL_MASK); 84 } 85 86 public void prepare() { 87 new ActionNoBlock(null,popup_menu).perform(editor); 88 dialog = new NbDialogOperator(title); 89 new JTextFieldOperator(dialog).setText(name+Utils.getTimeIndex()); 90 } 91 92 public ComponentOperator open(){ 93 dialog.ok(); 94 return null; 95 } 96 97 public void shutdown(){ 98 new SaveAllAction().performAPI(); 99 editor.closeDiscard(); 100 } 101 102 } 103
| Popular Tags
|