Author: scabanovich
Date: 2008-03-12 10:55:53 -0400 (Wed, 12 Mar 2008)
New Revision: 6893
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreBuilder.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
Log:
JBIDE-1785 Test added
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreBuilder.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreBuilder.java 2008-03-12
14:45:34 UTC (rev 6892)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreBuilder.java 2008-03-12
14:55:53 UTC (rev 6893)
@@ -82,6 +82,8 @@
return null;
}
+ long begin = System.currentTimeMillis();
+
sp.postponeFiring();
try {
@@ -104,6 +106,8 @@
incrementalBuild(delta, monitor);
}
}
+ long end = System.currentTimeMillis();
+ sp.fullBuildTime += end - begin;
try {
sp.store();
} catch (IOException e) {
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2008-03-12
14:45:34 UTC (rev 6892)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2008-03-12
14:55:53 UTC (rev 6893)
@@ -402,6 +402,9 @@
}
}
+
+ public long fullBuildTime;
+ public List<Long> statistics;
/**
* Method testing how long it takes to load Seam model
@@ -414,6 +417,7 @@
* @return
*/
public long reload() {
+ statistics = new ArrayList<Long>();
classPath = new ClassPath(this);
sourcePaths.clear();
sourcePaths2.clear();
@@ -589,6 +593,7 @@
context.put(SeamXMLConstants.ATTR_PATH, path);
+ long t1 = System.currentTimeMillis();
LoadedDeclarations ds = new LoadedDeclarations();
Element components = XMLUtilities.getUniqueChild(paths[i], "components");
if(components != null) {
@@ -637,6 +642,10 @@
}
getClassPath().pathLoaded(path);
registerComponents(ds, path);
+ long t2 = System.currentTimeMillis();
+ if(statistics != null) {
+ statistics.add(new Long(t2 - t1));
+ }
}
}
@@ -683,6 +692,11 @@
File file = new File(path.toFile(), "projects/" + project.getName());
//$NON-NLS-1$
return file;
}
+
+ public void clearStorage() {
+ File f = getStorageFile();
+ if(f != null && f.isFile()) f.delete();
+ }
/**
*