1 19 20 package gui.action; 21 22 import java.awt.event.KeyEvent ; 23 import java.util.ArrayList ; 24 import java.util.List ; 25 26 import org.netbeans.jellytools.EditorOperator; 27 import org.netbeans.jellytools.EditorWindowOperator; 28 import org.netbeans.jellytools.ProjectsTabOperator; 29 import org.netbeans.jellytools.TopComponentOperator; 30 import org.netbeans.jellytools.actions.Action; 31 import org.netbeans.jellytools.nodes.Node; 32 import org.netbeans.jellytools.actions.ActionNoBlock; 33 import org.netbeans.jellytools.actions.OpenAction; 34 import org.netbeans.jellytools.actions.Action.Shortcut; 35 36 import org.netbeans.jemmy.operators.ComponentOperator; 37 import org.netbeans.test.web.performance.WebPerformanceTestCase; 38 39 40 45 public class ToggleBreakpoint extends WebPerformanceTestCase { 46 private String file; 47 private List bpList = new ArrayList (); 48 49 public ToggleBreakpoint(String testName) { 50 super(testName); 51 init(); 52 } 53 54 55 public ToggleBreakpoint(String file, String testName, String performanceDataName) { 56 super(testName, performanceDataName); 57 this.file = file; 58 } 59 60 protected void init() { 61 super.init(); 62 expectedTime = UI_RESPONSE; 63 } 64 private EditorOperator editorOperator1; 65 66 protected void initialize() { 67 EditorOperator.closeDiscardAll(); 68 jspOptions().setCaretBlinkRate(0); 69 jspOptions().setStatusBarCaretDelay(0); 71 new OpenAction().performAPI(new Node(new ProjectsTabOperator().getProjectRootNode("TestWebProject"),"Web Pages|"+file)); 73 editorOperator1 = new EditorWindowOperator().getEditor(file); 74 eventTool().waitNoEvent(500); 75 waitNoEvent(1000); 76 } 77 78 public void prepare() { 79 System.out.println("=== " + this.getClass().getName() + " ==="); 80 editorOperator1.makeComponentVisible(); 81 editorOperator1.setCaretPosition(7,1); 82 eventTool().waitNoEvent(100); 83 } 84 85 public ComponentOperator open(){ 86 new ActionNoBlock(null, null, new Shortcut(KeyEvent.VK_F8, KeyEvent.CTRL_MASK)).perform(editorOperator1); 88 return null; 89 } 90 91 public void close() { 92 deleteAllBreakpoints(); 93 } 94 95 protected void shutdown() { 96 editorOperator1.closeDiscard(); 97 super.shutdown(); 98 } 99 100 private void deleteAllBreakpoints() { 101 new Action("Window|Debugging|Breakpoints",null).perform(); 102 TopComponentOperator tco = new TopComponentOperator("Breakpoints"); 103 new Action(null,"Delete All").perform(tco); 104 tco.close(); 105 } 106 } 107
| Popular Tags
|