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: * Runs a test specified by the org.eclipse.ui.performance.test property.
17: * This test is prepped via the UIPerformanceTestSetup test setup.
18: *
19: * @since 3.1
20: */
21: public class PerformanceTestRunner extends TestSuite {
22:
23: /**
24: * Returns the suite. This is required to use the JUnit Launcher.
25: */
26: public static Test suite() {
27: return new UIPerformanceTestSetup(new PerformanceTestRunner());
28: }
29:
30: public PerformanceTestRunner() {
31: String className = System
32: .getProperty("org.eclipse.ui.performance.test");
33: try {
34: Class clazz = Class.forName(className);
35: if (TestSuite.class.isAssignableFrom(clazz))
36: addTest((Test) clazz.newInstance());
37: else
38: addTestSuite(clazz);
39: } catch (Exception e) {
40: throw new RuntimeException(e);
41: }
42: }
43: }
|