Source Code Cross Referenced for AssertionResult.java in  » Testing » jakarta-jmeter » org » apache » jmeter » assertions » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Testing » jakarta jmeter » org.apache.jmeter.assertions 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Licensed to the Apache Software Foundation (ASF) under one or more
003:         * contributor license agreements.  See the NOTICE file distributed with
004:         * this work for additional information regarding copyright ownership.
005:         * The ASF licenses this file to You under the Apache License, Version 2.0
006:         * (the "License"); you may not use this file except in compliance with
007:         * the License.  You may obtain a copy of the License at
008:         *
009:         *   http://www.apache.org/licenses/LICENSE-2.0
010:         *
011:         * Unless required by applicable law or agreed to in writing, software
012:         * distributed under the License is distributed on an "AS IS" BASIS,
013:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         * See the License for the specific language governing permissions and
015:         * limitations under the License.
016:         * 
017:         */
018:
019:        package org.apache.jmeter.assertions;
020:
021:        import java.io.Serializable;
022:
023:        /**
024:         * @author Michael Stover
025:         */
026:        public class AssertionResult implements  Serializable {
027:            public static final String RESPONSE_WAS_NULL = "Response was null"; // $NON-NLS-1$
028:
029:            /** Name of the assertion. */
030:            private String name;
031:
032:            /** True if the assertion failed. */
033:            private boolean failure;
034:
035:            /** True if there was an error checking the assertion. */
036:            private boolean error;
037:
038:            /** A message describing the failure. */
039:            private String failureMessage;
040:
041:            /**
042:             * Create a new Assertion Result. The result will indicate no failure or
043:             * error.
044:             * @deprecated - use the named constructor
045:             */
046:            public AssertionResult() { // Needs to be public for tests
047:            }
048:
049:            /**
050:             * Create a new Assertion Result. The result will indicate no failure or
051:             * error.
052:             * 
053:             * @param name the name of the assertion
054:             */
055:            public AssertionResult(String name) {
056:                setName(name);
057:            }
058:
059:            /**
060:             * Get the name of the assertion
061:             * 
062:             * @return the name of the assertion
063:             */
064:            public String getName() {
065:                return name;
066:            }
067:
068:            /**
069:             * Set the name of the assertion
070:             * 
071:             * @param name the name of the assertion
072:             */
073:            public void setName(String name) {
074:                this .name = name;
075:            }
076:
077:            /**
078:             * Check if the assertion failed. If it failed, the failure message may give
079:             * more details about the failure.
080:             * 
081:             * @return true if the assertion failed, false if the sample met the
082:             *         assertion criteria
083:             */
084:            public boolean isFailure() {
085:                return failure;
086:            }
087:
088:            /**
089:             * Check if an error occurred while checking the assertion. If an error
090:             * occurred, the failure message may give more details about the error.
091:             * 
092:             * @return true if an error occurred while checking the assertion, false
093:             *         otherwise.
094:             */
095:            public boolean isError() {
096:                return error;
097:            }
098:
099:            /**
100:             * Get the message associated with any failure or error. This method may
101:             * return null if no message was set.
102:             * 
103:             * @return a failure or error message, or null if no message has been set
104:             */
105:            public String getFailureMessage() {
106:                return failureMessage;
107:            }
108:
109:            /**
110:             * Set the flag indicating whether or not an error occurred.
111:             * 
112:             * @param e
113:             *            true if an error occurred, false otherwise
114:             */
115:            public void setError(boolean e) {
116:                error = e;
117:            }
118:
119:            /**
120:             * Set the flag indicating whether or not a failure occurred.
121:             * 
122:             * @param f
123:             *            true if a failure occurred, false otherwise
124:             */
125:            public void setFailure(boolean f) {
126:                failure = f;
127:            }
128:
129:            /**
130:             * Set the failure message giving more details about a failure or error.
131:             * 
132:             * @param message
133:             *            the message to set
134:             */
135:            public void setFailureMessage(String message) {
136:                failureMessage = message;
137:            }
138:
139:            /**
140:             * Convenience method for setting up failed results
141:             * 
142:             * @param message
143:             *            the message to set
144:             * @return this
145:             * 
146:             */
147:            public AssertionResult setResultForFailure(String message) {
148:                error = false;
149:                failure = true;
150:                failureMessage = message;
151:                return this ;
152:            }
153:
154:            /**
155:             * Convenience method for setting up results where the response was null
156:             * 
157:             * @return assertion result with appropriate fields set up
158:             */
159:            public AssertionResult setResultForNull() {
160:                error = false;
161:                failure = true;
162:                failureMessage = RESPONSE_WAS_NULL;
163:                return this ;
164:            }
165:
166:            public String toString() {
167:                return getName() != null ? getName() : super.toString();
168:            }
169:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.