1 19 20 package gui.action; 21 22 import org.netbeans.jellytools.ProjectsTabOperator; 23 24 import org.netbeans.jellytools.actions.MaximizeWindowAction; 25 import org.netbeans.jellytools.actions.RestoreWindowAction; 26 27 import org.netbeans.jellytools.nodes.Node; 28 29 import org.netbeans.jemmy.operators.ComponentOperator; 30 import org.netbeans.test.web.performance.WebPerformanceTestCase; 31 32 33 38 public class ExpandNodesJavaProjectsView extends WebPerformanceTestCase { 39 40 private static String project; 41 42 private static String pathToFolderNode; 43 44 private static Node nodeToBeExpanded; 45 46 private static ProjectsTabOperator projectTab; 47 48 private static String testDataProject = "PerformanceTestFoldersData"; 49 50 54 public ExpandNodesJavaProjectsView(String testName) { 55 super(testName); 56 init(); 57 } 58 59 64 public ExpandNodesJavaProjectsView(String testName, String performanceDataName) { 65 super(testName, performanceDataName); 66 init(); 67 } 68 69 protected void init() { 70 super.init(); 71 project = testDataProject; 72 expectedTime = WINDOW_OPEN; 73 WAIT_AFTER_OPEN = 1000; 74 WAIT_AFTER_PREPARE = 2000; 75 } 76 77 public void testExpandProjectNode(){ 78 pathToFolderNode = ""; 79 doMeasurement(); 80 } 81 82 public void testExpandSourcePackagesNode(){ 83 pathToFolderNode = "Source Packages"; 84 doMeasurement(); 85 } 86 87 public void testExpandFolderWith50JavaFiles(){ 88 pathToFolderNode = "Source Packages|javaFolder50"; 89 doMeasurement(); 90 } 91 92 public void testExpandFolderWith100JavaFiles(){ 93 pathToFolderNode = "Source Packages|javaFolder100"; 94 doMeasurement(); 95 } 96 97 public void testExpandFolderWith100XmlFiles(){ 98 pathToFolderNode = "Source Packages|xmlFolder100"; 99 doMeasurement(); 100 } 101 102 public void testExpandFolderWith100TxtFiles(){ 103 pathToFolderNode = "Source Packages|txtFolder100"; 104 doMeasurement(); 105 } 106 107 public void initialize(){ 108 projectTab = new ProjectsTabOperator(); 109 new MaximizeWindowAction().performAPI(projectTab); 110 projectTab.getProjectRootNode("PerformanceTestData").collapse(); 111 projectTab.getProjectRootNode("TestWebProject").collapse(); 112 projectTab.getProjectRootNode("PerformanceTestFolderWebApp").collapse(); 113 System.setProperty("perf.dont.resolve.java.badges", "true"); 115 } 116 117 118 public void prepare() { 119 if(pathToFolderNode.equals("")) 120 nodeToBeExpanded = projectTab.getProjectRootNode(project); 121 else 122 nodeToBeExpanded = new Node(projectTab.getProjectRootNode(project), pathToFolderNode); 123 repaintManager().setOnlyExplorer(true); 124 } 125 126 public ComponentOperator open(){ 127 nodeToBeExpanded.expand(); 129 return null; 130 } 131 132 public void close(){ 133 repaintManager().setOnlyExplorer(true); 134 nodeToBeExpanded.collapse(); 135 } 136 137 public void shutdown() { 138 super.shutdown(); 139 System.setProperty("perf.dont.resolve.java.badges", "false"); 141 projectTab.getProjectRootNode(testDataProject).collapse(); 142 new RestoreWindowAction().performAPI(projectTab); 143 } 144 } 145
| Popular Tags
|