01: /*******************************************************************************
02: * Copyright (c) 2004, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.tests.performance;
11:
12: import junit.framework.Test;
13: import junit.framework.TestSuite;
14:
15: /**
16: * @since 3.1
17: */
18: public class EditorPerformanceSuite extends TestSuite {
19:
20: public static final String[] EDITOR_FILE_EXTENSIONS = {
21: "perf_basic", "perf_outline", "java" };
22: public static final String[][] EDITOR_SWITCH_PAIRS = {
23: { "perf_outline", "java" },
24: { "perf_basic", "perf_outline" } };
25:
26: /**
27: * Returns the suite. This is required to use the JUnit Launcher.
28: */
29: public static Test suite() {
30: return new EditorPerformanceSuite();
31: }
32:
33: public EditorPerformanceSuite() {
34: addOpenCloseScenarios();
35: addSwitchScenarios();
36: addOpenMultipleScenarios(true);
37: addOpenMultipleScenarios(false);
38: }
39:
40: // Commented out: these tests don't seem to be working
41: // /**
42: // *
43: // * @since 3.1
44: // */
45: // private void addResizeScenarios() {
46: // for (int i = 0; i < EDITOR_FILE_EXTENSIONS.length; i++) {
47: // addTest(new ResizeTest(new EditorWidgetFactory("1." + EDITOR_FILE_EXTENSIONS[i])));
48: // }
49: // }
50:
51: /**
52: *
53: */
54: private void addSwitchScenarios() {
55: for (int i = 0; i < EDITOR_SWITCH_PAIRS.length; i++) {
56: addTest(new EditorSwitchTest(EDITOR_SWITCH_PAIRS[i]));
57: }
58: }
59:
60: /**
61: *
62: */
63: private void addOpenMultipleScenarios(boolean closeAll) {
64: for (int i = 0; i < EDITOR_FILE_EXTENSIONS.length; i++) {
65: addTest(new OpenMultipleEditorTest(
66: EDITOR_FILE_EXTENSIONS[i], closeAll,
67: BasicPerformanceTest.NONE));
68: }
69: }
70:
71: /**
72: *
73: */
74: private void addOpenCloseScenarios() {
75: for (int i = 0; i < EDITOR_FILE_EXTENSIONS.length; i++) {
76: addTest(new OpenCloseEditorTest(EDITOR_FILE_EXTENSIONS[i],
77: i == 3 ? BasicPerformanceTest.LOCAL
78: : BasicPerformanceTest.NONE));
79: }
80: }
81: }
|