diff options
author | Michael Valenta | 2005-04-13 14:28:00 +0000 |
---|---|---|
committer | Michael Valenta | 2005-04-13 14:28:00 +0000 |
commit | 510906470065b41092e94a87b2ee9b2e750c5807 (patch) | |
tree | f2a23fc3ae978f7eb18e2039ae144496a9dd749f | |
parent | 3366934611b1fd11905c4c0553b862bedc2aaf5a (diff) | |
download | eclipse.platform.team-510906470065b41092e94a87b2ee9b2e750c5807.tar.gz eclipse.platform.team-510906470065b41092e94a87b2ee9b2e750c5807.tar.xz eclipse.platform.team-510906470065b41092e94a87b2ee9b2e750c5807.zip |
Backported changes made in HEAD
3 files changed, 44 insertions, 37 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 95b029f1c..08ea2c631 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 @@ -96,7 +96,7 @@ public abstract class BenchmarkTest extends EclipseTest { String suffix = performance_groups[i]; groups.put(suffix, meter); } - perf.tagAsGlobalSummary(meter, globalName, Dimension.CPU_TIME); + perf.tagAsGlobalSummary(meter, globalName, Dimension.ELAPSED_PROCESS); } else { // Use a meter for each group, provides fine grain results for (int i = 0; i < performance_groups.length; i++) { @@ -104,7 +104,7 @@ public abstract class BenchmarkTest extends EclipseTest { meter = perf.createPerformanceMeter(perf.getDefaultScenarioId(this) + suffix); groups.put(suffix, meter); if (globalName != null) { - perf.tagAsSummary(meter, suffix, Dimension.CPU_TIME); + perf.tagAsSummary(meter, suffix, Dimension.ELAPSED_PROCESS); } } } @@ -174,9 +174,9 @@ public abstract class BenchmarkTest extends EclipseTest { // TODO: } - protected void syncResources(Subscriber subscriber, IResource[] resources) throws TeamException { + protected void syncResources(SyncInfoSource source, Subscriber subscriber, IResource[] resources) throws TeamException { startTask("Synchronize with Repository action"); - getSyncInfoSource().refresh(subscriber, resources); + source.refresh(subscriber, resources); endTask(); } @@ -186,9 +186,9 @@ public abstract class BenchmarkTest extends EclipseTest { * @throws CoreException * @throws TeamException */ - protected void syncCommitResources(IResource[] resources, String comment) throws TeamException, CoreException { + protected void syncCommitResources(SyncInfoSource source, IResource[] resources, String comment) throws TeamException, CoreException { startTask("Synchronize outgoing changes"); - syncResources(getSyncInfoSource().createWorkspaceSubscriber(), resources); + syncResources(source, source.createWorkspaceSubscriber(), resources); endTask(); // TODO: Commit all outgoing changes that are children of the given resource // by extracting them from the subscriber sync set @@ -201,9 +201,9 @@ public abstract class BenchmarkTest extends EclipseTest { * @param resources * @throws TeamException */ - protected void syncUpdateResources(IResource[] resources) throws TeamException { + protected void syncUpdateResources(SyncInfoSource source, IResource[] resources) throws TeamException { startTask("Synchronize incoming changes"); - syncResources(getSyncInfoSource().createWorkspaceSubscriber(), resources); + syncResources(source, source.createWorkspaceSubscriber(), resources); endTask(); // TODO: Update all incoming changes that are children of the given resource // by extracting them from the subscriber sync set @@ -218,11 +218,4 @@ public abstract class BenchmarkTest extends EclipseTest { // Now open our empty perspective PlatformUI.getWorkbench().showPerspective("org.eclipse.team.tests.cvs.ui.perspective1", PlatformUI.getWorkbench().getActiveWorkbenchWindow()); } - - /** - * @return - */ - private SyncInfoSource getSyncInfoSource() { - return source; - } } 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 5dc2c4322..668ea2625 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 @@ -15,6 +15,8 @@ import junit.framework.Test; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResource; +import org.eclipse.team.tests.ccvs.core.subscriber.SyncInfoSource; +import org.eclipse.team.tests.ccvs.ui.SynchronizeViewTestAdapter; public class SyncTests extends BenchmarkTest { private static final int FILE_SIZE_MEAN = 16384; @@ -39,16 +41,20 @@ public class SyncTests extends BenchmarkTest { } public void testSync10() throws Exception { - runTestSync(10, "CVS Synchronize 10", false); + runTestSync(10, "CVS Synchronize 10", false, new SynchronizeViewTestAdapter()); } public void testSync100() throws Exception { - runTestSync(100, "CVS Synchronize 100", false); + runTestSync(100, "CVS Synchronize 100", false, new SynchronizeViewTestAdapter()); } public void testSync100Global() throws Exception { - runTestSync(100, "CVS Synchronize", true); + runTestSync(100, "CVS Synchronize", true, new SynchronizeViewTestAdapter()); } + + public void testSync100NoUI() throws Exception { + runTestSync(100, "CVS Synchronize No UI", true, new SyncInfoSource()); + } protected IProject setupOutProject() throws Exception { IProject project = createUniqueProject(BenchmarkTestSetup.SMALL_ZIP_FILE); @@ -60,7 +66,7 @@ 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, boolean global) throws Exception { + protected void runTestSync(int size, String globalName, boolean global, SyncInfoSource source) throws Exception { openEmptyPerspective(); setupGroups(PERFORMANCE_GROUPS, globalName, global); for (int i = 0; i < BenchmarkTestSetup.LOOP_COUNT; i++) { @@ -79,20 +85,20 @@ public class SyncTests extends BenchmarkTest { /*** outgoing and incoming changes ***/ startGroup(ADDED_GROUP_SUFFIX); BenchmarkUtils.createRandomDeepFiles(gen, outProject, size, FILE_SIZE_MEAN, FILE_SIZE_VARIANCE, PROB_BINARY); - syncCommitResources(new IResource[] { outProject }, ""); - syncUpdateResources(new IResource[] { inProject }); + syncCommitResources(source, new IResource[] { outProject }, ""); + syncUpdateResources(source, new IResource[] { inProject }); endGroup(); startGroup(MODIFIED_GROUP_SUFFIX); BenchmarkUtils.modifyRandomDeepFiles(gen, outProject, size); - syncCommitResources(new IResource[] { outProject }, ""); - syncUpdateResources(new IResource[] { inProject }); + syncCommitResources(source, new IResource[] { outProject }, ""); + syncUpdateResources(source, new IResource[] { inProject }); endGroup(); startGroup(REMOVED_GROUP_SUFFIX); BenchmarkUtils.deleteRandomDeepFiles(gen, outProject, size); - syncCommitResources(new IResource[] { outProject }, ""); - syncUpdateResources(new IResource[] { inProject }); + syncCommitResources(source, new IResource[] { outProject }, ""); + syncUpdateResources(source, new IResource[] { inProject }); endGroup(); } 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 71dacaa33..7c053f913 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 @@ -11,9 +11,13 @@ package org.eclipse.team.tests.ccvs.ui.benchmark; import java.io.File; + import junit.framework.Test; + import org.eclipse.core.resources.*; import org.eclipse.team.internal.ccvs.core.CVSTag; +import org.eclipse.team.tests.ccvs.core.subscriber.SyncInfoSource; +import org.eclipse.team.tests.ccvs.ui.SynchronizeViewTestAdapter; public class WorkflowTests extends BenchmarkTest { private int FILE_SIZE_MEAN = 16384; @@ -51,17 +55,21 @@ public class WorkflowTests extends BenchmarkTest { } public void testBigWorkflow() throws Exception { - runWorkflowTests("testBig", BenchmarkTestSetup.BIG_ZIP_FILE, "CVS Big Workflow", BenchmarkTestSetup.LOOP_COUNT, false); + runWorkflowTests("testBig", BenchmarkTestSetup.BIG_ZIP_FILE, "CVS Big Workflow", BenchmarkTestSetup.LOOP_COUNT, false, new SynchronizeViewTestAdapter()); } public void testBigWorkflowForSummary() throws Exception { - runWorkflowTests("testBigGlobal", BenchmarkTestSetup.BIG_ZIP_FILE, "CVS Workflow", BenchmarkTestSetup.LOOP_COUNT, true); + runWorkflowTests("testBigGlobal", BenchmarkTestSetup.BIG_ZIP_FILE, "CVS Workflow", BenchmarkTestSetup.LOOP_COUNT, true, new SynchronizeViewTestAdapter()); } + + public void testBigWorkflowNoUI() throws Exception { + runWorkflowTests("testBigWithNoUI", BenchmarkTestSetup.BIG_ZIP_FILE, "CVS Workflow No UI", BenchmarkTestSetup.LOOP_COUNT, true, new SyncInfoSource()); + } /** * Runs a series of incoming and outgoing workflow-related tests. */ - protected void runWorkflowTests(String name, File initialContents, String globalName, int loopCount, boolean global) throws Exception { + protected void runWorkflowTests(String name, File initialContents, String globalName, int loopCount, boolean global, SyncInfoSource source) throws Exception { openEmptyPerspective(); setupGroups(PERFORMANCE_GROUPS, globalName, global); for (int i = 0; i < loopCount; i++) { @@ -92,22 +100,22 @@ public class WorkflowTests extends BenchmarkTest { BenchmarkUtils.touchRandomDeepFiles(gen, outProject, 2); IFolder componentRoot = BenchmarkUtils.createRandomDeepFolder(gen, outProject); BenchmarkUtils.createRandomDeepFiles(gen, componentRoot, 12, FILE_SIZE_MEAN, FILE_SIZE_VARIANCE, PROB_BINARY); - syncCommitResources(new IResource[] { outProject }, ""); + syncCommitResources(source, new IResource[] { outProject }, ""); endGroup(); // Test 1: catching up to a new component - localized additions and some changes startGroup(UPDATE1); - syncUpdateResources(new IResource[] { inProject }); + syncUpdateResources(source, new IResource[] { inProject }); endGroup(); // Test 2: fixing a bug - localized changes startGroup(COMMIT2); BenchmarkUtils.modifyRandomDeepFiles(gen, componentRoot, 2); BenchmarkUtils.touchRandomDeepFiles(gen, componentRoot, 2); - syncCommitResources(new IResource[] { outProject }, ""); + syncCommitResources(source, new IResource[] { outProject }, ""); endGroup(); // Test 2: catching up to a bug fix - localized changes startGroup(UPDATE2); - syncUpdateResources(new IResource[] { inProject }); + syncUpdateResources(source, new IResource[] { inProject }); endGroup(); // Test 3: moving a package - scattered changes, files moved @@ -115,11 +123,11 @@ public class WorkflowTests extends BenchmarkTest { BenchmarkUtils.modifyRandomDeepFiles(gen, outProject, 5); // a few scattered changes BenchmarkUtils.modifyRandomDeepFiles(gen, componentRoot, 12); // changes to "package" stmt BenchmarkUtils.renameResource(componentRoot, BenchmarkUtils.makeUniqueName(gen, "folder", null)); - syncCommitResources(new IResource[] { outProject }, ""); + syncCommitResources(source, new IResource[] { outProject }, ""); endGroup(); // Test 3: catching up to a moved package - scattered changes, files moved startGroup(UPDATE3); - syncUpdateResources(new IResource[] { inProject }); + syncUpdateResources(source, new IResource[] { inProject }); endGroup(); // Test 4: big refactoring - scattered changes, files renamed and balanced additions/deletions @@ -128,11 +136,11 @@ public class WorkflowTests extends BenchmarkTest { BenchmarkUtils.modifyRandomDeepFiles(gen, outProject, 20); // many scattered changes BenchmarkUtils.renameRandomDeepFiles(gen, outProject, 5); // renamed some stuff BenchmarkUtils.createRandomDeepFiles(gen, outProject, 4, FILE_SIZE_MEAN, FILE_SIZE_VARIANCE, PROB_BINARY); // some new stuff added - syncCommitResources(new IResource[] { outProject }, ""); + syncCommitResources(source, new IResource[] { outProject }, ""); endGroup(); // Test 4: catching up to a big refactoring - scattered changes, files renamed and balanced additions/deletions startGroup(UPDATE4); - syncUpdateResources(new IResource[] { inProject }); + syncUpdateResources(source, new IResource[] { inProject }); endGroup(); // Test 5: test tagging a project @@ -160,7 +168,7 @@ public class WorkflowTests extends BenchmarkTest { BenchmarkUtils.modifyRandomDeepFiles(gen, outProject, 42); // many changes BenchmarkUtils.renameRandomDeepFiles(gen, outProject, 8); // evidence of some refactoring BenchmarkUtils.createRandomDeepFiles(gen, outProject, 10, FILE_SIZE_MEAN, FILE_SIZE_VARIANCE, PROB_BINARY); // a few new components added - syncCommitResources(new IResource[] { outProject }, ""); + syncCommitResources(source, new IResource[] { outProject }, ""); startGroup(REPLACE3); replace(new IResource[] { inProject }, null, true); endGroup(); |