01: package org.uispec4j;
02:
03: import junit.framework.AssertionFailedError;
04: import org.uispec4j.utils.AssertionFailureNotDetectedError;
05:
06: import javax.swing.*;
07:
08: public class WindowForJFrameTest extends WindowTestCase {
09:
10: public void testIsModal() throws Exception {
11: Window window = new Window(new JFrame());
12: assertFalse(window.isModal());
13: try {
14: assertTrue(window.isModal());
15: throw new AssertionFailureNotDetectedError();
16: } catch (AssertionFailedError e) {
17: }
18: }
19:
20: protected Window createWindowWithMenu(JMenuBar jMenuBar) {
21: JFrame frame = new JFrame();
22: frame.setJMenuBar(jMenuBar);
23: return new Window(frame);
24: }
25:
26: protected Window createWindowWithTitle(String title) {
27: return new Window(new JFrame(title));
28: }
29:
30: protected void close(Window window) {
31: JFrame frame = (JFrame) window.getAwtContainer();
32: frame.dispose();
33: }
34: }
|