# HG changeset patch # User Jesse Glick # Date 1309293396 14400 # Node ID 7b6e218ca0af67e4060db00e2dc30d3c9b412257 # Parent e53c993c0d494d3d2bdc05786ffa802e1c986fb8 Moved performance/uml out of main. diff -r e53c993c0d49 -r 7b6e218ca0af performance/build.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/performance/build.xml Tue Jun 28 16:36:36 2011 -0400 @@ -0,0 +1,61 @@ + + + + + + Builds, tests, and runs the project org.netbeans.performance.uml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r e53c993c0d49 -r 7b6e218ca0af performance/manifest.mf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/performance/manifest.mf Tue Jun 28 16:36:36 2011 -0400 @@ -0,0 +1,5 @@ +Manifest-Version: 1.0 +OpenIDE-Module: org.netbeans.performance.uml +OpenIDE-Module-Localizing-Bundle: org/netbeans/performance/uml/Bundle.properties +OpenIDE-Module-Specification-Version: 1.0 + diff -r e53c993c0d49 -r 7b6e218ca0af performance/nbproject/build-impl.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/performance/nbproject/build-impl.xml Tue Jun 28 16:36:36 2011 -0400 @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff -r e53c993c0d49 -r 7b6e218ca0af performance/nbproject/genfiles.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/performance/nbproject/genfiles.properties Tue Jun 28 16:36:36 2011 -0400 @@ -0,0 +1,5 @@ +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=b9a964e2 +nbproject/build-impl.xml.script.CRC32=125813ef +nbproject/build-impl.xml.stylesheet.CRC32=deb65f65 diff -r e53c993c0d49 -r 7b6e218ca0af performance/nbproject/platform.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/performance/nbproject/platform.properties Tue Jun 28 16:36:36 2011 -0400 @@ -0,0 +1,3 @@ +nbplatform.active=default +netbeans.dest.dir=${basedir}/../../nbbuild/netbeans +harness.dir=${netbeans.dest.dir}/harness diff -r e53c993c0d49 -r 7b6e218ca0af performance/nbproject/project.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/performance/nbproject/project.properties Tue Jun 28 16:36:36 2011 -0400 @@ -0,0 +1,46 @@ +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# +# Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved. +# +# Oracle and Java are registered trademarks of Oracle and/or its affiliates. +# Other names may be trademarks of their respective owners. +# +# The contents of this file are subject to the terms of either the GNU +# General Public License Version 2 only ("GPL") or the Common +# Development and Distribution License("CDDL") (collectively, the +# "License"). You may not use this file except in compliance with the +# License. You can obtain a copy of the License at +# http://www.netbeans.org/cddl-gplv2.html +# or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the +# specific language governing permissions and limitations under the +# License. When distributing the software, include this License Header +# Notice in each file and include the License file at +# nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the GPL Version 2 section of the License file that +# accompanied this code. If applicable, add the following below the +# License Header, with the fields enclosed by brackets [] replaced by +# your own identifying information: +# "Portions Copyrighted [year] [name of copyright owner]" +# +# Contributor(s): +# +# The Original Software is NetBeans. The Initial Developer of the Original +# Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun +# Microsystems, Inc. All Rights Reserved. +# +# If you wish your version of this file to be governed by only the CDDL +# or only the GPL Version 2, indicate your decision by adding +# "[Contributor] elects to include this software in this distribution +# under the [CDDL or GPL Version 2] license." If you do not indicate a +# single choice of license, a recipient has the option to distribute +# your version of this file under either the CDDL, the GPL Version 2 or +# to extend the choice of license to its licensees as provided above. +# However, if you add GPL Version 2 code and therefore, elected the GPL +# Version 2 license, then the option applies only if the new code is +# made subject to such option by the copyright holder. + +test.unit.cp.extra=../../nbbuild/build/testdist/unit/ide/org-netbeans-modules-projectui/tests.jar:../../api.progress/build/classes +test.qa-functional.cp.extra=../../nbbuild/build/testdist/unit/ide/org-netbeans-modules-projectui/tests.jar:../../api.progress/build/classes +javac.source=1.5 +javac.compilerargs=-Xlint -Xlint:-serial diff -r e53c993c0d49 -r 7b6e218ca0af performance/nbproject/project.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/performance/nbproject/project.xml Tue Jun 28 16:36:36 2011 -0400 @@ -0,0 +1,103 @@ + + + + org.netbeans.modules.apisupport.project + + + org.netbeans.performance.uml + + + + + unit + + org.netbeans.modules.java.j2seproject + + + + org.netbeans.modules.jellytools + + + + org.netbeans.modules.jellytools.platform + + + + org.netbeans.modules.jemmy + + + + org.netbeans.modules.performance + + + + org.netbeans.modules.projectui + + + + org.netbeans.modules.web.project + + + + org.openide.util + + + + + qa-functional + + org.netbeans.modules.jellytools.platform + + + + org.netbeans.modules.performance + + + + + + + + diff -r e53c993c0d49 -r 7b6e218ca0af performance/src/org/netbeans/performance/uml/Bundle.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/performance/src/org/netbeans/performance/uml/Bundle.properties Tue Jun 28 16:36:36 2011 -0400 @@ -0,0 +1,1 @@ +OpenIDE-Module-Name=UML Performance Tests diff -r e53c993c0d49 -r 7b6e218ca0af performance/test/qa-functional/src/org/netbeans/performance/uml/MeasureUMLActionsOpenUMLProjectTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/performance/test/qa-functional/src/org/netbeans/performance/uml/MeasureUMLActionsOpenUMLProjectTest.java Tue Jun 28 16:36:36 2011 -0400 @@ -0,0 +1,77 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved. + * + * Oracle and Java are registered trademarks of Oracle and/or its affiliates. + * Other names may be trademarks of their respective owners. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * Contributor(s): + * + * The Original Software is NetBeans. The Initial Developer of the Original + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun + * Microsystems, Inc. All Rights Reserved. + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + */ + + +package org.netbeans.performance.uml; + + +import junit.framework.Test; +import org.netbeans.junit.NbModuleSuite; +import org.netbeans.junit.NbTestSuite; +import org.netbeans.modules.performance.utilities.PerformanceTestCase; +import org.netbeans.performance.uml.actions.*; + +/** + * Measure UI-RESPONSIVENES and WINDOW_OPENING. + * + * @author mrkam@netbeans.org + */ +public class MeasureUMLActionsOpenUMLProjectTest { + + public static Test suite() { + PerformanceTestCase.prepareForMeasurements(); + + NbTestSuite suite = new NbTestSuite("UI Responsiveness UML Actions suite - Open UML Project testcase"); + System.setProperty("suitename", MeasureUMLActionsOpenUMLProjectTest.class.getCanonicalName()); + + + // EPMeasureActions1 + suite.addTest(NbModuleSuite.create(NbModuleSuite.createConfiguration(OpenUMLProject.class) + .addTest(OpenUMLProject.class, "measureTime") + .enableModules(".*").clusters(".*").reuseUserDir(true))); + + return suite; + } + +} diff -r e53c993c0d49 -r 7b6e218ca0af performance/test/qa-functional/src/org/netbeans/performance/uml/MeasureUMLActionsReverseEngineeringTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/performance/test/qa-functional/src/org/netbeans/performance/uml/MeasureUMLActionsReverseEngineeringTest.java Tue Jun 28 16:36:36 2011 -0400 @@ -0,0 +1,77 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved. + * + * Oracle and Java are registered trademarks of Oracle and/or its affiliates. + * Other names may be trademarks of their respective owners. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * Contributor(s): + * + * The Original Software is NetBeans. The Initial Developer of the Original + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun + * Microsystems, Inc. All Rights Reserved. + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + */ + + +package org.netbeans.performance.uml; + + +import junit.framework.Test; +import org.netbeans.junit.NbModuleSuite; +import org.netbeans.junit.NbTestSuite; +import org.netbeans.modules.performance.utilities.PerformanceTestCase; +import org.netbeans.performance.uml.actions.*; + +/** + * Measure UI-RESPONSIVENES and WINDOW_OPENING. + * + * @author mrkam@netbeans.org + */ +public class MeasureUMLActionsReverseEngineeringTest { + + public static Test suite() { + PerformanceTestCase.prepareForMeasurements(); + + NbTestSuite suite = new NbTestSuite("UI Responsiveness UML Actions suite - Reverse Engineering testcase"); + System.setProperty("suitename", MeasureUMLActionsReverseEngineeringTest.class.getCanonicalName()); + + + // EPMeasureActions1 + suite.addTest(NbModuleSuite.create(NbModuleSuite.createConfiguration(ReverseEngineering.class) + .addTest(ReverseEngineering.class, "measureTime") + .enableModules(".*").clusters(".*").reuseUserDir(true))); + + return suite; + } + +} diff -r e53c993c0d49 -r 7b6e218ca0af performance/test/qa-functional/src/org/netbeans/performance/uml/MeasureUMLActionsTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/performance/test/qa-functional/src/org/netbeans/performance/uml/MeasureUMLActionsTest.java Tue Jun 28 16:36:36 2011 -0400 @@ -0,0 +1,88 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved. + * + * Oracle and Java are registered trademarks of Oracle and/or its affiliates. + * Other names may be trademarks of their respective owners. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * Contributor(s): + * + * The Original Software is NetBeans. The Initial Developer of the Original + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun + * Microsystems, Inc. All Rights Reserved. + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + */ + + +package org.netbeans.performance.uml; + + +import junit.framework.Test; +import org.netbeans.junit.NbModuleSuite; +import org.netbeans.junit.NbTestSuite; +import org.netbeans.modules.performance.utilities.PerformanceTestCase; +import org.netbeans.performance.uml.actions.*; + +/** + * Measure UI-RESPONSIVENES and WINDOW_OPENING. + * + * @author mmirilovic@netbeans.org, mrkam@netbeans.org + */ +public class MeasureUMLActionsTest { + + public static Test suite() { + PerformanceTestCase.prepareForMeasurements(); + + NbTestSuite suite = new NbTestSuite("UI Responsiveness UML Actions suite"); + System.setProperty("suitename", MeasureUMLActionsTest.class.getCanonicalName()); + + + // EPMeasureActions1 + suite.addTest(NbModuleSuite.create(NbModuleSuite.createConfiguration(OpenUMLDiagram.class) + .addTest(OpenUMLDiagram.class, "measureTime") + .addTest(ScrollExpandedProject.class, "measureTime") + .addTest(SelectingMultipleNodes.class, "measureTime") + .addTest(CreateClassDiagramFromMultipleNodes.class, "measureTime") + .addTest(CreateSequenceDiagramFromMultipleNodes.class, "measureTime") + .addTest(CreateEmptyDiagram.class, "measureTime") + .addTest(GenerateDependencyDiagram.class, "measureTime") +/* Stability issues, will be enabled later... + .addTest(GenerateModelReport.class, "measureTime") + .addTest(CodeGenerationFromUMLProject.class, "measureTime") + .addTest(ApplyDesignPattern.class, "measureTime") + */ + .enableModules(".*").clusters(".*").reuseUserDir(true))); + + return suite; + } + +} diff -r e53c993c0d49 -r 7b6e218ca0af performance/test/qa-functional/src/org/netbeans/performance/uml/MeasureUMLMemoryFootprintTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/performance/test/qa-functional/src/org/netbeans/performance/uml/MeasureUMLMemoryFootprintTest.java Tue Jun 28 16:36:36 2011 -0400 @@ -0,0 +1,73 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved. + * + * Oracle and Java are registered trademarks of Oracle and/or its affiliates. + * Other names may be trademarks of their respective owners. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * Contributor(s): + * + * The Original Software is NetBeans. The Initial Developer of the Original + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun + * Microsystems, Inc. All Rights Reserved. + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + */ + + +package org.netbeans.performance.uml; + +import org.netbeans.junit.NbModuleSuite; +import org.netbeans.junit.NbTestSuite; +import org.netbeans.modules.performance.utilities.PerformanceTestCase; +import org.netbeans.performance.uml.footprint.UMLWorkflow; + +/** + * Measure UI-RESPONSIVENES and WINDOW_OPENING. + * + * @author mrkam@netbeans.org + */ +public class MeasureUMLMemoryFootprintTest { + + public static NbTestSuite suite() { + PerformanceTestCase.prepareForMeasurements(); + + NbTestSuite suite = new NbTestSuite("UML Memory Footprint suite"); + System.setProperty("suitename", MeasureUMLMemoryFootprintTest.class.getCanonicalName()); + + + suite.addTest(NbModuleSuite.create(NbModuleSuite.createConfiguration(UMLWorkflow.class) + .enableModules(".*").clusters(".*").reuseUserDir(true))); + + return suite; + } + +} diff -r e53c993c0d49 -r 7b6e218ca0af performance/test/qa-functional/src/org/netbeans/performance/uml/MeasureUMLMenusTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/performance/test/qa-functional/src/org/netbeans/performance/uml/MeasureUMLMenusTest.java Tue Jun 28 16:36:36 2011 -0400 @@ -0,0 +1,73 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved. + * + * Oracle and Java are registered trademarks of Oracle and/or its affiliates. + * Other names may be trademarks of their respective owners. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * Contributor(s): + * + * The Original Software is NetBeans. The Initial Developer of the Original + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun + * Microsystems, Inc. All Rights Reserved. + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + */ + + +package org.netbeans.performance.uml; + +import org.netbeans.junit.NbModuleSuite; +import org.netbeans.junit.NbTestSuite; +import org.netbeans.modules.performance.utilities.PerformanceTestCase; +import org.netbeans.performance.uml.menus.*; + +/** + * Measure UI-RESPONSIVENES and WINDOW_OPENING. + * + * @author mmirilovic@netbeans.org, mrkam@netbeans.org + */ +public class MeasureUMLMenusTest { + + public static NbTestSuite suite() { + PerformanceTestCase.prepareForMeasurements(); + + NbTestSuite suite = new NbTestSuite("UI Responsiveness UML Menus suite"); + System.setProperty("suitename", MeasureUMLMenusTest.class.getCanonicalName()); + + suite.addTest(NbModuleSuite.create(NbModuleSuite.createConfiguration(MultipleNodeContextMenu.class) + .addTest(MultipleNodeContextMenu.class, "measureTime") + .enableModules(".*").clusters(".*").reuseUserDir(true))); + + return suite; + } + +} diff -r e53c993c0d49 -r 7b6e218ca0af performance/test/qa-functional/src/org/netbeans/performance/uml/MeasureUMLSetupTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/performance/test/qa-functional/src/org/netbeans/performance/uml/MeasureUMLSetupTest.java Tue Jun 28 16:36:36 2011 -0400 @@ -0,0 +1,85 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved. + * + * Oracle and Java are registered trademarks of Oracle and/or its affiliates. + * Other names may be trademarks of their respective owners. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * Contributor(s): + * + * The Original Software is NetBeans. The Initial Developer of the Original + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun + * Microsystems, Inc. All Rights Reserved. + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + */ + + +package org.netbeans.performance.uml; + +import junit.framework.Test; +import org.netbeans.junit.NbModuleSuite; +import org.netbeans.performance.uml.setup.UMLSetup; + +import org.netbeans.junit.NbTestSuite; + +/** + * Test suite that actually does not perform any test but sets up user directory + * for UI responsiveness tests + * + * @author mrkam@netbeans.org + */ +public class MeasureUMLSetupTest extends NbTestSuite { + + public MeasureUMLSetupTest (java.lang.String testName) { + super(testName); + } + + public static Test suite() { + NbTestSuite suite = new NbTestSuite("UI Responsiveness Setup suite for UML Pack"); + System.setProperty("suitename", MeasureUMLSetupTest.class.getCanonicalName()); + + suite.addTest(NbModuleSuite.create( + NbModuleSuite.createConfiguration(UMLSetup.class) + .addTest("closeMemoryToolbar") + + .addTest("openJEditModelProject") + .addTest("openJEditProject") + + .addTest("closeAllDocuments") + .enableModules(".*") + .clusters(".*") + )); + + return suite; + } + +} diff -r e53c993c0d49 -r 7b6e218ca0af performance/test/qa-functional/src/org/netbeans/performance/uml/UMLUtilities.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/performance/test/qa-functional/src/org/netbeans/performance/uml/UMLUtilities.java Tue Jun 28 16:36:36 2011 -0400 @@ -0,0 +1,64 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved. + * + * Oracle and Java are registered trademarks of Oracle and/or its affiliates. + * Other names may be trademarks of their respective owners. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * Contributor(s): + * + * The Original Software is NetBeans. The Initial Developer of the Original + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun + * Microsystems, Inc. All Rights Reserved. + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + */ + + +package org.netbeans.performance.uml; + +import org.netbeans.jellytools.ProjectsTabOperator; +import org.netbeans.jellytools.nodes.Node; +import org.netbeans.modules.performance.utilities.CommonUtilities; + +/** + * Utilities for Performance tests, workarrounds, often used methods, ... + * + * @author mmirilovic@netbeans.org + */ +public class UMLUtilities extends CommonUtilities { + + public static Node getProcessFilesNode(String project){ + String processNode = org.netbeans.jellytools.Bundle.getString("org.netbeans.modules.bpel.project.ui.Bundle", "LBL_Node_Sources"); + return new Node(new ProjectsTabOperator().getProjectRootNode(project),processNode); + } + +} diff -r e53c993c0d49 -r 7b6e218ca0af performance/test/qa-functional/src/org/netbeans/performance/uml/actions/ApplyDesignPattern.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/performance/test/qa-functional/src/org/netbeans/performance/uml/actions/ApplyDesignPattern.java Tue Jun 28 16:36:36 2011 -0400 @@ -0,0 +1,144 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved. + * + * Oracle and Java are registered trademarks of Oracle and/or its affiliates. + * Other names may be trademarks of their respective owners. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * Contributor(s): + * + * The Original Software is NetBeans. The Initial Developer of the Original + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun + * Microsystems, Inc. All Rights Reserved. + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + */ +package org.netbeans.performance.uml.actions; + + +import org.netbeans.jellytools.ProjectsTabOperator; +import org.netbeans.jellytools.nodes.Node; +import org.netbeans.jellytools.TopComponentOperator; +import org.netbeans.jellytools.NbDialogOperator; + +import org.netbeans.jemmy.EventTool; +import org.netbeans.jemmy.operators.JButtonOperator; +import org.netbeans.jemmy.operators.JComboBoxOperator; +import org.netbeans.jemmy.operators.ComponentOperator; +import org.netbeans.jemmy.operators.JCheckBoxOperator; +import org.netbeans.modules.performance.utilities.CommonUtilities; +import org.netbeans.modules.performance.utilities.PerformanceTestCase; +import org.netbeans.modules.project.ui.test.ProjectSupport; + + + +/** + * Measure UI-RESPONSIVENES and WINDOW_OPENING. + * + * @author rashid@netbeans.org + * + */ +public class ApplyDesignPattern extends PerformanceTestCase { + + private static String testProjectName = "jEdit-Model"; + private Node diag; + private NbDialogOperator d_wizard; + + /** Creates a new instance of ApplyDesignPattern */ + public ApplyDesignPattern(String testName) { + super(testName); + expectedTime = 5000; + WAIT_AFTER_OPEN = 4000; + } + + public ApplyDesignPattern(String testName, String performanceDataName) { + super(testName, performanceDataName); + expectedTime = 5000; + WAIT_AFTER_OPEN = 4000; + } + + @Override + public void initialize() { + log(":: initialize"); + + ProjectSupport.openProject(CommonUtilities.getProjectsDir() + testProjectName); + } + + public void prepare() { + log(":: prepare"); + Node pNode = new ProjectsTabOperator().getProjectRootNode(testProjectName); + diag = new Node(pNode, "Model"); + diag.select(); + diag.performPopupActionNoBlock("Apply Design Pattern"); + NbDialogOperator a_wizard = new NbDialogOperator("Design Pattern Apply Wizard"); + JButtonOperator a_wizard_next = new JButtonOperator(a_wizard, "Next"); + a_wizard_next.push(); + + d_wizard = new NbDialogOperator("Design Pattern Wizard"); + JButtonOperator d_wizard_next = new JButtonOperator(d_wizard, "Next"); + JComboBoxOperator projectCombo = new JComboBoxOperator(d_wizard); + projectCombo.selectItem("EJB2.0"); + + d_wizard_next.push(); + new EventTool().waitNoEvent(1000); + d_wizard_next.push(); + new EventTool().waitNoEvent(1000); + d_wizard_next.push(); + JCheckBoxOperator d_wizardCheck = new JCheckBoxOperator(d_wizard, "Create class diagram"); + d_wizardCheck.doClick(); + d_wizard_next.push(); + } + + public ComponentOperator open() { + log("::open"); + + JButtonOperator d_wizard_finish = new JButtonOperator(d_wizard, "Finish"); + d_wizard_finish.push(); + + return new TopComponentOperator("BeanManagedDiagram"); + + } + + @Override + protected void shutdown() { + log("::shutdown"); + ProjectSupport.closeProject(testProjectName); + } + + @Override + public void close() { + log("::close"); + } + +// public static void main(java.lang.String[] args) { +// junit.textui.TestRunner.run(new ApplyDesignPattern("measureTime")); +// } +} diff -r e53c993c0d49 -r 7b6e218ca0af performance/test/qa-functional/src/org/netbeans/performance/uml/actions/CodeGenerationFromUMLProject.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/performance/test/qa-functional/src/org/netbeans/performance/uml/actions/CodeGenerationFromUMLProject.java Tue Jun 28 16:36:36 2011 -0400 @@ -0,0 +1,122 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved. + * + * Oracle and Java are registered trademarks of Oracle and/or its affiliates. + * Other names may be trademarks of their respective owners. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * Contributor(s): + * + * The Original Software is NetBeans. The Initial Developer of the Original + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun + * Microsystems, Inc. All Rights Reserved. + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + */ +package org.netbeans.performance.uml.actions; + + +import org.netbeans.jellytools.ProjectsTabOperator; +import org.netbeans.jellytools.nodes.Node; +import org.netbeans.jellytools.OutputOperator; +import org.netbeans.jellytools.OutputTabOperator; +import org.netbeans.jellytools.NbDialogOperator; + +import org.netbeans.jemmy.operators.ComponentOperator; +import org.netbeans.modules.performance.utilities.CommonUtilities; +import org.netbeans.modules.performance.utilities.PerformanceTestCase; +import org.netbeans.modules.project.ui.test.ProjectSupport; + + + +/** + * Measure UI-RESPONSIVENES and WINDOW_OPENING. + * + * @author rashid@netbeans.org + * + */ +public class CodeGenerationFromUMLProject extends PerformanceTestCase { + + private static String testProjectName = "jEdit-Model"; + private NbDialogOperator codeDialog; + + /** Creates a new instance of GenerateModelReport */ + public CodeGenerationFromUMLProject(String testName) { + super(testName); + expectedTime = 10000; + WAIT_AFTER_OPEN = 4000; + } + + public CodeGenerationFromUMLProject(String testName, String performanceDataName) { + super(testName, performanceDataName); + expectedTime = 10000; + WAIT_AFTER_OPEN = 4000; + } + + @Override + public void initialize() { + log(":: initialize"); + ProjectSupport.openProject(CommonUtilities.getProjectsDir() + testProjectName); + } + + public void prepare() { + log(":: prepare"); + Node pNode = new ProjectsTabOperator().getProjectRootNode(testProjectName); + pNode.performPopupActionNoBlock("Generate Code..."); + } + + public ComponentOperator open() { + log("::open"); + codeDialog = new NbDialogOperator("Generate Code"); + codeDialog.ok(); + OutputOperator oot = new OutputOperator(); + oot.getTimeouts().setTimeout("ComponentOperator.WaitStateTimeout", 600000); + OutputTabOperator asot = oot.getOutputTab("Generate Code Log"); + asot.getTimeouts().setTimeout("ComponentOperator.WaitStateTimeout", 600000); + asot.waitText("Task Successful"); + return null; + } + + @Override + protected void shutdown() { + log("::shutdown"); + ProjectSupport.closeProject(testProjectName); + } + + @Override + public void close() { + log("::close"); + } + +// public static void main(java.lang.String[] args) { +// junit.textui.TestRunner.run(new CodeGenerationFromUMLProject("measureTime")); +// } +} diff -r e53c993c0d49 -r 7b6e218ca0af performance/test/qa-functional/src/org/netbeans/performance/uml/actions/CreateClassDiagramFromMultipleNodes.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/performance/test/qa-functional/src/org/netbeans/performance/uml/actions/CreateClassDiagramFromMultipleNodes.java Tue Jun 28 16:36:36 2011 -0400 @@ -0,0 +1,154 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved. + * + * Oracle and Java are registered trademarks of Oracle and/or its affiliates. + * Other names may be trademarks of their respective owners. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * Contributor(s): + * + * The Original Software is NetBeans. The Initial Developer of the Original + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun + * Microsystems, Inc. All Rights Reserved. + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + */ +package org.netbeans.performance.uml.actions; + +import java.awt.event.InputEvent; + + +import javax.swing.tree.TreePath; +import org.netbeans.jellytools.ProjectsTabOperator; +import org.netbeans.jellytools.actions.CloseAllDocumentsAction; +import org.netbeans.jellytools.nodes.Node; +import org.netbeans.jellytools.NbDialogOperator; + + + +import org.netbeans.jemmy.operators.JTreeOperator; +import org.netbeans.jemmy.operators.JPopupMenuOperator; +import org.netbeans.jemmy.EventTool; +import org.netbeans.jemmy.operators.ComponentOperator; +import org.netbeans.jemmy.operators.JListOperator; +import org.netbeans.jemmy.operators.JButtonOperator; +import org.netbeans.jemmy.operators.JComboBoxOperator; +import org.netbeans.modules.performance.utilities.CommonUtilities; +import org.netbeans.modules.performance.utilities.PerformanceTestCase; +import org.netbeans.modules.project.ui.test.ProjectSupport; + +/** + * Measure UI-RESPONSIVENES and WINDOW_OPENING. + * + * @author rashid@netbeans.org + * + */ +public class CreateClassDiagramFromMultipleNodes extends PerformanceTestCase { + + private static String testProjectName = "jEdit-Model"; + private NbDialogOperator create_diag; + + /** Creates a new instance of CreateClassDiagramFromMultipleNodes */ + public CreateClassDiagramFromMultipleNodes(String testName) { + super(testName); + expectedTime = 5000; + WAIT_AFTER_OPEN = 4000; + } + + public CreateClassDiagramFromMultipleNodes(String testName, String performanceDataName) { + super(testName, performanceDataName); + expectedTime = 5000; + WAIT_AFTER_OPEN = 4000; + } + + @Override + public void initialize() { + log(":: initialize"); + ProjectSupport.openProject(CommonUtilities.getProjectsDir() + testProjectName); + } + + public void prepare() { + log(":: prepare"); + + Node pNode = new ProjectsTabOperator().getProjectRootNode(testProjectName); + Node diag1 = new Node(pNode, "Model|org|gjt|sp|jedit|gui|AbbrevEditor"); + Node diag2 = new Node(pNode, "Model|org|gjt|sp|jedit|gui|IOProgressMonitor"); + JTreeOperator projectTree = new ProjectsTabOperator().tree(); + + TreePath path1 = diag1.getTreePath(); + TreePath path2 = diag2.getTreePath(); + + projectTree.clickOnPath(path1, 1, InputEvent.BUTTON1_MASK); + new EventTool().waitNoEvent(500); + projectTree.clickOnPath(path2, 1, InputEvent.BUTTON1_MASK, InputEvent.SHIFT_MASK); + new EventTool().waitNoEvent(2000); + projectTree.clickOnPath(path2, 1, InputEvent.BUTTON3_MASK); + + log(projectTree.getSelectionCount() + " elements selected"); + + JPopupMenuOperator selectMenu = new JPopupMenuOperator(); + + selectMenu.pushMenu("Create Diagram From Selected Elements"); + + create_diag = new NbDialogOperator("Create New Diagram"); + create_diag.move(0, 0); + new EventTool().waitNoEvent(1000); + JListOperator diag_type = new JListOperator(create_diag, 1); + diag_type.selectItem("Class Diagram"); + JComboBoxOperator spaceCombo = new JComboBoxOperator(create_diag); + spaceCombo.selectItem("jEdit-Model"); + } + + public ComponentOperator open() { + log("::open"); + + JButtonOperator finishButton = new JButtonOperator(create_diag, "Finish"); + finishButton.push(); + + return null; + } + + @Override + protected void shutdown() { + log("::shutdown"); + ProjectSupport.closeProject(testProjectName); + } + + @Override + public void close() { + log("::close"); + new CloseAllDocumentsAction().performAPI(); + } + +// public static void main(java.lang.String[] args) { +// junit.textui.TestRunner.run(new CreateClassDiagramFromMultipleNodes("measureTime")); +// } +} diff -r e53c993c0d49 -r 7b6e218ca0af performance/test/qa-functional/src/org/netbeans/performance/uml/actions/CreateEmptyDiagram.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/performance/test/qa-functional/src/org/netbeans/performance/uml/actions/CreateEmptyDiagram.java Tue Jun 28 16:36:36 2011 -0400 @@ -0,0 +1,130 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved. + * + * Oracle and Java are registered trademarks of Oracle and/or its affiliates. + * Other names may be trademarks of their respective owners. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * Contributor(s): + * + * The Original Software is NetBeans. The Initial Developer of the Original + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun + * Microsystems, Inc. All Rights Reserved. + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + */ +package org.netbeans.performance.uml.actions; + + +import org.netbeans.jellytools.ProjectsTabOperator; +import org.netbeans.jellytools.actions.CloseAllDocumentsAction; +import org.netbeans.jellytools.nodes.Node; +import org.netbeans.jellytools.NbDialogOperator; + +import org.netbeans.jemmy.EventTool; +import org.netbeans.jemmy.operators.ComponentOperator; +import org.netbeans.jemmy.operators.JListOperator; +import org.netbeans.jemmy.operators.JButtonOperator; +import org.netbeans.modules.performance.utilities.CommonUtilities; +import org.netbeans.modules.performance.utilities.PerformanceTestCase; +import org.netbeans.modules.project.ui.test.ProjectSupport; + + + +/** + * Measure UI-RESPONSIVENES and WINDOW_OPENING. + * + * @author rashid@netbeans.org + * + */ +public class CreateEmptyDiagram extends PerformanceTestCase { + + private String testProjectName = "jEdit-Model"; + private NbDialogOperator create_diag; + + /** Creates a new instance of CreateEmptyDiagram */ + public CreateEmptyDiagram(String testName) { + super(testName); + expectedTime = 5000; + WAIT_AFTER_OPEN = 4000; + } + + public CreateEmptyDiagram(String testName, String performanceDataName) { + super(testName, performanceDataName); + expectedTime = 5000; + WAIT_AFTER_OPEN = 4000; + } + + @Override + public void initialize() { + log(":: initialize"); + ProjectSupport.openProject(CommonUtilities.getProjectsDir() + testProjectName); + } + + public void prepare() { + log(":: prepare"); + Node pNode = new ProjectsTabOperator().getProjectRootNode(testProjectName); + Node doc = new Node(pNode, "Diagrams"); + doc.select(); + + doc.performPopupAction("New|Diagram..."); + create_diag = new NbDialogOperator("Create New Diagram"); + new EventTool().waitNoEvent(2000); + JListOperator diag_type = new JListOperator(create_diag, 1); + + diag_type.selectItem("Class Diagram"); + } + + public ComponentOperator open() { + log("::open"); + + JButtonOperator finishButton = new JButtonOperator(create_diag, "Finish"); + finishButton.push(); + + return null; + } + + @Override + protected void shutdown() { + log("::shutdown"); + ProjectSupport.closeProject(testProjectName); + } + + @Override + public void close() { + log("::close"); + new CloseAllDocumentsAction().performAPI(); + } + +// public static void main(java.lang.String[] args) { +// junit.textui.TestRunner.run(new CreateEmptyDiagram("measureTime")); +// } +} diff -r e53c993c0d49 -r 7b6e218ca0af performance/test/qa-functional/src/org/netbeans/performance/uml/actions/CreateSequenceDiagramFromMultipleNodes.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/performance/test/qa-functional/src/org/netbeans/performance/uml/actions/CreateSequenceDiagramFromMultipleNodes.java Tue Jun 28 16:36:36 2011 -0400 @@ -0,0 +1,158 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved. + * + * Oracle and Java are registered trademarks of Oracle and/or its affiliates. + * Other names may be trademarks of their respective owners. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * Contributor(s): + * + * The Original Software is NetBeans. The Initial Developer of the Original + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun + * Microsystems, Inc. All Rights Reserved. + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + */ +package org.netbeans.performance.uml.actions; + +import java.awt.event.InputEvent; + +import javax.swing.tree.TreePath; + +import org.netbeans.jellytools.MainWindowOperator; +import org.netbeans.jellytools.ProjectsTabOperator; +import org.netbeans.jellytools.actions.CloseAllDocumentsAction; +import org.netbeans.jellytools.nodes.Node; +import org.netbeans.jellytools.NbDialogOperator; + + + +import org.netbeans.jemmy.EventTool; +import org.netbeans.jemmy.operators.ComponentOperator; +import org.netbeans.jemmy.operators.JTreeOperator; +import org.netbeans.jemmy.operators.JPopupMenuOperator; +import org.netbeans.jemmy.operators.JListOperator; +import org.netbeans.jemmy.operators.JButtonOperator; +import org.netbeans.modules.performance.utilities.CommonUtilities; +import org.netbeans.modules.performance.utilities.PerformanceTestCase; +import org.netbeans.modules.project.ui.test.ProjectSupport; + +/** + * Measure UI-RESPONSIVENES and WINDOW_OPENING. + * + * @author rashid@netbeans.org + * + */ +public class CreateSequenceDiagramFromMultipleNodes extends PerformanceTestCase { + + private static String testProjectName = "jEdit-Model"; + private NbDialogOperator create_diag; + + /** Creates a new instance of CreateSequenceDiagramFromMultipleNodes */ + public CreateSequenceDiagramFromMultipleNodes(String testName) { + super(testName); + expectedTime = 5000; + WAIT_AFTER_OPEN = 4000; + } + + public CreateSequenceDiagramFromMultipleNodes(String testName, String performanceDataName) { + super(testName, performanceDataName); + expectedTime = 5000; + WAIT_AFTER_OPEN = 4000; + } + + @Override + public void initialize() { + log(":: initialize"); + ProjectSupport.openProject(CommonUtilities.getProjectsDir() + testProjectName); + MainWindowOperator.getDefault().maximize(); + new EventTool().waitNoEvent(500); + } + + public void prepare() { + log(":: prepare"); + new EventTool().waitNoEvent(1000); + Node pNode = new ProjectsTabOperator().getProjectRootNode(testProjectName); + Node diag1 = new Node(pNode, "Model|org|gjt|sp|jedit|gui|AbbrevEditor"); + Node diag2 = new Node(pNode, "Model|org|gjt|sp|jedit|gui|IOProgressMonitor"); + JTreeOperator projectTree = new ProjectsTabOperator().tree(); + + TreePath path1 = diag1.getTreePath(); + TreePath path2 = diag2.getTreePath(); + + projectTree.clickOnPath(path1, 1, InputEvent.BUTTON1_MASK); + new EventTool().waitNoEvent(500); + projectTree.clickOnPath(path2, 1, InputEvent.BUTTON1_MASK, InputEvent.SHIFT_MASK); + new EventTool().waitNoEvent(2000); + projectTree.clickOnPath(path2, 1, InputEvent.BUTTON3_MASK); + + log(projectTree.getSelectionCount() + " elements selected"); + if (projectTree.getSelectionCount() != 30) { + for(TreePath tp : projectTree.getSelectionPaths()) { + log(tp.toString()); + } + } + + JPopupMenuOperator selectMenu = new JPopupMenuOperator(); + selectMenu.pushMenu("Create Diagram From Selected Elements"); + + create_diag = new NbDialogOperator("Create New Diagram"); + new EventTool().waitNoEvent(1000); + JListOperator diag_type = new JListOperator(create_diag, 1); + diag_type.selectItem("Sequence Diagram"); + + } + + public ComponentOperator open() { + log("::open"); + + JButtonOperator finishButton = new JButtonOperator(create_diag, "Finish"); + finishButton.push(); + + return null; + } + + @Override + protected void shutdown() { + log("::shutdown"); + ProjectSupport.closeProject(testProjectName); + } + + @Override + public void close() { + log("::close"); + new CloseAllDocumentsAction().performAPI(); + } + +// public static void main(java.lang.String[] args) { +// junit.textui.TestRunner.run(new CreateSequenceDiagramFromMultipleNodes("measureTime")); +// } +} diff -r e53c993c0d49 -r 7b6e218ca0af performance/test/qa-functional/src/org/netbeans/performance/uml/actions/GenerateDependencyDiagram.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/performance/test/qa-functional/src/org/netbeans/performance/uml/actions/GenerateDependencyDiagram.java Tue Jun 28 16:36:36 2011 -0400 @@ -0,0 +1,124 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved. + * + * Oracle and Java are registered trademarks of Oracle and/or its affiliates. + * Other names may be trademarks of their respective owners. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * Contributor(s): + * + * The Original Software is NetBeans. The Initial Developer of the Original + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun + * Microsystems, Inc. All Rights Reserved. + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + */ +package org.netbeans.performance.uml.actions; + + +import org.netbeans.jellytools.ProjectsTabOperator; +import org.netbeans.jellytools.actions.CloseAllDocumentsAction; +import org.netbeans.jellytools.nodes.Node; +import org.netbeans.jellytools.TopComponentOperator; + +import org.netbeans.jemmy.EventTool; +import org.netbeans.jemmy.operators.ComponentOperator; +import org.netbeans.modules.performance.utilities.CommonUtilities; +import org.netbeans.modules.performance.utilities.PerformanceTestCase; +import org.netbeans.modules.project.ui.test.ProjectSupport; + + + +/** + * Measure UI-RESPONSIVENES and WINDOW_OPENING. + * + * @author rashid@netbeans.org + * + */ +public class GenerateDependencyDiagram extends PerformanceTestCase { + + private static String testProjectName = "jEdit-Model"; + private static String testDiagramName = "jEdit"; + private Node diag; + public static final long EXPECTED_TIME = 5000; + + /** Creates a new instance of GenerateDependencyDiagram */ + public GenerateDependencyDiagram(String testName) { + super(testName); + expectedTime = EXPECTED_TIME; + WAIT_AFTER_OPEN = 4000; + } + + public GenerateDependencyDiagram(String testName, String performanceDataName) { + super(testName, performanceDataName); + expectedTime = EXPECTED_TIME; + WAIT_AFTER_OPEN = 4000; + } + + @Override + public void initialize() { + log(":: initialize"); + ProjectSupport.openProject(CommonUtilities.getProjectsDir() + testProjectName); + } + + public void prepare() { + log(":: prepare"); + Node pNode = new ProjectsTabOperator().getProjectRootNode(testProjectName); + diag = new Node(pNode, "Model" + "|" + "org" + "|" + "gjt" + "|" + "sp" + "|" + "jedit" + "|" + testDiagramName); + diag.select(); + } + + public ComponentOperator open() { + log("::open"); + new EventTool().waitNoEvent(2000); + diag.performPopupAction("Generate Dependency Diagram"); + return new TopComponentOperator("jEditDependencies"); + + } + + @Override + protected void shutdown() { + log("::shutdown"); + ProjectSupport.closeProject(testProjectName); +// new CloseAllDocumentsAction().performAPI(); + } + + @Override + public void close() { + log("::close"); + new CloseAllDocumentsAction().performAPI(); + + } + +// public static void main(java.lang.String[] args) { +// junit.textui.TestRunner.run(new GenerateDependencyDiagram("measureTime")); +// } +} diff -r e53c993c0d49 -r 7b6e218ca0af performance/test/qa-functional/src/org/netbeans/performance/uml/actions/GenerateModelReport.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/performance/test/qa-functional/src/org/netbeans/performance/uml/actions/GenerateModelReport.java Tue Jun 28 16:36:36 2011 -0400 @@ -0,0 +1,117 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved. + * + * Oracle and Java are registered trademarks of Oracle and/or its affiliates. + * Other names may be trademarks of their respective owners. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * Contributor(s): + * + * The Original Software is NetBeans. The Initial Developer of the Original + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun + * Microsystems, Inc. All Rights Reserved. + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + */ +package org.netbeans.performance.uml.actions; + + +import org.netbeans.jellytools.ProjectsTabOperator; +import org.netbeans.jellytools.actions.CloseAllDocumentsAction; +import org.netbeans.jellytools.nodes.Node; +import org.netbeans.jellytools.OutputOperator; +import org.netbeans.jellytools.OutputTabOperator; + +import org.netbeans.jemmy.operators.ComponentOperator; +import org.netbeans.modules.performance.utilities.CommonUtilities; +import org.netbeans.modules.performance.utilities.PerformanceTestCase; +import org.netbeans.modules.project.ui.test.ProjectSupport; + + +/** + * Measure UI-RESPONSIVENES and WINDOW_OPENING. + * + * @author rashid@netbeans.org + * + */ +public class GenerateModelReport extends PerformanceTestCase { + + private static String testProjectName = "jEdit-Model"; + + /** Creates a new instance of GenerateModelReport */ + public GenerateModelReport(String testName) { + super(testName); + expectedTime = 300000; + WAIT_AFTER_OPEN = 4000; + } + + public GenerateModelReport(String testName, String performanceDataName) { + super(testName, performanceDataName); + expectedTime = 300000; + WAIT_AFTER_OPEN = 4000; + } + + @Override + public void initialize() { + log(":: initialize"); + ProjectSupport.openProject(CommonUtilities.getProjectsDir() + testProjectName); + } + + public void prepare() { + log(":: prepare"); + } + + public ComponentOperator open() { + log("::open"); + Node pNode = new ProjectsTabOperator().getProjectRootNode(testProjectName); + pNode.performPopupAction("Generate Model Report"); + OutputOperator oot = new OutputOperator(); + oot.getTimeouts().setTimeout("ComponentOperator.WaitStateTimeout", 300000); + OutputTabOperator asot = oot.getOutputTab("UML Report Log"); + asot.getTimeouts().setTimeout("ComponentOperator.WaitStateTimeout", 300000); + asot.waitText("Report Successful"); + return null; + } + + protected void shutdown() { + log("::shutdown"); + ProjectSupport.closeProject(testProjectName); + } + + public void close() { + log("::close"); + new CloseAllDocumentsAction().performAPI(); + } + +// public static void main(java.lang.String[] args) { +// junit.textui.TestRunner.run(new GenerateModelReport("measureTime")); +// } +} diff -r e53c993c0d49 -r 7b6e218ca0af performance/test/qa-functional/src/org/netbeans/performance/uml/actions/OpenUMLDiagram.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/performance/test/qa-functional/src/org/netbeans/performance/uml/actions/OpenUMLDiagram.java Tue Jun 28 16:36:36 2011 -0400 @@ -0,0 +1,118 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved. + * + * Oracle and Java are registered trademarks of Oracle and/or its affiliates. + * Other names may be trademarks of their respective owners. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * Contributor(s): + * + * The Original Software is NetBeans. The Initial Developer of the Original + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun + * Microsystems, Inc. All Rights Reserved. + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + */ +package org.netbeans.performance.uml.actions; + + +import org.netbeans.jellytools.ProjectsTabOperator; +import org.netbeans.jellytools.actions.CloseAllDocumentsAction; +import org.netbeans.jellytools.nodes.Node; +import org.netbeans.jellytools.TopComponentOperator; + +import org.netbeans.jemmy.operators.ComponentOperator; +import org.netbeans.modules.performance.utilities.CommonUtilities; +import org.netbeans.modules.performance.utilities.PerformanceTestCase; +import org.netbeans.modules.project.ui.test.ProjectSupport; + + +/** + * Measure UI-RESPONSIVENES and WINDOW_OPENING. + * + * @author rashid@netbeans.org + * + */ +public class OpenUMLDiagram extends PerformanceTestCase { + + private static String testProjectName = "jEdit-Model"; + private static String testDiagramName = "ClassDiagram"; + + /** Creates a new instance of OpenUMLDiagram */ + public OpenUMLDiagram(String testName) { + super(testName); + expectedTime = 2000; + WAIT_AFTER_OPEN = 4000; + } + + public OpenUMLDiagram(String testName, String performanceDataName) { + super(testName, performanceDataName); + expectedTime = 2000; + WAIT_AFTER_OPEN = 4000; + } + + @Override + public void initialize() { + log(":: initialize"); + ProjectSupport.openProject(CommonUtilities.getProjectsDir() + testProjectName); + } + + public void prepare() { + log(":: prepare"); + } + + public ComponentOperator open() { + log("::open"); + + Node pNode = new ProjectsTabOperator().getProjectRootNode(testProjectName); + Node diag = new Node(pNode, "Diagrams" + "|" + testDiagramName); + diag.select(); + diag.performPopupAction("Open"); + + return new TopComponentOperator(testDiagramName); + } + + @Override + protected void shutdown() { + log("::shutdown"); + ProjectSupport.closeProject(testProjectName); + } + + @Override + public void close() { + log("::close"); + new CloseAllDocumentsAction().performAPI(); + } + +// public static void main(java.lang.String[] args) { +// junit.textui.TestRunner.run(new OpenUMLDiagram("measureTime")); +// } +} diff -r e53c993c0d49 -r 7b6e218ca0af performance/test/qa-functional/src/org/netbeans/performance/uml/actions/OpenUMLProject.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/performance/test/qa-functional/src/org/netbeans/performance/uml/actions/OpenUMLProject.java Tue Jun 28 16:36:36 2011 -0400 @@ -0,0 +1,125 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved. + * + * Oracle and Java are registered trademarks of Oracle and/or its affiliates. + * Other names may be trademarks of their respective owners. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * Contributor(s): + * + * The Original Software is NetBeans. The Initial Developer of the Original + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun + * Microsystems, Inc. All Rights Reserved. + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + */ +package org.netbeans.performance.uml.actions; + +import org.netbeans.performance.uml.UMLUtilities; +import org.netbeans.jellytools.actions.ActionNoBlock; +import org.netbeans.jellytools.actions.CloseAllDocumentsAction; +import org.netbeans.jellytools.WizardOperator; + +import org.netbeans.jemmy.EventTool; +import org.netbeans.jemmy.operators.JButtonOperator; +import org.netbeans.jemmy.operators.JTextComponentOperator; +import org.netbeans.jemmy.operators.ComponentOperator; +import org.netbeans.modules.performance.utilities.CommonUtilities; +import org.netbeans.modules.performance.utilities.PerformanceTestCase; +import org.netbeans.modules.project.ui.test.ProjectSupport; + + + +/** + * Test Open UML Project + * + * @author rashid@netbeans.org + */ +public class OpenUMLProject extends PerformanceTestCase { + + private static String projectName = "jEdit-Model-open"; + private JButtonOperator openButton; + + /** + * Creates a new instance of OpenUMLProject + * @param testName the name of the test + */ + public OpenUMLProject(String testName) { + super(testName); + expectedTime = 10000; + WAIT_AFTER_OPEN = 4000; + } + + /** + * Creates a new instance of OpenUMLProject + * @param testName the name of the test + * @param performanceDataName measured values will be saved under this name + */ + public OpenUMLProject(String testName, String performanceDataName) { + super(testName, performanceDataName); + expectedTime = 10000; + WAIT_AFTER_OPEN = 4000; + } + + @Override + public void initialize() { + } + + public void prepare() { + new ActionNoBlock("File|Open Project...", null).perform(); //NOI18N + + WizardOperator opd = new WizardOperator("Open Project"); //NOI18N + + JTextComponentOperator path = new JTextComponentOperator(opd, 1); + openButton = new JButtonOperator(opd, "Open Project"); //NOI18N + + String paths = CommonUtilities.getProjectsDir() + projectName; + path.setText(paths); + } + + public ComponentOperator open() { + openButton.pushNoBlock(); + UMLUtilities.waitScanFinished(); + UMLUtilities.waitForPendingBackgroundTasks(); + return null; + } + + @Override + public void close() { + ProjectSupport.closeProject(projectName); + new EventTool().waitNoEvent(2000); + + } + +// public static void main(java.lang.String[] args) { +// junit.textui.TestRunner.run(new OpenUMLProject("measureTime")); +// } +} diff -r e53c993c0d49 -r 7b6e218ca0af performance/test/qa-functional/src/org/netbeans/performance/uml/actions/ReverseEngineering.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/performance/test/qa-functional/src/org/netbeans/performance/uml/actions/ReverseEngineering.java Tue Jun 28 16:36:36 2011 -0400 @@ -0,0 +1,135 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved. + * + * Oracle and Java are registered trademarks of Oracle and/or its affiliates. + * Other names may be trademarks of their respective owners. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * Contributor(s): + * + * The Original Software is NetBeans. The Initial Developer of the Original + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun + * Microsystems, Inc. All Rights Reserved. + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + */ +package org.netbeans.performance.uml.actions; + + +import org.netbeans.jellytools.ProjectsTabOperator; +import org.netbeans.jellytools.nodes.Node; +import org.netbeans.jellytools.NbDialogOperator; +import org.netbeans.jellytools.OutputOperator; +import org.netbeans.jellytools.OutputTabOperator; + + + +import org.netbeans.jemmy.EventTool; +import org.netbeans.jemmy.operators.ComponentOperator; +import org.netbeans.jemmy.operators.JTextFieldOperator; +import org.netbeans.jemmy.operators.JRadioButtonOperator; +import org.netbeans.modules.performance.utilities.CommonUtilities; +import org.netbeans.modules.performance.utilities.PerformanceTestCase; +import org.netbeans.modules.project.ui.test.ProjectSupport; + +/** + * Test Reverse Engineering + * + * @author rashid@netbeans.org + */ +public class ReverseEngineering extends PerformanceTestCase { + + private static String testProjectName = "jEdit"; + private static long suffix; + + /** + * Creates a new instance of ReverseEngineering + * @param testName the name of the test + */ + public ReverseEngineering(String testName) { + super(testName); + expectedTime = 300000; + WAIT_AFTER_OPEN = 4000; + } + + /** + * Creates a new instance of ReverseEngineering + * @param testName the name of the test + * @param performanceDataName measured values will be saved under this name + */ + public ReverseEngineering(String testName, String performanceDataName) { + super(testName, performanceDataName); + expectedTime = 300000; + WAIT_AFTER_OPEN = 4000; + } + + @Override + public void initialize() { + ProjectSupport.openProject(CommonUtilities.getProjectsDir() + testProjectName); + System.gc(); + new EventTool().waitNoEvent(3000); + } + + public void prepare() { + Node pNode = new ProjectsTabOperator().getProjectRootNode(testProjectName); + pNode.select(); + pNode.performPopupAction("Reverse Engineer..."); + + new EventTool().waitNoEvent(1000); + NbDialogOperator reng = new NbDialogOperator("Reverse Engineer"); + JRadioButtonOperator newUMLradio = new JRadioButtonOperator(reng, "Create New UML Project"); + newUMLradio.push(); + new EventTool().waitNoEvent(1000); + suffix = System.currentTimeMillis(); + JTextFieldOperator textProject = new JTextFieldOperator(reng, 2); + textProject.clearText(); + textProject.typeText("jEdit-Model_" + suffix); + reng.ok(); + } + + public ComponentOperator open() { + OutputTabOperator asot = new OutputOperator().getOutputTab("Reverse Engineering"); + asot.getTimeouts().setTimeout("ComponentOperator.WaitStateTimeout", 500000); + asot.waitText("Task Successful"); + return null; + } + + @Override + public void close() { + ProjectSupport.closeProject("jEdit-Model_" + suffix); + runGC(1); + + } + +// public static void main(java.lang.String[] args) { +// junit.textui.TestRunner.run(new ReverseEngineering("measureTime")); +// } +} diff -r e53c993c0d49 -r 7b6e218ca0af performance/test/qa-functional/src/org/netbeans/performance/uml/actions/ScrollExpandedProject.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/performance/test/qa-functional/src/org/netbeans/performance/uml/actions/ScrollExpandedProject.java Tue Jun 28 16:36:36 2011 -0400 @@ -0,0 +1,124 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved. + * + * Oracle and Java are registered trademarks of Oracle and/or its affiliates. + * Other names may be trademarks of their respective owners. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * Contributor(s): + * + * The Original Software is NetBeans. The Initial Developer of the Original + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun + * Microsystems, Inc. All Rights Reserved. + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + */ +package org.netbeans.performance.uml.actions; + +import org.netbeans.jellytools.ProjectsTabOperator; +import org.netbeans.jellytools.nodes.Node; +import org.netbeans.jemmy.EventTool; +import org.netbeans.jemmy.operators.ComponentOperator; + +import org.netbeans.jemmy.operators.JScrollBarOperator; +import org.netbeans.modules.performance.guitracker.ActionTracker; +import org.netbeans.modules.performance.utilities.CommonUtilities; +import org.netbeans.modules.performance.utilities.PerformanceTestCase; +import org.netbeans.modules.project.ui.test.ProjectSupport; + +/** + * Measure UI-RESPONSIVENES and WINDOW_OPENING. + * + * @author rashid@netbeans.org + * + */ +public class ScrollExpandedProject extends PerformanceTestCase { + + private static String testProjectName = "jEdit-Model"; + private JScrollBarOperator projectScroll; + private ProjectsTabOperator pto; + + /** Creates a new instance of ScrollExpandedProject*/ + public ScrollExpandedProject(String testName) { + super(testName); + expectedTime = 2000; + WAIT_AFTER_OPEN = 4000; + } + + public ScrollExpandedProject(String testName, String performanceDataName) { + super(testName, performanceDataName); + expectedTime = 2000; + WAIT_AFTER_OPEN = 4000; + } + + @Override + public void initialize() { + log(":: initialize"); + + ProjectSupport.openProject(CommonUtilities.getProjectsDir() + testProjectName); + Node pNode = new ProjectsTabOperator().getProjectRootNode(testProjectName); + Node nodeModel = new Node(pNode, "Model"); + Node nodeDiagrams = new Node(pNode, "Diagrams"); + nodeModel.expand(); + nodeDiagrams.select(); + nodeDiagrams.expand(); + new EventTool().waitNoEvent(1000); + pto = new ProjectsTabOperator(); + projectScroll = new JScrollBarOperator(pto, 0); + MY_START_EVENT = ActionTracker.TRACK_OPEN_BEFORE_TRACE_MESSAGE; + } + + public void prepare() { + log(":: prepare"); + projectScroll.scrollToMinimum(); + } + + public ComponentOperator open() { + log("::open"); + projectScroll.scrollToMaximum(); + return null; + } + + @Override + protected void shutdown() { + log("::shutdown"); + ProjectSupport.closeProject(testProjectName); + } + + @Override + public void close() { + log("::close"); + } + +// public static void main(java.lang.String[] args) { +// junit.textui.TestRunner.run(new ScrollExpandedProject("measureTime")); +// } +} diff -r e53c993c0d49 -r 7b6e218ca0af performance/test/qa-functional/src/org/netbeans/performance/uml/actions/SelectingMultipleNodes.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/performance/test/qa-functional/src/org/netbeans/performance/uml/actions/SelectingMultipleNodes.java Tue Jun 28 16:36:36 2011 -0400 @@ -0,0 +1,135 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved. + * + * Oracle and Java are registered trademarks of Oracle and/or its affiliates. + * Other names may be trademarks of their respective owners. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * Contributor(s): + * + * The Original Software is NetBeans. The Initial Developer of the Original + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun + * Microsystems, Inc. All Rights Reserved. + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + */ +package org.netbeans.performance.uml.actions; + +import java.awt.event.InputEvent; + +import javax.swing.tree.TreePath; +import org.netbeans.jellytools.ProjectsTabOperator; +import org.netbeans.jellytools.nodes.Node; + +import org.netbeans.jemmy.EventTool; +import org.netbeans.jemmy.operators.ComponentOperator; +import org.netbeans.jemmy.operators.JTreeOperator; + + +import org.netbeans.modules.performance.guitracker.ActionTracker; +import org.netbeans.modules.performance.utilities.CommonUtilities; +import org.netbeans.modules.performance.utilities.PerformanceTestCase; +import org.netbeans.modules.project.ui.test.ProjectSupport; + +/** + * Measure UI-RESPONSIVENES and WINDOW_OPENING. + * + * @author rashid@netbeans.org + * + */ +public class SelectingMultipleNodes extends PerformanceTestCase { + + private static String testProjectName = "jEdit-Model"; + private TreePath path1, path2; + private Node pNode; + + /** Creates a new instance of SelectingMultipleNodes */ + public SelectingMultipleNodes(String testName) { + super(testName); + expectedTime = 2000; + WAIT_AFTER_OPEN = 4000; + HEURISTIC_FACTOR = -1; + } + + public SelectingMultipleNodes(String testName, String performanceDataName) { + super(testName, performanceDataName); + expectedTime = 2000; + WAIT_AFTER_OPEN = 4000; + HEURISTIC_FACTOR = -1; + } + + @Override + public void initialize() { + log(":: initialize"); + + track_mouse_event = ActionTracker.TRACK_MOUSE_PRESS; + + ProjectSupport.openProject(CommonUtilities.getProjectsDir() + testProjectName); + } + + public void prepare() { + log(":: prepare"); + pNode = new ProjectsTabOperator().getProjectRootNode(testProjectName); + Node diag1 = new Node(pNode, "Model|ClassDiagram"); + Node diag2 = new Node(pNode, "Imported Elements"); + + path1 = diag1.getTreePath(); + path2 = diag2.getTreePath(); + + new EventTool().waitNoEvent(1000); + } + + public ComponentOperator open() { + log("::open"); + + JTreeOperator projectTree = new ProjectsTabOperator().tree(); + projectTree.clickOnPath(path1, 1, InputEvent.BUTTON1_MASK); + new EventTool().waitNoEvent(500); + projectTree.clickOnPath(path2, 1, InputEvent.BUTTON1_MASK, InputEvent.SHIFT_MASK); + return null; + } + + @Override + protected void shutdown() { + log("::shutdown"); + ProjectSupport.closeProject(testProjectName); + } + + @Override + public void close() { + log("::close"); + pNode.select(); + } + +// public static void main(java.lang.String[] args) { +// junit.textui.TestRunner.run(new SelectingMultipleNodes("measureTime")); +// } +} diff -r e53c993c0d49 -r 7b6e218ca0af performance/test/qa-functional/src/org/netbeans/performance/uml/footprint/UMLFootprintUtilities.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/performance/test/qa-functional/src/org/netbeans/performance/uml/footprint/UMLFootprintUtilities.java Tue Jun 28 16:36:36 2011 -0400 @@ -0,0 +1,121 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved. + * + * Oracle and Java are registered trademarks of Oracle and/or its affiliates. + * Other names may be trademarks of their respective owners. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * Contributor(s): + * + * The Original Software is NetBeans. The Initial Developer of the Original + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun + * Microsystems, Inc. All Rights Reserved. + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + */ + +package org.netbeans.performance.uml.footprint; + +import org.netbeans.jellytools.NewProjectNameLocationStepOperator; +import org.netbeans.jellytools.NewProjectWizardOperator; +import org.netbeans.jellytools.ProjectsTabOperator; +import org.netbeans.jellytools.RuntimeTabOperator; +import org.netbeans.jellytools.nodes.Node; + +import org.netbeans.jemmy.operators.JCheckBoxOperator; +import org.netbeans.jemmy.operators.JComboBoxOperator; +import org.netbeans.modules.performance.utilities.CommonUtilities; +import org.netbeans.performance.uml.UMLUtilities; + + +/** + * Utilities for Memory footprint tests + * + * @author anebuzelsky@netbeans.org, mmirilovic@netbeans.org + */ +public class UMLFootprintUtilities extends UMLUtilities { + + static String creatJ2EEeproject(String category, String project, boolean wait) { + return createProjectGeneral(category, project, wait, true); + } + + private static String createProjectGeneral(String category, String project, boolean wait, boolean j2eeProject) { + // select Projects tab + ProjectsTabOperator.invoke(); + + // create a project + NewProjectWizardOperator wizard = NewProjectWizardOperator.invoke(); + wizard.selectCategory(category); + wizard.selectProject(project); + wizard.next(); + + NewProjectNameLocationStepOperator wizard_location = new NewProjectNameLocationStepOperator(); + wizard_location.txtProjectLocation().clearText(); + wizard_location.txtProjectLocation().typeText(CommonUtilities.getTempDir()); + String pname = wizard_location.txtProjectName().getText(); + + if(j2eeProject) { + new JComboBoxOperator(wizard_location,1).selectItem(1); + new JCheckBoxOperator(wizard_location,"Create Application Client module:").setSelected(true); + } + + // if the project exists, try to generate new name + for (int i = 0; i < 5 && !wizard.btFinish().isEnabled(); i++) { + pname = pname+"1"; + wizard_location.txtProjectName().clearText(); + wizard_location.txtProjectName().typeText(pname); + } + wizard.finish(); + + // wait 10 seconds + waitForProjectCreation(30000, wait); + + return pname; + } + +// static void killRunOnProject(String project) { +// killProcessOnProject(project, "run"); +// } +// +// static void killDebugOnProject(String project) { +// killProcessOnProject(project, "debug"); +// } + + private static void killProcessOnProject(String project, String process) { + // prepare Runtime tab + RuntimeTabOperator runtime = RuntimeTabOperator.invoke(); + + // kill the execution + Node node = new Node(runtime.getRootNode(), "Processes|"+project+ " (" + process + ")"); + node.select(); + node.performPopupAction("Terminate Process"); + } +} diff -r e53c993c0d49 -r 7b6e218ca0af performance/test/qa-functional/src/org/netbeans/performance/uml/footprint/UMLWorkflow.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/performance/test/qa-functional/src/org/netbeans/performance/uml/footprint/UMLWorkflow.java Tue Jun 28 16:36:36 2011 -0400 @@ -0,0 +1,153 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved. + * + * Oracle and Java are registered trademarks of Oracle and/or its affiliates. + * Other names may be trademarks of their respective owners. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * Contributor(s): + * + * The Original Software is NetBeans. The Initial Developer of the Original + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun + * Microsystems, Inc. All Rights Reserved. + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + */ + +package org.netbeans.performance.uml.footprint; + +import org.netbeans.jellytools.NbDialogOperator; +import org.netbeans.jellytools.OutputOperator; +import org.netbeans.jellytools.ProjectsTabOperator; +import org.netbeans.jellytools.WizardOperator; +import org.netbeans.jellytools.actions.ActionNoBlock; +import org.netbeans.jellytools.actions.OutputWindowViewAction; +import org.netbeans.jellytools.nodes.Node; +import org.netbeans.jellytools.nodes.ProjectRootNode; + +import org.netbeans.jemmy.operators.ComponentOperator; +import org.netbeans.jemmy.operators.JListOperator; +import org.netbeans.jemmy.operators.JTextFieldOperator; +import org.netbeans.modules.performance.utilities.MemoryFootprintTestCase; + +/** + * Measure UML Project Workflow Memory footprint + * + * @author mmirilovic@netbeans.org + */ +public class UMLWorkflow extends MemoryFootprintTestCase { + + private ProjectRootNode j2seproject, j2seprojectmodel; + + /** + * Creates a new instance of J2EEProjectWorkflow + * + * @param testName the name of the test + */ + public UMLWorkflow(String testName) { + super(testName); + prefix = "UML Project Workflow |"; + } + + /** + * Creates a new instance of J2EEProjectWorkflow + * + * @param testName the name of the test + * @param performanceDataName measured values will be saved under this name + */ + public UMLWorkflow(String testName, String performanceDataName) { + super(testName, performanceDataName); + prefix = "UML Project Workflow |"; + } + + @Override + public void setUp() { + //do nothing + } + + public void prepare() { + } + + @Override + public void initialize() { + super.initialize(); + UMLFootprintUtilities.closeAllDocuments(); + UMLFootprintUtilities.closeMemoryToolbar(); + } + + public ComponentOperator open(){ + // Create, edit, build and execute a sample J2SE project + String j2seprojectName = UMLFootprintUtilities.createproject("Samples|Java", "Anagram Game", true); + j2seproject = new ProjectsTabOperator().getProjectRootNode(j2seprojectName); + + new OutputWindowViewAction().performAPI(); + UMLFootprintUtilities.buildproject(j2seprojectName); + + // reverse enginnering + new ActionNoBlock(null,"Reverse Engineer...").performPopup(j2seproject); //NOI18N + new NbDialogOperator("Reverse Engineer").ok(); //NOI18N + + new OutputOperator().getOutputTab("Reverse Engineering Log").waitText("Task Successful"); //NOI18N + j2seprojectmodel = new ProjectsTabOperator().getProjectRootNode(j2seprojectName+"-Model"); + j2seprojectmodel.expand(); + + Node modelNode = new Node(j2seprojectmodel, "Model"); + modelNode.expand(); + + String modelNodeNames[] = modelNode.getChildren(); + Node modelNodes[] = new Node[modelNodeNames.length]; + + for (int i = 0; i < modelNodeNames.length; i++) { + modelNodes[i] = new Node(modelNode, modelNodeNames[i]); + } + + new ActionNoBlock(null,"Create Diagram From Selected Elements...").performPopup(modelNodes); //NOI18N + WizardOperator createNewDiagram = new WizardOperator("Create New Diagram"); //NOI18N + new JListOperator(createNewDiagram, "Activity Diagram").selectItem("Class Diagram"); //NOI18N + JTextFieldOperator textfield = new JTextFieldOperator(createNewDiagram); + textfield.clearText(); + textfield.typeText("ClassDiagram"); + createNewDiagram.finish(); + + return null; + } + + @Override + public void close(){ +// UMLFootprintUtilities.deleteProject(j2seprojectmodel.getText()); +// UMLFootprintUtilities.deleteProject(j2seproject.getText()); + } + +// public static void main(java.lang.String[] args) { +// junit.textui.TestRunner.run(new UMLWorkflow("measureMemoryFooprint")); +// } + +} diff -r e53c993c0d49 -r 7b6e218ca0af performance/test/qa-functional/src/org/netbeans/performance/uml/menus/MultipleNodeContextMenu.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/performance/test/qa-functional/src/org/netbeans/performance/uml/menus/MultipleNodeContextMenu.java Tue Jun 28 16:36:36 2011 -0400 @@ -0,0 +1,137 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved. + * + * Oracle and Java are registered trademarks of Oracle and/or its affiliates. + * Other names may be trademarks of their respective owners. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * Contributor(s): + * + * The Original Software is NetBeans. The Initial Developer of the Original + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun + * Microsystems, Inc. All Rights Reserved. + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + */ + + +package org.netbeans.performance.uml.menus; + +import org.netbeans.jellytools.ProjectsTabOperator; +import org.netbeans.jellytools.actions.CloseAllDocumentsAction; +import org.netbeans.jellytools.nodes.Node; +import org.netbeans.jemmy.EventTool; +import org.netbeans.jemmy.operators.ComponentOperator; +import org.netbeans.jemmy.operators.JTreeOperator; + +import javax.swing.tree.TreePath; +import org.netbeans.modules.performance.utilities.CommonUtilities; +import org.netbeans.modules.performance.utilities.PerformanceTestCase; +import org.netbeans.modules.project.ui.test.ProjectSupport; +import org.netbeans.performance.uml.UMLUtilities; + +/** + * Measure UI-RESPONSIVENES and WINDOW_OPENING. + * + * @author rashid@netbeans.org + * + */ +public class MultipleNodeContextMenu extends PerformanceTestCase { + + private static String testProjectName = "jEdit-Model"; + private static String testDiagramName = "ClassDiagram"; + private Node diag; + + /** Creates a new instance of MultipleNodeContextMenu*/ + public MultipleNodeContextMenu(String testName) { + super(testName); + //TODO: Adjust expectedTime value + expectedTime = 2000; + WAIT_AFTER_OPEN = 4000; + } + + public MultipleNodeContextMenu(String testName, String performanceDataName) { + super(testName, performanceDataName); + //TODO: Adjust expectedTime value + expectedTime = 2000; + WAIT_AFTER_OPEN = 4000; + } + + @Override + public void initialize() { + log(":: initialize"); + + UMLUtilities.waitProjectOpenedScanFinished(CommonUtilities.getProjectsDir() + testProjectName); + new CloseAllDocumentsAction().performAPI(); + } + + public void prepare() { + log(":: prepare"); + Node pNode = new ProjectsTabOperator().getProjectRootNode(testProjectName); + diag = new Node(pNode, "Model" + "|" + testDiagramName); + diag.select(); + new EventTool().waitNoEvent(1000); + } + + public ComponentOperator open() { + log("::open"); + + JTreeOperator projectTree = new ProjectsTabOperator().tree(); + new EventTool().waitNoEvent(1000); + + TreePath[] arrTreePath; + arrTreePath = new TreePath[110]; + for (int i = 0; i < arrTreePath.length; i++) { + arrTreePath[i] = projectTree.getPathForRow(3 + i); + } + log("::after array"); + projectTree.callPopupOnPaths(arrTreePath); + + return null; + } + + @Override + protected void shutdown() { + log("::shutdown"); + ProjectSupport.closeProject(testProjectName); + new CloseAllDocumentsAction().performAPI(); + } + + @Override + public void close() { + log("::close"); + new CloseAllDocumentsAction().performAPI(); + } + +// public static void main(java.lang.String[] args) { +// junit.textui.TestRunner.run(new MultipleNodeContextMenu("measureTime")); +// } +} diff -r e53c993c0d49 -r 7b6e218ca0af performance/test/qa-functional/src/org/netbeans/performance/uml/setup/UMLSetup.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/performance/test/qa-functional/src/org/netbeans/performance/uml/setup/UMLSetup.java Tue Jun 28 16:36:36 2011 -0400 @@ -0,0 +1,91 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved. + * + * Oracle and Java are registered trademarks of Oracle and/or its affiliates. + * Other names may be trademarks of their respective owners. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * Contributor(s): + * + * The Original Software is NetBeans. The Initial Developer of the Original + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun + * Microsystems, Inc. All Rights Reserved. + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + */ + + +package org.netbeans.performance.uml.setup; + + +import org.netbeans.jellytools.JellyTestCase; +import org.netbeans.modules.performance.utilities.CommonUtilities; +import org.netbeans.modules.project.ui.test.ProjectSupport; + +/** + * Test suite that actually does not perform any test but sets up user directory + * for UI responsiveness tests + * + * @author mmirilovic@netbeans.org, mrkam@netbeans.org + */ +public class UMLSetup extends JellyTestCase { + + public UMLSetup(java.lang.String testName) { + super(testName); + } + + public void openProject(String projectPath) { + String projectsDir = CommonUtilities.getProjectsDir() + projectPath; + Object prj = ProjectSupport.openProject(projectsDir); + assertNotNull(prj); + CommonUtilities.waitProjectTasksFinished(); + } + + public void openJEditModelProject() { + openProject("jEdit-Model"); + } + + public void openJEditProject() { + openProject("jEdit41"); + } + + public void testCloseTaskWindow() { + CommonUtilities.closeTaskWindow(); + } + + public void closeMemoryToolbar() { + CommonUtilities.closeMemoryToolbar(); + } + + public void closeAllDocuments() { + CommonUtilities.closeAllDocuments(); + } +} diff -r e53c993c0d49 -r 7b6e218ca0af performance/test/unit/src/org/netbeans/performance/uml/prepare/PrepareIDEForUMLComplexMeasurementsTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/performance/test/unit/src/org/netbeans/performance/uml/prepare/PrepareIDEForUMLComplexMeasurementsTest.java Tue Jun 28 16:36:36 2011 -0400 @@ -0,0 +1,233 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved. + * + * Oracle and Java are registered trademarks of Oracle and/or its affiliates. + * Other names may be trademarks of their respective owners. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * Contributor(s): + * + * The Original Software is NetBeans. The Initial Developer of the Original + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun + * Microsystems, Inc. All Rights Reserved. + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + */ + + +package org.netbeans.performance.uml.prepare; + +import java.util.ArrayList; + +import org.netbeans.jellytools.Bundle; +import org.netbeans.jellytools.JellyTestCase; +import org.netbeans.jellytools.ProjectsTabOperator; +import org.netbeans.jellytools.TopComponentOperator; + +import org.netbeans.jellytools.actions.Action; +import org.netbeans.jellytools.actions.OpenAction; +import org.netbeans.jellytools.actions.CloseAllDocumentsAction; +import org.netbeans.jellytools.nodes.Node; +import org.netbeans.jellytools.nodes.ProjectRootNode; + +import org.netbeans.jemmy.operators.JCheckBoxOperator; +import org.netbeans.jemmy.operators.Operator; + +import junit.framework.Test; + +import org.netbeans.junit.NbModuleSuite; +import org.netbeans.junit.NbTestSuite; + +import org.netbeans.modules.performance.utilities.CommonUtilities; +import org.netbeans.modules.performance.utilities.MeasureStartupTimeTestCase; +import org.netbeans.modules.project.ui.test.ProjectSupport; + + +/** + * Prepare user directory for complex measurements (startup time and memory consumption) of IDE with opened project and 10 files. + * Open 10 java files and shut down ide. + * Created user directory will be used to measure startup time and memory consumption of IDE with opened files. + * + * @author mrkam@netbeans.org + */ +public class PrepareIDEForUMLComplexMeasurementsTest extends JellyTestCase { + + /** Error output from the test. */ + protected static java.io.PrintStream err; + + /** Logging output from the test. */ + protected static java.io.PrintStream log; + + /** If true - at least one test failed */ + protected static boolean test_failed = false; + + /** Define testcase + * @param testName name of the testcase + */ + public PrepareIDEForUMLComplexMeasurementsTest(String testName) { + super(testName); + } + + /** Testsuite + * @return testuite + */ + public static Test suite() { + NbTestSuite suite = new NbTestSuite("Prepare IDE for startup suite for UML Pack"); + suite.addTest(NbModuleSuite.create( + NbModuleSuite.createConfiguration(PrepareIDEForUMLComplexMeasurementsTest.class) + .addTest("closeAllDocuments") + .addTest("closeMemoryToolbar") + .addTest("openProjects") + .addTest("openFiles") + .addTest("saveStatus") + .enableModules(".*") + .clusters(".*") + )); + return suite; + } + + + @Override + public void setUp() { +// err = System.out; + err = getLog(); + log = getRef(); + } + + /** + * Close All Documents. + */ + public void closeAllDocuments(){ + + if ( new Action("Window|Close All Documents",null).isEnabled() ) + try { + new CloseAllDocumentsAction().perform(); + }catch(Exception exc){ + test_failed = true; + fail(exc); + } + + } + + /** + * Close Memory Toolbar. + */ + public static void closeMemoryToolbar(){ + CommonUtilities.closeMemoryToolbar(); + } + + /** + * Open Travel Reservation projects + */ + public void openProjects() { + try { + Object prj = ProjectSupport.openProject(CommonUtilities.getProjectsDir() + "jEdit-Model"); + assertNotNull(prj); + CommonUtilities.waitProjectTasksFinished(); + }catch(Exception exc){ + test_failed = true; + fail(exc); + } + } + + /** + * Open 10 selected files from Travel Reservation projects + */ + public void openFiles(){ + try { + String[][] nodes_path = { + {"jEdit-Model", "Diagrams", "ClassDiagram"}, + {"jEdit-Model", "Diagrams", "ActivityDiagram"}, + {"jEdit-Model", "Diagrams", "SequenceDiagram"}, + {"jEdit-Model", "Diagrams", "StateDiagram"} + }; + + ArrayList openFileNodes = new ArrayList(); + Node node, fileNode; + + // create exactly (full match) and case sensitively comparing comparator + Operator.DefaultStringComparator comparator = new Operator.DefaultStringComparator(true, true); + + for(int i=0; i hard to reproduced by hand + try { + new OpenAction().performAPI(openFileNodes.toArray(new Node[0])); + }catch(Exception exc){ + err.println("---------------------------------------"); + err.println("issue 56825 : EXCEPTION catched during OpenAction"); + exc.printStackTrace(err); + err.println("---------------------------------------"); + err.println("issue 56825 : Try it again"); + new OpenAction().performAPI(openFileNodes.toArray(new Node[0])); + err.println("issue 56825 : Success"); + } + + + // check whether files are opened in editor + for(int i=0; i org.netbeans.performance.repeat.with.new.userdir + *
and number of starts with old userdir is defined by property + *
org.netbeans.performance.repeat + * Run measurement defined number times, but forget first measured value, + * it's a attempt to have still the same testing conditions with + * loaded and cached files. + * + * @author mrkam@netbeans.org + */ +public class ComplexUMLDiagramStartupTest extends MeasureStartupTimeTestCase { + + /** Define testcase + * @param testName name of the testcase + */ + public ComplexUMLDiagramStartupTest(String testName) { + super(testName); + } + + /** Testing start of IDE with measurement of the startup time. + * @throws IOException + */ + public void testStartIDE() throws java.io.IOException { + measureComplexStartupTime("Startup Time with opened UML diagram"); + } + + +}