diff options
author | Michael Valenta | 2005-04-13 14:04:55 +0000 |
---|---|---|
committer | Michael Valenta | 2005-04-13 14:04:55 +0000 |
commit | 75c84af3f04df1c9a4bc4b4e2eb028be537656f4 (patch) | |
tree | 68866e9e896fb5f5e5711475df3bbeb8f315df4d /tests | |
parent | 0080130a1c80da4b1f5d0b1df11a6b303282ab1a (diff) | |
download | eclipse.platform.team-75c84af3f04df1c9a4bc4b4e2eb028be537656f4.tar.gz eclipse.platform.team-75c84af3f04df1c9a4bc4b4e2eb028be537656f4.tar.xz eclipse.platform.team-75c84af3f04df1c9a4bc4b4e2eb028be537656f4.zip |
Added test to get timing with no UI
Diffstat (limited to 'tests')
3 files changed, 43 insertions, 35 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 b280a5cfe..b1139a95a 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 @@ -173,9 +173,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(); } @@ -185,9 +185,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 @@ -200,9 +200,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 @@ -217,11 +217,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 d1edbfe1f..e7ba293bb 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 @@ -12,8 +12,11 @@ package org.eclipse.team.tests.ccvs.ui.benchmark; 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; @@ -38,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); @@ -59,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++) { @@ -78,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 e1637f203..5c2ad022c 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(); |