01: /*******************************************************************************
02: * Copyright (c) 2005, 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: * Brad Reynolds - bug 116920
11: *******************************************************************************/package org.eclipse.jface.tests.databinding.scenarios;
12:
13: import junit.extensions.TestSetup;
14: import junit.framework.Test;
15: import junit.framework.TestSuite;
16:
17: import org.eclipse.swt.SWT;
18: import org.eclipse.swt.layout.FillLayout;
19: import org.eclipse.swt.widgets.Display;
20: import org.eclipse.swt.widgets.Shell;
21:
22: /**
23: * To run this test suite, right-click and select "Run As JUnit Plug-in Test".
24: * This will also start an Eclipse instance. To clean up the launch
25: * configuration, open up its "Main" tab and select "[No Application] - Headless
26: * Mode" as the application to run. You can also run this class as an SWT
27: * application.
28: */
29: public class BindingScenariosTestSuite extends TestSuite {
30:
31: public static void main(String[] args) {
32: junit.textui.TestRunner.run(suite());
33: }
34:
35: private static Display display;
36:
37: private static Shell shell;
38:
39: public static Test suite() {
40: return new TestSetup(new BindingScenariosTestSuite()) {
41: protected void setUp() throws Exception {
42: Display d = Display.getDefault();
43: shell = new Shell(d, SWT.SHELL_TRIM);
44: shell.setLayout(new FillLayout());
45: }
46:
47: protected void tearDown() throws Exception {
48: shell.close();
49: shell.dispose();
50: if (display != null) {
51: display.dispose();
52: }
53: }
54: };
55: }
56:
57: public BindingScenariosTestSuite() {
58: addTestSuite(ButtonControlScenario.class);
59: addTestSuite(ComboScenarios.class);
60: addTestSuite(ComboUpdatingTest.class);
61: addTestSuite(ComboViewerScenario.class);
62: addTestSuite(CustomConverterScenarios.class);
63: addTestSuite(CustomScenarios.class);
64: addTestSuite(ListViewerScenario.class);
65: addTestSuite(MasterDetailScenarios.class);
66: addTestSuite(NewTableScenarios.class);
67: addTestSuite(NPETestScenario.class);
68: addTestSuite(PropertyScenarios.class);
69: addTestSuite(SpinnerControlScenario.class);
70: addTestSuite(TableScenarios.class);
71: addTestSuite(TextControlScenario.class);
72: }
73:
74: public static Shell getShell() {
75: return shell;
76: }
77:
78: }
|