01: /*
02: * $Id$
03: *
04: * ---------------------------------------------------------------------------
05: *
06: * The contents of this file are subject to the terms of the Common Development
07: * and Distribution License (the License). You may not use this file except in
08: * compliance with the License.
09: *
10: * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
11: * or http://www.netbeans.org/cddl.txt.
12: *
13: * When distributing Covered Code, include this CDDL Header Notice in each file
14: * and include the License file at http://www.netbeans.org/cddl.txt.
15: * If applicable, add the following below the CDDL Header, with the fields
16: * enclosed by brackets [] replaced by your own identifying information:
17: * "Portions Copyrighted [year] [name of copyright owner]".
18: *
19: * The Original Software is the Jemmy library. The Initial Developer of the
20: * Original Software is Alexandre Iline. All Rights Reserved.
21: *
22: * ---------------------------------------------------------------------------
23: *
24: * Contributor(s): Manfred Riem (mriem@netbeans.org).
25: */
26: package org.netbeans.jemmy;
27:
28: import junit.framework.TestCase;
29: import junit.framework.TestSuite;
30:
31: /**
32: * A JUnit test for Waiter.
33: *
34: * @author Manfred Riem (mriem@netbeans.org)
35: * @version $Revision$
36: */
37: public class WaiterTest extends TestCase {
38: /**
39: * Constructor.
40: *
41: * @param testName the name of the test.
42: */
43: public WaiterTest(String testName) {
44: super (testName);
45: }
46:
47: /**
48: * Setup before testing.
49: *
50: * @throws Exception when a serious error occurs.
51: */
52: protected void setUp() throws Exception {
53: }
54:
55: /**
56: * Cleanup after testing.
57: *
58: * @throws Exception when a serious error occurs.
59: */
60: protected void tearDown() throws Exception {
61: }
62:
63: /**
64: * Suite method.
65: *
66: * @return a test suite.
67: */
68: public static junit.framework.Test suite() {
69: TestSuite suite = new TestSuite(WaiterTest.class);
70: return suite;
71: }
72:
73: /**
74: * Test issue #30537.
75: */
76: public void testIssue30537() {
77: try {
78: Waiter waiter = new Waiter(new Waitable() {
79: public Object actionProduced(Object object) {
80: return object;
81: }
82:
83: public String getDescription() {
84: return "Description";
85: }
86: });
87:
88: waiter.waitAction(new Object());
89: } catch (InterruptedException exception) {
90: fail();
91: }
92: }
93: }
|