KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > portal > test > cms > stress > Failure


1 /*****************************************
2  * *
3  * JBoss Portal: The OpenSource Portal *
4  * *
5  * Distributable under LGPL license. *
6  * See terms of license at gnu.org. *
7  * *
8  *****************************************/

9 package org.jboss.portal.test.cms.stress;
10
11 /**
12  * @author <a HREF="mailto:julien@jboss.org">Julien Viet</a>
13  * @version $Revision: 1.1 $
14  */

15 public class Failure
16 {
17
18    public static final int EXCEPTION = 0;
19    public static final int ASSERT = 1;
20
21    private final int type;
22    private final String JavaDoc message;
23
24    public Failure(int type, String JavaDoc message)
25    {
26       this.type = type;
27       this.message = message;
28    }
29
30    public int getType()
31    {
32       return type;
33    }
34
35    public String JavaDoc getMessage()
36    {
37       return message;
38    }
39
40    public String JavaDoc toString()
41    {
42       return (type == 0 ? "[exception," : "[assert,") + message + "]";
43    }
44
45 }
46
Popular Tags