KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > excalibur > mpool > test > CascadingAssertionFailedError


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
14  * implied.
15  *
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */

19 package org.apache.excalibur.mpool.test;
20
21 import junit.framework.AssertionFailedError;
22
23 import org.apache.avalon.framework.CascadingThrowable;
24
25 /**
26  * This is an extention to the testing framework so that we can get detailed
27  * messages from JUnit (The AssertionFailedError hides the underlying cause)
28  *
29  * @deprecated ECM is no longer supported
30  *
31  * @author <a HREF="mailto:dev@avalon.apache.org">Avalon Development Team</a>
32  * @version $Id: CascadingAssertionFailedError.java,v 1.1 2004/04/02 05:53:14 mcconnell Exp $
33  */

34 public class CascadingAssertionFailedError
35     extends AssertionFailedError
36     implements CascadingThrowable
37 {
38     private final Throwable JavaDoc m_throwable;
39
40     /**
41      * Constructor with no message
42      */

43     public CascadingAssertionFailedError()
44     {
45         this( null, null );
46     }
47
48     /**
49      * Constructor with a message
50      */

51     public CascadingAssertionFailedError( String JavaDoc message )
52     {
53         this( message, null );
54     }
55
56     /**
57      * Constructor with a message and a parent exception
58      */

59     public CascadingAssertionFailedError( String JavaDoc message,
60                                           Throwable JavaDoc parentThrowable )
61     {
62         super( message );
63         m_throwable = parentThrowable;
64     }
65
66     /**
67      * Return the parent exception
68      */

69     public final Throwable JavaDoc getCause()
70     {
71         return m_throwable;
72     }
73 }
74
Popular Tags