Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 116487 | Differences between
and this patch

Collapse All | Expand All

(-)META-INF/MANIFEST.MF (-2 / +4 lines)
Lines 22-30 Link Here
22
 org.eclipse.mylyn.web.tasks,
22
 org.eclipse.mylyn.web.tasks,
23
 org.eclipse.mylyn.monitor.core,
23
 org.eclipse.mylyn.monitor.core,
24
 org.eclipse.mylyn,
24
 org.eclipse.mylyn,
25
 org.eclipse.mylyn.web.core
25
 org.eclipse.mylyn.web.core,
26
 org.eclipse.test.performance
26
Eclipse-AutoStart: true
27
Eclipse-AutoStart: true
27
Bundle-ClassPath: mylyn-tasklist-tests.jar
28
Bundle-ClassPath: mylyn-tasklist-tests.jar
28
Export-Package: org.eclipse.mylyn.tasks.tests,
29
Export-Package: org.eclipse.mylyn.tasks.tests,
29
 org.eclipse.mylyn.tasks.tests.connector
30
 org.eclipse.mylyn.tasks.tests.connector,
31
 org.eclipse.mylyn.tasks.tests.performance
30
Bundle-RequiredExecutionEnvironment: J2SE-1.5
32
Bundle-RequiredExecutionEnvironment: J2SE-1.5
(-)src/org/eclipse/mylyn/tasks/tests/connector/MockRepositoryTask.java (+2 lines)
Lines 12-17 Link Here
12
12
13
/**
13
/**
14
 * @author Mik Kersten
14
 * @author Mik Kersten
15
 * 
16
 * API-3.0: rename to MockTask
15
 */
17
 */
16
public class MockRepositoryTask extends AbstractTask {
18
public class MockRepositoryTask extends AbstractTask {
17
19
(-)src/org/eclipse/mylyn/tasks/tests/performance/TaskContainerTest.java (+46 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2004, 2007 Mylyn project committers and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *******************************************************************************/
8
9
package org.eclipse.mylyn.tasks.tests.performance;
10
11
import org.eclipse.mylyn.tasks.core.AbstractTask;
12
import org.eclipse.mylyn.tasks.tests.connector.MockRepositoryTask;
13
import org.eclipse.test.performance.PerformanceTestCase;
14
15
/**
16
 * @author Steffen Pingel
17
 */
18
public class TaskContainerTest extends PerformanceTestCase {
19
20
	int counter;
21
22
	private void addChildren(AbstractTask parent, int[] childCount, int depth) {
23
		for (int i = 0; i < childCount[depth]; i++) {
24
			MockRepositoryTask task = new MockRepositoryTask("task", ++counter + "");
25
			parent.internalAddChild(task);
26
			if (depth < childCount.length - 1) {
27
				addChildren(task, childCount, depth + 1);
28
			}
29
		}
30
	}
31
32
	public void testContains() {
33
		MockRepositoryTask task = new MockRepositoryTask(++counter + "");
34
		addChildren(task, new int[] { 1000, 10, 2 }, 0);
35
36
		for (int i = 0; i < 10; i++) {
37
			startMeasuring();
38
			task.contains("handle");
39
			stopMeasuring();
40
		}
41
		
42
		commitMeasurements();
43
		assertPerformance();
44
	}
45
46
}
(-)src/org/eclipse/mylyn/tasks/tests/AllTasksPerformanceTests.java (+24 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2004, 2007 Mylyn project committers and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *******************************************************************************/
8
9
package org.eclipse.mylyn.tasks.tests;
10
11
import org.eclipse.mylyn.tasks.tests.performance.TaskContainerTest;
12
13
import junit.framework.Test;
14
import junit.framework.TestSuite;
15
16
public class AllTasksPerformanceTests {
17
18
	public static Test suite() {
19
		TestSuite suite = new TestSuite("Test for org.eclipse.mylyn.tests.performance");
20
		suite.addTestSuite(TaskContainerTest.class);
21
		return suite;
22
	}
23
24
}

Return to bug 116487