KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sourceforge > groboutils > mbtf > v1 > IErrors


1 /*
2  * @(#)IErrors.java
3  *
4  * Copyright (C) 2002-2003 Matt Albrecht
5  * groboclown@users.sourceforge.net
6  * http://groboutils.sourceforge.net
7  *
8  * Part of the GroboUtils package at:
9  * http://groboutils.sourceforge.net
10  *
11  * Permission is hereby granted, free of charge, to any person obtaining a
12  * copy of this software and associated documentation files (the "Software"),
13  * to deal in the Software without restriction, including without limitation
14  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
15  * and/or sell copies of the Software, and to permit persons to whom the
16  * Software is furnished to do so, subject to the following conditions:
17  *
18  * The above copyright notice and this permission notice shall be included in
19  * all copies or substantial portions of the Software.
20  *
21  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
24  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
27  * DEALINGS IN THE SOFTWARE.
28  */

29 package net.sourceforge.groboutils.mbtf.v1;
30
31
32 /**
33  * A container for registering errors or warnings caused by invalid
34  * validation of a state or transition.
35  *
36  * @author Matt Albrecht <a HREF="mailto:groboclown@users.sourceforge.net">groboclown@users.sourceforge.net</a>
37  * @version $Date: 2003/02/10 22:52:24 $
38  * @since June 12, 2002
39  */

40 public interface IErrors
41 {
42     
43     /**
44      * Immediately stop the path processing, and do not continue other paths
45      * for processing. This will throw a <tt>RuntimeException</tt>.
46      * <P>
47      * Halts should be a last-recourse to indicate that the system cannot be
48      * used for further testing.
49      *
50      * @param msg a human-readable error message.
51      * @exception TestHaltRuntimeException will always be generated.
52      */

53     public void halt( String JavaDoc msg )
54             throws TestHaltRuntimeException;
55     
56     
57     /**
58      * Add a failure to the list of current errors. Validation methods that
59      * register failures will halt the current path's testing. This method
60      * will not throw an exception, so validation processing must leave the
61      * method on its own.
62      * <P>
63      * Failures should be registered when a non-recoverable error occurs in the
64      * system. The framework may still process other paths, though.
65      *
66      * @param msg a human-readable error message.
67      */

68     public void addFailure( String JavaDoc msg );
69     
70     
71     /**
72      * Add a failure associated with a Throwable to the list of current errors.
73      * Validation methods that register failures will halt the current path's
74      * testing. This method will not throw an exception, so validation
75      * processing must leave the method on its own.
76      * <P>
77      * Failures should be registered when a non-recoverable error occurs in the
78      * system. The framework may still process other paths, though.
79      *
80      * @param msg a human-readable error message.
81      * @param t the exception associated with the error.
82      */

83     public void addFailure( String JavaDoc msg, Throwable JavaDoc t );
84     
85     
86     /**
87      * Add a failure to the list of current errors. Validation methods that
88      * register failures will halt the current path's testing. This method
89      * will not throw a <tt>TestFailRuntimeException</tt>, so validation
90      * processing must leave the method on its own.
91      * <P>
92      * Failures should be registered when a non-recoverable error occurs in the
93      * system. The framework may still process other paths, though.
94      *
95      * @param msg a human-readable error message.
96      * @exception TestFailRuntimeException allows for easy exiting of a
97      * burried method call stack.
98      */

99     public void fail( String JavaDoc msg )
100             throws TestFailRuntimeException;
101     
102     
103     /**
104      * Add a failure associated with a Throwable to the list of current errors.
105      * Validation methods that register failures will halt the current path's
106      * testing. This method will throw a <tt>TestFailRuntimeException</tt> to
107      * allow for an easy exit from a burried method call stack.
108      * <P>
109      * Failures should be registered when a non-recoverable error occurs in the
110      * system. The framework may still process other paths, though.
111      *
112      * @param msg a human-readable error message.
113      * @param t the exception associated with the error.
114      * @exception TestFailRuntimeException allows for easy exiting of a
115      * burried method call stack.
116      */

117     public void fail( String JavaDoc msg, Throwable JavaDoc t )
118             throws TestFailRuntimeException;
119     
120     
121     /**
122      * Add an error to the list of current errors. Validation methods that
123      * register errors will not halt the current path's testing, but the error
124      * will be listed in the report with the associated path where the error
125      * condition occured.
126      * <P>
127      * Errors should be registered when an error occurs in the system, but
128      * the system can continue processing the path.
129      *
130      * @param msg a human-readable error message.
131      */

132     public void addError( String JavaDoc msg );
133     
134     
135     /**
136      * Add an error associated with a Throwable to the list of current errors.
137      * Validation methods that register errors will halt the current path's
138      * testing.
139      * <P>
140      * Errors should be registered when an error occurs in the system, but
141      * the system can continue processing the path.
142      *
143      * @param msg a human-readable error message.
144      * @param t the exception associated with the error.
145      */

146     public void addError( String JavaDoc msg, Throwable JavaDoc t );
147     
148     
149     /**
150      * Add a warning to the list of current warnings. Warnings will not
151      * halt the testing process, and will not register an error.
152      * <P>
153      * Warnings should be used when a questionable system state occurs, or if
154      * the tester wants to perform debugging.
155      *
156      * @param msg a human-readable message.
157      */

158     public void addWarning( String JavaDoc msg );
159     
160     
161     /**
162      * Retrieve all registered errors.
163      */

164     public IError[] getErrors();
165 }
166
167
Popular Tags