Source Code Cross Referenced for ActionState.java in  » Testing » DDTUnit » junitx » ddtunit » data » processing » 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 » DDTUnit » junitx.ddtunit.data.processing 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        //$Id: ActionState.java 220 2006-03-17 00:22:16Z jg_hamburg $
002:        /********************************************************************************
003:         * DDTUnit, a Datadriven Approach to Unit- and Moduletesting
004:         * Copyright (c) 2004, Joerg and Kai Gellien
005:         * All rights reserved.
006:         *
007:         * The Software is provided under the terms of the Common Public License 1.0
008:         * as provided with the distribution of DDTUnit in the file cpl-v10.html.
009:         * Redistribution and use in source and binary forms, with or without
010:         * modification, are permitted provided that the following conditions
011:         * are met:
012:         *
013:         *     + Redistributions of source code must retain the above copyright
014:         *       notice, this list of conditions and the following disclaimer.
015:         *
016:         *     + Redistributions in binary form must reproduce the above
017:         *       copyright notice, this list of conditions and the following
018:         *       disclaimer in the documentation and/or other materials provided
019:         *       with the distribution.
020:         *
021:         *     + Neither the name of the authors or DDTUnit, nor the
022:         *       names of its contributors may be used to endorse or promote
023:         *       products derived from this software without specific prior
024:         *       written permission.
025:         *
026:         * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
027:         * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
028:         * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
029:         * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
030:         * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
031:         * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
032:         * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
033:         * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
034:         * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
035:         * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
036:         * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
037:         ********************************************************************************/package junitx.ddtunit.data.processing;
038:
039:        /**
040:         * Class for defining special processing states useful for object instanciation
041:         */
042:        final class ActionState {
043:            /**
044:             * Object parsing type, identifying a standard object to parse
045:             */
046:            public final static ActionState OBJECT_CREATION = new ActionState(
047:                    4, "Object Creation Processing");
048:
049:            /**
050:             * Assert parsing type, identifying a standard assertion to parse
051:             */
052:            public final static ActionState ASSERT_CREATION = new ActionState(
053:                    5, "Assert Creation Processing");
054:
055:            /**
056:             * Exception parsing type, identifying a standard expected exception to
057:             * parse
058:             */
059:            public final static ActionState EXCEPTION_CREATION = new ActionState(
060:                    6, "Exception Creation Processing");
061:
062:            /**
063:             * XML Content parsing type, identifying xml content to parse
064:             */
065:            public final static ActionState CONTENT_CREATION = new ActionState(
066:                    7, "Content Extraction Processing");
067:
068:            /**
069:             * Subelement parsing type, identifying a substructure object to parse, e.g.
070:             * a field of a value object
071:             */
072:            public final static ActionState SUBELEMENT_CREATION = new ActionState(
073:                    8, "Subelement Creation Processing");
074:
075:            /**
076:             * Collection parsing type, identifying a collection object to parse, e.g. a
077:             * list of object values
078:             */
079:            public final static ActionState COLLECTION_CREATION = new ActionState(
080:                    10, "Collection Creation Processing");
081:
082:            /**
083:             * Map parsing type, identifying a map object to parse, e.g. a list of
084:             * object values
085:             */
086:            public final static ActionState MAP_CREATION = new ActionState(11,
087:                    "Map Creation Processing");
088:
089:            /**
090:             * Date parsing type, identifying a Date object to parse, e.g. a date time
091:             * object
092:             */
093:            public final static ActionState DATE_CREATION = new ActionState(12,
094:                    "Date Creation Processing");
095:
096:            public static final ActionState ATTRLIST_CREATION = new ActionState(
097:                    13, "Internal Attribute Creation Processing");
098:
099:            public static final ActionState ARRAY_CREATION = new ActionState(
100:                    14, "Array Creation Processing");
101:
102:            public static final ActionState BEAN_CREATION = new ActionState(15,
103:                    "Bean Creation Processing");
104:
105:            public static final ActionState CALL_CREATION = new ActionState(16,
106:                    "Call Creation Processing");
107:
108:            public static final ActionState CONSTANT_CREATION = new ActionState(
109:                    17, "Constant Creation Process");
110:
111:            private int id;
112:
113:            private String name;
114:
115:            private ActionState() {
116:                // no special initialization
117:            }
118:
119:            private ActionState(int id, String name) {
120:                if (id < 0 || name == null || name.compareTo("") == 0) {
121:                    throw new IllegalArgumentException(
122:                            "Wrong arguments: id >= 0, name not empty.");
123:                }
124:                this .id = id;
125:                this .name = name;
126:            }
127:
128:            /**
129:             * Overwrite toString() method.
130:             * 
131:             * @return name of parse type
132:             */
133:            public String toString() {
134:                return this .name;
135:            }
136:
137:            /**
138:             * Returns <code>true</code> if this <code>ActionState</code> is the
139:             * same as the o argument.
140:             * 
141:             * @return <code>true</code> if this <code>ActionState</code> is the
142:             *         same as the o argument.
143:             */
144:            public boolean equals(Object obj) {
145:                boolean check = false;
146:                if (obj != null && obj.getClass() == getClass()) {
147:                    ActionState castedObj = (ActionState) obj;
148:                    check = ((this .id == castedObj.id) && (this .name == null ? castedObj.name == null
149:                            : this .name.equals(castedObj.name)));
150:                }
151:                return check;
152:            }
153:
154:            /**
155:             * Override hashCode.
156:             * 
157:             * @return the Objects hashcode.
158:             */
159:            public int hashCode() {
160:                int hashCode = 1;
161:                hashCode = 31 * hashCode + id;
162:                hashCode = 31 * hashCode + (name == null ? 0 : name.hashCode());
163:                return hashCode;
164:            }
165:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.