Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2004-11-03 17:04:40 +0000
committerJean Michel-Lemieux2004-11-03 17:04:40 +0000
commitb97b2f0f4ef3ff2adcc85b41ad5fb8a7da72c439 (patch)
treea1983f4422bb7cb8a87dfadd4b56028a3943de0e
parent9998ad186c7810bc1351a5ace5f7e71adea009ad (diff)
downloadeclipse.platform.team-b97b2f0f4ef3ff2adcc85b41ad5fb8a7da72c439.tar.gz
eclipse.platform.team-b97b2f0f4ef3ff2adcc85b41ad5fb8a7da72c439.tar.xz
eclipse.platform.team-b97b2f0f4ef3ff2adcc85b41ad5fb8a7da72c439.zip
Removed tests that didn't run long enough and fixed the tagAsSummary tests.v20041103
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/benchmark/BenchmarkTest.java43
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/benchmark/BenchmarkTestSetup.java2
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/benchmark/SyncTests.java30
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/benchmark/WorkflowTests.java12
4 files changed, 39 insertions, 48 deletions
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/benchmark/BenchmarkTest.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/benchmark/BenchmarkTest.java
index f7204e5a1..87521c97a 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/benchmark/BenchmarkTest.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/benchmark/BenchmarkTest.java
@@ -84,28 +84,39 @@ public abstract class BenchmarkTest extends EclipseTest {
protected void setupGroups(String[] performance_groups, String globalName, boolean global) {
groups = new HashMap();
- Performance perf = Performance.getDefault();
- for (int i = 0; i < performance_groups.length; i++) {
- String suffix = performance_groups[i];
- PerformanceMeter meter = perf.createPerformanceMeter(perf.getDefaultScenarioId(this) + suffix);
- groups.put(suffix, meter);
- if(globalName != null) {
- if(global)
- perf.tagAsGlobalSummary(meter, globalName, Dimension.CPU_TIME);
- else
- perf.tagAsSummary(meter, globalName, Dimension.CPU_TIME);
- }
- }
+ Performance perf = Performance.getDefault();
+ PerformanceMeter meter = null;
+ if (global) {
+ // Use one meter for all groups - provides a single timing result
+ meter = perf.createPerformanceMeter(perf.getDefaultScenarioId(this));
+ for (int i = 0; i < performance_groups.length; i++) {
+ String suffix = performance_groups[i];
+ groups.put(suffix, meter);
+ }
+ perf.tagAsGlobalSummary(meter, globalName, Dimension.CPU_TIME);
+ } else {
+ // Use a meter for each group, provides fine grain results
+ for (int i = 0; i < performance_groups.length; i++) {
+ String suffix = performance_groups[i];
+ meter = perf.createPerformanceMeter(perf.getDefaultScenarioId(this) + suffix);
+ groups.put(suffix, meter);
+ if (globalName != null) {
+ perf.tagAsSummary(meter, suffix, Dimension.CPU_TIME);
+ }
+ }
+ }
}
/**
- * Commit the performance meters that were created by setupGroups and started and
- * stoped using startGroup/endGroup
- */
- protected void commitGroups() {
+ * Commit the performance meters that were created by setupGroups and
+ * started and stoped using startGroup/endGroup
+ */
+ protected void commitGroups(boolean global) {
for (Iterator iter = groups.values().iterator(); iter.hasNext();) {
PerformanceMeter meter = (PerformanceMeter) iter.next();
meter.commit();
+ if(global)
+ break;
}
}
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/benchmark/BenchmarkTestSetup.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/benchmark/BenchmarkTestSetup.java
index e3b05f7c8..700ccc35a 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/benchmark/BenchmarkTestSetup.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/benchmark/BenchmarkTestSetup.java
@@ -30,7 +30,7 @@ public class BenchmarkTestSetup extends CVSTestSetup {
// Static initializer for constants
static {
try {
- LOOP_COUNT = Integer.valueOf(System.getProperty("eclipse.cvs.loopCount", "1")).intValue();
+ LOOP_COUNT = Integer.valueOf(System.getProperty("eclipse.cvs.loopCount", "3")).intValue();
} catch (NumberFormatException e1) {
LOOP_COUNT = 1;
}
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/benchmark/SyncTests.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/benchmark/SyncTests.java
index bfa886e09..c6eea2899 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/benchmark/SyncTests.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/benchmark/SyncTests.java
@@ -20,7 +20,6 @@ public class SyncTests extends BenchmarkTest {
private static final int FILE_SIZE_VARIANCE = 0;
private static final int PROB_BINARY = 0;
- private static final String NO_CHANGES_GROUP_SUFFIX = "NoChanges";
private static final String ADDED_GROUP_SUFFIX = "AddedFiles";
private static final String REMOVED_GROUP_SUFFIX = "RemovedFiles";
private static final String MODIFIED_GROUP_SUFFIX = "ModifiedFiles";
@@ -38,27 +37,16 @@ public class SyncTests extends BenchmarkTest {
return suite(SyncTests.class);
}
- public void testSync0() throws Exception {
- setupGroups(new String[] {NO_CHANGES_GROUP_SUFFIX} );
- IProject project = setupOutProject();
- for (int i = 0; i < BenchmarkTestSetup.LOOP_COUNT; i++) {
- startGroup(NO_CHANGES_GROUP_SUFFIX);
- syncCommitResources(new IResource[] { project }, "");
- endGroup();
- }
- commitGroups();
- }
-
- public void testSync1() throws Exception {
- runTestSync(1, "CVS Synchronize 1");
- }
-
public void testSync10() throws Exception {
- runTestSync(10, "CVS Synchronize 10");
+ runTestSync(10, "CVS Synchronize 10", false);
}
public void testSync100() throws Exception {
- runTestSync(100, "CVS Synchronize 100");
+ runTestSync(100, "CVS Synchronize 100", false);
+ }
+
+ public void testSync100Global() throws Exception {
+ runTestSync(100, "CVS Synchronize", true);
}
protected IProject setupOutProject() throws Exception {
@@ -71,8 +59,8 @@ public class SyncTests extends BenchmarkTest {
* Runs a sequence of operations for the synchronizer tests.
* A parallel project is used to generate incoming changes.
*/
- protected void runTestSync(int size, String globalName) throws Exception {
- setupGroups(PERFORMANCE_GROUPS, globalName, false);
+ protected void runTestSync(int size, String globalName, boolean global) throws Exception {
+ setupGroups(PERFORMANCE_GROUPS, globalName, global);
for (int i = 0; i < BenchmarkTestSetup.LOOP_COUNT; i++) {
final SequenceGenerator gen = new SequenceGenerator();
@@ -105,6 +93,6 @@ public class SyncTests extends BenchmarkTest {
syncUpdateResources(new IResource[] { inProject });
endGroup();
}
- commitGroups();
+ commitGroups(global);
}
}
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/benchmark/WorkflowTests.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/benchmark/WorkflowTests.java
index 35f4f5523..25d4f3681 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/benchmark/WorkflowTests.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/benchmark/WorkflowTests.java
@@ -54,16 +54,8 @@ public class WorkflowTests extends BenchmarkTest {
runWorkflowTests("testBig", BenchmarkTestSetup.BIG_ZIP_FILE, "CVS Big Workflow", BenchmarkTestSetup.LOOP_COUNT, false);
}
- public void testSmallWorkflow() throws Exception {
- runWorkflowTests("testSmall", BenchmarkTestSetup.SMALL_ZIP_FILE, "CVS Small Workflow", BenchmarkTestSetup.LOOP_COUNT, false);
- }
-
- public void testTinyWorkflow() throws Exception {
- runWorkflowTests("testTiny", BenchmarkTestSetup.TINY_ZIP_FILE, "CVS Tiny Workflow", BenchmarkTestSetup.LOOP_COUNT, false);
- }
-
public void testBigWorkflowForSummary() throws Exception {
- runWorkflowTests("testBigGlobal", BenchmarkTestSetup.BIG_ZIP_FILE, "CVS Big Workflow", 1, true);
+ runWorkflowTests("testBigGlobal", BenchmarkTestSetup.BIG_ZIP_FILE, "CVS Workflow", BenchmarkTestSetup.LOOP_COUNT, true);
}
/**
@@ -172,6 +164,6 @@ public class WorkflowTests extends BenchmarkTest {
replace(new IResource[] { inProject }, null, true);
endGroup();
}
- commitGroups();
+ commitGroups(global);
}
}

Back to the top