Author: dgolovin
Date: 2010-04-07 13:01:08 -0400 (Wed, 07 Apr 2010)
New Revision: 21327
Added:
trunk/jsf/tests/org.jboss.tools.jsf.test/higest-10-basetimes-for-methods.html
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.test/
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/.project
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/model/pv/test/JSFPromptingProviderTest.java
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JSFBeansTest.java
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JSFModelTest.java
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JsfAllTests.java
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/ModelFormat_2_0_0_Test.java
Log:
performance fix for jsf tests to reduce execution time from 300 sec to 20 sec
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.test
___________________________________________________________________
Name: svn:ignore
- bin
+ bin
target
pom.xml
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/higest-10-basetimes-for-methods.html
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/higest-10-basetimes-for-methods.html
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.test/higest-10-basetimes-for-methods.html 2010-04-07
17:01:08 UTC (rev 21327)
@@ -0,0 +1,159 @@
+<html>
+<meta http-equiv="Content-Type" content="text/html;
charset=UTF-8">
+<head>
+<STYLE TYPE="text/css">
+p, table, td, th { font-family: arial, helvetica, geneva; font-size: 10pt}
+body { font-family: arial, helvetica, geneva; font-size: 10pt; clip: rect( );
margin-top: 5mm; margin-left: 3mm}
+</STYLE>
+</head>
+<body text="#000000" bgcolor="#ffffff">
+<caption align=top><B>
+Execution Statistics - org.eclipse.equinox.launcher.Main at dgolovin-desktop [ PID: 6394
]
+</B></caption>
+<table border=0 cellspacing=2 cellpadding=2 WIDTH="100%">
+<tr>
+<th align=left>Method</th>
+<th align=left></th>
+<th align=left>Class</th>
+<th align=left>Package</th>
+<th align=left><Base Time (seconds)</th>
+<th align=left>Delta : Base Time (seconds)</th>
+<th align=left>Average Base Time (seconds)</th>
+<th align=left>Cumulative Time (seconds)</th>
+<th align=left>Delta : Cumulative Time (seconds)</th>
+<th align=left>Calls</th>
+<th align=left>Delta : Calls</th>
+</tr>
+<tr BGCOLOR="#ffffbb">
+<td
align=left> setAttributeValue(java.lang.String,
java.lang.String) java.lang.String</td>
+<td align=left></td>
+<td align=left>XModelObjectImpl</td>
+<td align=left>org.jboss.tools.common.model.impl</td>
+<td align=left>22.074818</td>
+<td align=left>1.631869</td>
+<td align=left>0.000675</td>
+<td align=left>204.642570</td>
+<td align=left>5.570464</td>
+<td align=left>32705</td>
+<td align=left>275</td>
+</tr>
+<tr>
+<td align=left> set(java.lang.String,
java.lang.String) void</td>
+<td align=left></td>
+<td align=left>RegularObjectImpl</td>
+<td align=left>org.jboss.tools.common.model.impl</td>
+<td align=left>21.582908</td>
+<td align=left>0.000000</td>
+<td align=left>0.000985</td>
+<td align=left>201.923675</td>
+<td align=left>0.000000</td>
+<td align=left>21907</td>
+<td align=left>0</td>
+</tr>
+<tr BGCOLOR="#ffffbb">
+<td align=left> getLongPath()
java.lang.String</td>
+<td align=left></td>
+<td align=left>XModelObjectImpl</td>
+<td align=left>org.jboss.tools.common.model.impl</td>
+<td align=left>105.139329</td>
+<td align=left>1.141071</td>
+<td align=left>0.002264</td>
+<td align=left>125.354073</td>
+<td align=left>2.139659</td>
+<td align=left>46432</td>
+<td align=left>364</td>
+</tr>
+<tr>
+<td
align=left> getAttributeValue(java.lang.String)
java.lang.String</td>
+<td align=left></td>
+<td align=left>XModelObjectImpl</td>
+<td align=left>org.jboss.tools.common.model.impl</td>
+<td align=left>30.041825</td>
+<td align=left>0.038265</td>
+<td align=left>0.000358</td>
+<td align=left>84.506342</td>
+<td align=left>0.310830</td>
+<td align=left>83932</td>
+<td align=left>469</td>
+</tr>
+<tr BGCOLOR="#ffffbb">
+<td align=left> belongsTo(java.lang.Object)
boolean</td>
+<td align=left></td>
+<td align=left>XJob</td>
+<td align=left>org.jboss.tools.common.model</td>
+<td align=left>79.709347</td>
+<td align=left>0.000000</td>
+<td align=left>0.046532</td>
+<td align=left>79.709347</td>
+<td align=left>0.000000</td>
+<td align=left>1713</td>
+<td align=left>0</td>
+</tr>
+<tr>
+<td align=left> get(java.lang.String)
java.lang.String</td>
+<td align=left></td>
+<td align=left>AbstractExtendedXMLFileImpl</td>
+<td align=left>org.jboss.tools.common.model.filesystems.impl</td>
+<td align=left>26.688162</td>
+<td align=left>0.000000</td>
+<td align=left>0.000790</td>
+<td align=left>74.167544</td>
+<td align=left>0.000000</td>
+<td align=left>33801</td>
+<td align=left>0</td>
+</tr>
+<tr BGCOLOR="#ffffbb">
+<td
align=left> describe(java.io.InputStream,
org.eclipse.core.runtime.content.IContentDescription) int</td>
+<td align=left></td>
+<td align=left>XMLContentDescriber</td>
+<td align=left>org.jboss.tools.common.model.ui.editor</td>
+<td align=left>20.608653</td>
+<td align=left>0.000000</td>
+<td align=left>0.130435</td>
+<td align=left>73.861405</td>
+<td align=left>0.000000</td>
+<td align=left>158</td>
+<td align=left>0</td>
+</tr>
+<tr>
+<td align=left> get(java.lang.String)
java.lang.String</td>
+<td align=left></td>
+<td align=left>XModelObjectImpl</td>
+<td align=left>org.jboss.tools.common.model.impl</td>
+<td align=left>38.404906</td>
+<td align=left>0.000000</td>
+<td align=left>0.000293</td>
+<td align=left>51.634328</td>
+<td align=left>0.000000</td>
+<td align=left>130880</td>
+<td align=left>0</td>
+</tr>
+<tr BGCOLOR="#ffffbb">
+<td align=left> get(java.lang.String)
java.lang.String</td>
+<td align=left></td>
+<td align=left>FileAnyImpl</td>
+<td align=left>org.jboss.tools.common.model.filesystems.impl</td>
+<td align=left>20.120570</td>
+<td align=left>0.000000</td>
+<td align=left>0.000320</td>
+<td align=left>49.259172</td>
+<td align=left>0.000000</td>
+<td align=left>62937</td>
+<td align=left>0</td>
+</tr>
+<tr>
+<td align=left> getParent()
org.jboss.tools.common.model.XModelObject</td>
+<td align=left></td>
+<td align=left>XModelObjectImpl</td>
+<td align=left>org.jboss.tools.common.model.impl</td>
+<td align=left>24.546885</td>
+<td align=left>0.018037</td>
+<td align=left>0.000131</td>
+<td align=left>24.546885</td>
+<td align=left>0.018037</td>
+<td align=left>188038</td>
+<td align=left>878</td>
+</tr>
+</table>
+</body>
+</html>
Property changes on:
trunk/jsf/tests/org.jboss.tools.jsf.test/higest-10-basetimes-for-methods.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/.project
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/.project 2010-04-07
16:53:10 UTC (rev 21326)
+++
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/.project 2010-04-07
17:01:08 UTC (rev 21327)
@@ -15,11 +15,6 @@
<arguments>
</arguments>
</buildCommand>
- <buildCommand>
- <name>org.jboss.tools.common.verification.verifybuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/model/pv/test/JSFPromptingProviderTest.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/model/pv/test/JSFPromptingProviderTest.java 2010-04-07
16:53:10 UTC (rev 21326)
+++
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/model/pv/test/JSFPromptingProviderTest.java 2010-04-07
17:01:08 UTC (rev 21327)
@@ -6,8 +6,11 @@
import java.util.Map;
import java.util.Properties;
+import junit.framework.TestCase;
+
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.PlatformUI;
@@ -15,25 +18,21 @@
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.project.IModelNature;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.common.test.util.TestProjectProvider;
import org.jboss.tools.jsf.model.pv.JSFPromptingProvider;
-import org.jboss.tools.jsf.plugin.JsfTestPlugin;
-import org.jboss.tools.jst.web.model.helpers.WebAppHelper;
import org.jboss.tools.jst.web.project.WebProject;
import org.jboss.tools.jst.web.project.list.IWebPromptingProvider;
import org.jboss.tools.jst.web.project.list.WebPromptingProvider;
-import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.ResourcesUtils;
-import junit.framework.TestCase;
-
public class JSFPromptingProviderTest extends TestCase {
- private static final String TEST_PROJECT_NAME =
"JSFPromptingProviderTestProject";
+ public static final String TEST_PROJECT_NAME =
"JSFPromptingProviderTestProject";
- private static final String TEST_PROJECT_PATH = "/projects/" +
TEST_PROJECT_NAME;
+ public static final String TEST_PROJECT_PATH = "/projects/" +
TEST_PROJECT_NAME;
-
+ TestProjectProvider prjProvider = null;
IProject project = null;
IModelNature nature = null;
XModel model = null;
@@ -43,12 +42,12 @@
@Override
protected void setUp() throws IOException, CoreException, InvocationTargetException,
InterruptedException {
-// project =
(IProject)ResourcesPlugin.getWorkspace().getRoot().findMember(TEST_PROJECT_NAME);
-// if(project==null) {
- project = ResourcesUtils.importProject(
- JsfTestPlugin.getDefault().getBundle(), TEST_PROJECT_PATH);
- assertNotNull(project);
-// }
+ boolean saveAutoBuild = ResourcesUtils.setBuildAutomatically(false);
+ project =
(IProject)ResourcesPlugin.getWorkspace().getRoot().findMember(TEST_PROJECT_NAME);
+ if(project==null) {
+ prjProvider = new TestProjectProvider("org.jboss.tools.jsf.test",
TEST_PROJECT_PATH, TEST_PROJECT_NAME, true);
+ project = prjProvider.getProject();
+ }
project.build(IncrementalProjectBuilder.FULL_BUILD, null);
nature = EclipseResourceUtil.getModelNature(project);
@@ -167,11 +166,8 @@
@Override
protected void tearDown() throws Exception {
- if(project!=null) {
- boolean saveAutoBuild = ResourcesUtils.setBuildAutomatically(false);
- JobUtils.waitForIdle();
- ResourcesUtils.deleteProject(TEST_PROJECT_NAME);
- ResourcesUtils.setBuildAutomatically(saveAutoBuild);
+ if(prjProvider!=null) {
+ prjProvider.dispose();
}
}
}
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JSFBeansTest.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JSFBeansTest.java 2010-04-07
16:53:10 UTC (rev 21326)
+++
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JSFBeansTest.java 2010-04-07
17:01:08 UTC (rev 21327)
@@ -3,22 +3,17 @@
import java.util.List;
import java.util.Properties;
+import junit.framework.TestCase;
+
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.project.IModelNature;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.test.util.TestProjectProvider;
-import org.jboss.tools.jsf.model.pv.JSFProjectsRoot;
-import org.jboss.tools.jsf.model.pv.JSFProjectsTree;
-import org.jboss.tools.jst.web.model.pv.WebProjectNode;
import org.jboss.tools.jst.web.project.list.IWebPromptingProvider;
import org.jboss.tools.jst.web.project.list.WebPromptingProvider;
-import junit.framework.TestCase;
-
public class JSFBeansTest extends TestCase {
TestProjectProvider provider = null;
IProject project = null;
@@ -27,8 +22,11 @@
public JSFBeansTest() {}
public void setUp() throws CoreException {
- provider = new TestProjectProvider("org.jboss.tools.jsf.test", null,
"JSFKickStartOldFormat", false);
- project = provider.getProject();
+ project =
(IProject)ResourcesPlugin.getWorkspace().getRoot().findMember("JSFKickStartOldFormat");
+ if(project==null) {
+ provider = new TestProjectProvider("org.jboss.tools.jsf.test", null,
"JSFKickStartOldFormat", false);
+ project = provider.getProject();
+ }
}
public void testBeanWithSuper() {
@@ -51,7 +49,10 @@
}
protected void tearDown() throws CoreException{
- provider.dispose();
+ if(provider!=null) {
+ provider.dispose();
+ provider = null;
+ }
}
}
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JSFModelTest.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JSFModelTest.java 2010-04-07
16:53:10 UTC (rev 21326)
+++
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JSFModelTest.java 2010-04-07
17:01:08 UTC (rev 21327)
@@ -12,12 +12,13 @@
import java.util.ArrayList;
+import junit.framework.TestCase;
+
+import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.jboss.tools.common.test.util.TestDescription;
-import org.jboss.tools.common.test.util.TestProjectProvider;
-
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.internal.core.JavaModelManager;
import org.jboss.tools.common.model.XModel;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.filesystems.impl.AbstractXMLFileImpl;
@@ -25,11 +26,12 @@
import org.jboss.tools.common.model.loaders.EntityRecognizerContext;
import org.jboss.tools.common.model.project.IModelNature;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.common.test.util.TestDescription;
+import org.jboss.tools.common.test.util.TestDescriptionFactory;
+import org.jboss.tools.common.test.util.TestProjectProvider;
import org.jboss.tools.jsf.model.pv.JSFProjectsRoot;
import org.jboss.tools.jsf.model.pv.JSFProjectsTree;
-import junit.framework.TestCase;
-
public class JSFModelTest extends TestCase {
TestProjectProvider provider = null;
IProject project = null;
@@ -38,8 +40,12 @@
public JSFModelTest() {}
public void setUp() throws Exception {
- provider = new TestProjectProvider("org.jboss.tools.jsf.test", null,
"JSFKickStartOldFormat", false);
- project = provider.getProject();
+ project =
(IProject)ResourcesPlugin.getWorkspace().getRoot().findMember("JSFKickStartOldFormat");
+ if(project==null) {
+ provider = new TestProjectProvider("org.jboss.tools.jsf.test", null,
"JSFKickStartOldFormat", false);
+ project = provider.getProject();
+ }
+
}
public void testModelExists() {
@@ -51,7 +57,8 @@
public void testPaths() {
IModelNature n = EclipseResourceUtil.getModelNature(project);
String testName = "JSFModelTest:testPaths";
- ArrayList<TestDescription> tests = provider.getTestDescriptions(testName);
+ IFile f = project.getFile(new Path("/testCases.xml"));
+ ArrayList<TestDescription> tests = new
TestDescriptionFactory(f).getTestDescriptions(testName);
System.out.println(testName + " " + (tests == null ? -1 : tests.size()));
StringBuffer sb = new StringBuffer();
int errorCount = 0;
@@ -87,7 +94,8 @@
}
void doAttributeTest(XModel model, String testName) {
- ArrayList<TestDescription> tests = provider.getTestDescriptions(testName);
+ IFile f = project.getFile(new Path("/testCases.xml"));
+ ArrayList<TestDescription> tests = new
TestDescriptionFactory(f).getTestDescriptions(testName);
System.out.println(testName + " " + (tests == null ? -1 : tests.size()));
StringBuffer sb = new StringBuffer();
int errorCount = 0;
@@ -159,6 +167,7 @@
protected void tearDown() throws Exception {
if(provider != null) {
provider.dispose();
+ provider=null;
}
}
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JsfAllTests.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JsfAllTests.java 2010-04-07
16:53:10 UTC (rev 21326)
+++
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JsfAllTests.java 2010-04-07
17:01:08 UTC (rev 21327)
@@ -10,9 +10,11 @@
******************************************************************************/
package org.jboss.tools.jsf.test;
+import junit.extensions.TestSetup;
import junit.framework.Test;
import junit.framework.TestSuite;
+import org.eclipse.jdt.internal.core.JavaModelManager;
import org.jboss.tools.jsf.model.pv.test.JSFPromptingProviderTest;
import org.jboss.tools.jsf.test.refactoring.ELVariableRefactoringTest;
import org.jboss.tools.test.util.ProjectImportTestSetup;
@@ -22,19 +24,34 @@
public static Test suite() {
TestSuite suite = new TestSuite("Test model loading for JSF projects");
+ TestSuite old = new TestSuite("Tests are using JSFKickStartOldFormat");
+ old.addTestSuite(JSFModelTest.class);
+ old.addTestSuite(ModelFormat_2_0_0_Test.class);
+ old.addTestSuite(JSFBeansTest.class);
+ suite.addTest(new
ProjectImportTestSetup(old,"org.jboss.tools.jsf.test","projects/JSFKickStartOldFormat","JSFKickStartOldFormat"));
+ suite.addTest(new ProjectImportTestSetup(new
TestSuite(JSFPromptingProviderTest.class),"org.jboss.tools.jsf.test",
JSFPromptingProviderTest.TEST_PROJECT_PATH, JSFPromptingProviderTest.TEST_PROJECT_NAME));
- suite.addTestSuite(JSFModelTest.class);
- suite.addTestSuite(ModelFormat_2_0_0_Test.class);
- // FIXME
http://jira.jboss.org/jira/browse/JBIDE-2441
- suite.addTestSuite(JSFImportTest.class);
- suite.addTestSuite(JSFBeansTest.class);
- suite.addTestSuite(JSFPromptingProviderTest.class);
-
suite.addTest(new ProjectImportTestSetup(new
TestSuite(ELVariableRefactoringTest.class),
"org.jboss.tools.jsf.test",
new String[]{"projects/JSFKickStartOldFormat"},
new String[]{"JSFKickStartOldFormat"}));
- return suite;
+ return new DisableJavaIndexingSetup(suite);
}
+
+ public static class DisableJavaIndexingSetup extends TestSetup {
+ public DisableJavaIndexingSetup(Test test) {
+ super(test);
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ JavaModelManager.getIndexManager().disable();
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ JavaModelManager.getIndexManager().disable();
+ }
+ }
}
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/ModelFormat_2_0_0_Test.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/ModelFormat_2_0_0_Test.java 2010-04-07
16:53:10 UTC (rev 21326)
+++
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/ModelFormat_2_0_0_Test.java 2010-04-07
17:01:08 UTC (rev 21327)
@@ -13,21 +13,19 @@
import java.util.ArrayList;
import java.util.List;
+import junit.framework.TestCase;
+
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.jboss.tools.common.test.util.TestProjectProvider;
-
+import org.eclipse.core.resources.ResourcesPlugin;
import org.jboss.tools.common.model.XModel;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
import org.jboss.tools.common.model.project.IModelNature;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.common.test.util.TestProjectProvider;
import org.jboss.tools.jsf.model.pv.JSFProjectsRoot;
import org.jboss.tools.jsf.model.pv.JSFProjectsTree;
-import junit.framework.TestCase;
-
public class ModelFormat_2_0_0_Test extends TestCase {
TestProjectProvider provider = null;
IProject project = null;
@@ -36,8 +34,11 @@
public ModelFormat_2_0_0_Test() {}
public void setUp() throws Exception {
- provider = new TestProjectProvider("org.jboss.tools.jsf.test", null,
"JSFKickStartOldFormat", false);
- project = provider.getProject();
+ project =
(IProject)ResourcesPlugin.getWorkspace().getRoot().findMember("JSFKickStartOldFormat");
+ if(project == null) {
+ provider = new TestProjectProvider("org.jboss.tools.jsf.test", null,
"JSFKickStartOldFormat", false);
+ project = provider.getProject();
+ }
}
public void testModelExists() {
@@ -89,7 +90,10 @@
}
protected void tearDown() throws Exception {
- provider.dispose();
+ if(provider!=null) {
+ provider.dispose();
+ provider=null;
+ }
}
}