1 /*
2 *
3 * The DbUnit Database Testing Framework
4 * Copyright (C)2002-2004, DbUnit.org
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 *
20 */
21 package org.dbunit;
22
23
24 /**
25 * @author Manuel Laflamme
26 * @author Last changed by: $Author$
27 * @version $Revision$ $Date$
28 * @since 1.0
29 */
30 public class DatabaseUnitRuntimeException extends RuntimeException
31 {
32
33 /**
34 *
35 */
36 private static final long serialVersionUID = -3238403495229458202L;
37
38
39 /**
40 * Constructs an <code>DatabaseUnitRuntimeException</code> with no specified
41 * detail message and no encapsulated exception.
42 */
43 public DatabaseUnitRuntimeException()
44 {
45 super();
46 }
47
48 /**
49 * Constructs an <code>DatabaseUnitRuntimeException</code> with the specified
50 * detail message and no encapsulated exception.
51 * @param msg Exception message
52 */
53 public DatabaseUnitRuntimeException(String msg)
54 {
55 super(msg);
56 }
57
58 /**
59 * Constructs an <code>DatabaseUnitRuntimeException</code> with the specified
60 * detail message and encapsulated exception.
61 * @param msg
62 * @param cause The cause of this exception
63 */
64 public DatabaseUnitRuntimeException(String msg, Throwable cause)
65 {
66 super(msg, cause);
67 }
68
69 /**
70 * Constructs an <code>DatabaseUnitRuntimeException</code> with the encapsulated
71 * exception and use its message as detail message.
72 * @param cause The cause of this exception
73 */
74 public DatabaseUnitRuntimeException(Throwable cause)
75 {
76 super(cause.toString(), cause);
77 }
78
79 /**
80 * Returns the encapsulated exception or <code>null</code> if none.
81 * @deprecated Use {@link Exception#getCause()} instead
82 */
83 public Throwable getException()
84 {
85 return super.getCause();
86 }
87
88 }
89
90
91
92