01: package org.uispec4j;
02:
03: import junit.framework.AssertionFailedError;
04: import org.uispec4j.utils.AssertionFailureNotDetectedError;
05:
06: import javax.swing.*;
07: import java.awt.*;
08:
09: public class WindowForFrameTest extends WindowTestCase {
10:
11: public void testIsModal() throws Exception {
12: Window window = new Window(new Frame());
13: assertFalse(window.isModal());
14: try {
15: assertTrue(window.isModal());
16: throw new AssertionFailureNotDetectedError();
17: } catch (AssertionFailedError e) {
18: }
19: }
20:
21: public void testWindowManagesMenuBars() throws Exception {
22: Window window = new Window(new Frame());
23: try {
24: window.getMenuBar();
25: throw new AssertionFailureNotDetectedError();
26: } catch (AssertionFailedError e) {
27: assertEquals("This component has no menu bar", e
28: .getMessage());
29: }
30: }
31:
32: protected Window createWindowWithMenu(JMenuBar jMenuBar) {
33: return null;
34: }
35:
36: protected Window createWindowWithTitle(String title) {
37: return new Window(new Frame(title));
38: }
39:
40: protected void close(Window window) {
41: Frame frame = (Frame) window.getAwtContainer();
42: frame.dispose();
43: }
44: }
|