01: /*
02: * Copyright 2006 Google Inc.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
05: * use this file except in compliance with the License. You may obtain a copy of
06: * the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13: * License for the specific language governing permissions and limitations under
14: * the License.
15: */
16: package com.google.gwt.junit.client;
17:
18: /**
19: * This exception is thrown when a {@link GWTTestCase}-derived class runs a
20: * test in asynchronous mode and fails to complete within a specified timeout
21: * period.
22: *
23: * @see GWTTestCase#delayTestFinish(int)
24: */
25: public final class TimeoutException extends RuntimeException {
26:
27: public TimeoutException() {
28: }
29:
30: /**
31: * Constructs a timeout exception for a given number of milliseconds.
32: *
33: * @param timeoutMillis the number of milliseconds that elapsed which caused
34: * this exception to be thrown
35: */
36: public TimeoutException(int timeoutMillis) {
37: super ("A timeout expired after " + timeoutMillis
38: + "ms elapsed.");
39: }
40:
41: /**
42: * Constructs a timeout exception with the specified detail message.
43: *
44: * @param message the detail message
45: */
46: public TimeoutException(String message) {
47: super (message);
48: }
49:
50: /**
51: * Constructs a timeout exception with the specified detail message and cause.
52: *
53: * @param message the detail message
54: * @param cause the exception that caused this exception
55: */
56: public TimeoutException(String message, Throwable cause) {
57: super (message, cause);
58: }
59:
60: /**
61: * Constructs a timeout exception with the specified cause.
62: *
63: * @param cause the exception that caused this exception
64: */
65: public TimeoutException(Throwable cause) {
66: super(cause);
67: }
68:
69: }
|