KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > google > gwt > junit > client > TimeoutException


1 /*
2  * Copyright 2006 Google Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5  * use this file except in compliance with the License. You may obtain a copy of
6  * the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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 JavaDoc {
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 + "ms elapsed.");
38   }
39
40   /**
41    * Constructs a timeout exception with the specified detail message.
42    *
43    * @param message the detail message
44    */

45   public TimeoutException(String JavaDoc message) {
46     super(message);
47   }
48
49   /**
50    * Constructs a timeout exception with the specified detail message and cause.
51    *
52    * @param message the detail message
53    * @param cause the exception that caused this exception
54    */

55   public TimeoutException(String JavaDoc message, Throwable JavaDoc cause) {
56     super(message, cause);
57   }
58
59   /**
60    * Constructs a timeout exception with the specified cause.
61    *
62    * @param cause the exception that caused this exception
63    */

64   public TimeoutException(Throwable JavaDoc cause) {
65     super(cause);
66   }
67
68 }
69
Popular Tags