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.rcp;
11:
12: import junit.framework.TestCase;
13:
14: import org.eclipse.swt.widgets.Display;
15: import org.eclipse.ui.IWorkbenchWindow;
16: import org.eclipse.ui.PlatformUI;
17: import org.eclipse.ui.application.IActionBarConfigurer;
18: import org.eclipse.ui.application.WorkbenchAdvisor;
19: import org.eclipse.ui.tests.rcp.util.WorkbenchAdvisorObserver;
20:
21: public class ActionBarConfigurerTest extends TestCase {
22:
23: public ActionBarConfigurerTest(String name) {
24: super (name);
25: }
26:
27: private Display display = null;
28:
29: protected void setUp() throws Exception {
30: super .setUp();
31:
32: assertNull(display);
33: display = PlatformUI.createDisplay();
34: assertNotNull(display);
35: }
36:
37: protected void tearDown() throws Exception {
38: assertNotNull(display);
39: display.dispose();
40: assertTrue(display.isDisposed());
41: super .tearDown();
42: }
43:
44: public void testDefaults() {
45: WorkbenchAdvisor wa = new WorkbenchAdvisorObserver(1) {
46:
47: public void fillActionBars(IWorkbenchWindow window,
48: IActionBarConfigurer actionBarConfig, int flags) {
49: super .fillActionBars(window, actionBarConfig, flags);
50:
51: assertNotNull(actionBarConfig.getMenuManager());
52: assertNotNull(actionBarConfig.getStatusLineManager());
53: assertNotNull(actionBarConfig.getCoolBarManager());
54: }
55: };
56:
57: int code = PlatformUI.createAndRunWorkbench(display, wa);
58: assertEquals(PlatformUI.RETURN_OK, code);
59: }
60: }
|