1 19 20 package org.netbeans.test.web.performance; 21 import org.netbeans.jemmy.EventTool; 22 import org.netbeans.modules.editor.html.HTMLKit; 23 import org.netbeans.modules.editor.java.JavaKit; 24 import org.netbeans.modules.editor.options.BaseOptions; 25 import org.netbeans.modules.html.editor.options.HTMLOptions; 26 import org.netbeans.modules.java.editor.options.JavaOptions; 27 import org.netbeans.modules.web.core.syntax.JSPKit; 28 import org.netbeans.modules.web.core.syntax.settings.JSPOptions; 29 import org.netbeans.modules.xml.text.syntax.XMLKit; 30 import org.netbeans.modules.xml.text.syntax.XMLOptions; 31 import org.netbeans.performance.test.utilities.PerformanceTestCase; 32 33 37 public abstract class WebPerformanceTestCase extends PerformanceTestCase { 38 private JSPOptions jspOptions = null; 40 private JavaOptions javaOptions = null; 41 private HTMLOptions htmlOptions = null; 42 private XMLOptions xmlOptions = null; 43 46 private int defCaretBlinkingRate; 48 private boolean defCodeFoldindEnabled; 49 private int defCompletionAutoPopupDelayJsp; 50 private int defFontSize; 51 private boolean defJavaDocAutoPopupJsp; 52 private int defStatusBarCaretDelay; 53 private int defCompletionAutoPopupDelayJava; 55 private boolean defJavaDocAutoPopupJava; 56 private int defParsingErrors; 58 private EventTool eventTool = null; 59 60 64 public WebPerformanceTestCase(String testName) { 65 super(testName); 66 init(); 67 } 68 69 74 public WebPerformanceTestCase(String testName, String performanceDataName) { 75 super(testName, performanceDataName); 76 init(); 77 } 78 79 protected void init() { 80 WAIT_AFTER_PREPARE = 1500; 82 WAIT_AFTER_OPEN = 2000; 83 HEURISTIC_FACTOR = -1; 84 jspOptions = (JSPOptions) BaseOptions.getOptions(JSPKit.class); 86 javaOptions = (JavaOptions) BaseOptions.getOptions(JavaKit.class); 87 htmlOptions = (HTMLOptions) BaseOptions.getOptions(HTMLKit.class); 88 xmlOptions = (XMLOptions) BaseOptions.getOptions(XMLKit.class); 89 92 defCaretBlinkingRate = jspOptions.getCaretBlinkRate(); 95 defCodeFoldindEnabled = jspOptions.getCodeFoldingEnable(); 96 defCompletionAutoPopupDelayJsp = jspOptions.getCompletionAutoPopupDelay(); 97 defFontSize = jspOptions.getFontSize(); 98 defJavaDocAutoPopupJsp = jspOptions.getJavaDocAutoPopup(); 99 defStatusBarCaretDelay = jspOptions.getStatusBarCaretDelay(); 100 defCompletionAutoPopupDelayJava = javaOptions.getCompletionAutoPopupDelay(); 102 defJavaDocAutoPopupJava = javaOptions.getJavaDocAutoPopup(); 103 107 jspOptions.setCaretBlinkRate(0); 109 javaOptions.setCaretBlinkRate(0); 110 htmlOptions.setCaretBlinkRate(0); 111 xmlOptions.setCaretBlinkRate(0); 112 131 } 132 133 protected void resetOptions() { 134 jspOptions.setCodeFoldingEnable(defCodeFoldindEnabled); 136 jspOptions.setCompletionAutoPopupDelay(defCompletionAutoPopupDelayJsp); 137 jspOptions.setFontSize(defFontSize); 138 jspOptions.setJavaDocAutoPopup(defJavaDocAutoPopupJsp); 139 jspOptions.setStatusBarCaretDelay(defStatusBarCaretDelay); 140 javaOptions.setCompletionAutoPopupDelay(defCompletionAutoPopupDelayJava); 142 javaOptions.setJavaDocAutoPopup(defJavaDocAutoPopupJava); 143 147 } 168 169 protected JSPOptions jspOptions() { 170 return jspOptions; 171 } 172 173 protected JavaOptions javaOptions() { 174 return javaOptions; 175 } 176 177 182 183 protected void shutdown() { 184 resetOptions(); 185 repaintManager().setRegionFilter(null); 186 } 187 188 protected EventTool eventTool() { 189 if (eventTool == null) { 190 eventTool = new EventTool(); 191 } 192 return eventTool; 193 } 194 195 public String toString() { 196 return renamedTestCaseName.toString(); 197 } 198 } 199 | Popular Tags |