KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > jmeter > assertions > AssertionResult


1 // $Header: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/assertions/AssertionResult.java,v 1.4 2004/02/13 02:21:37 sebb Exp $
2
/*
3  * Copyright 2001-2004 The Apache Software Foundation.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * 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 implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17 */

18
19 package org.apache.jmeter.assertions;
20
21 import java.io.Serializable JavaDoc;
22
23 /**
24  * @author Michael Stover
25  * @version $Revision: 1.4 $
26  */

27 public class AssertionResult implements Serializable JavaDoc
28 {
29     /** True if the assertion failed. */
30     private boolean failure;
31     
32     /** True if there was an error checking the assertion. */
33     private boolean error;
34     
35     /** A message describing the failure. */
36     private String JavaDoc failureMessage;
37
38     /**
39      * Create a new Assertion Result. The result will indicate no failure or
40      * error.
41      */

42     public AssertionResult()
43     {
44     }
45
46     /**
47      * Check if the assertion failed. If it failed, the failure message may
48      * give more details about the failure.
49      *
50      * @return true if the assertion failed, false if the sample met the
51      * assertion criteria
52      */

53     public boolean isFailure()
54     {
55         return failure;
56     }
57
58     /**
59      * Check if an error occurred while checking the assertion. If an error
60      * occurred, the failure message may give more details about the error.
61      *
62      * @return true if an error occurred while checking the assertion, false
63      * otherwise.
64      */

65     public boolean isError()
66     {
67         return error;
68     }
69
70     /**
71      * Get the message associated with any failure or error. This method may
72      * return null if no message was set.
73      *
74      * @return a failure or error message, or null if no message has been set
75      */

76     public String JavaDoc getFailureMessage()
77     {
78         return failureMessage;
79     }
80
81     /**
82      * Set the flag indicating whether or not an error occurred.
83      *
84      * @param e true if an error occurred, false otherwise
85      */

86     public void setError(boolean e)
87     {
88         error = e;
89     }
90
91     /**
92      * Set the flag indicating whether or not a failure occurred.
93      *
94      * @param f true if a failure occurred, false otherwise
95      */

96     public void setFailure(boolean f)
97     {
98         failure = f;
99     }
100
101     /**
102      * Set the failure message giving more details about a failure or error.
103      *
104      * @param message the message to set
105      */

106     public void setFailureMessage(String JavaDoc message)
107     {
108         failureMessage = message;
109     }
110 }
111
Popular Tags