Source Code Cross Referenced for MockResultSetInfo.java in  » Testing » mockrunner-0.4 » com » mockrunner » mock » connector » cci » 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 » mockrunner 0.4 » com.mockrunner.mock.connector.cci 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package com.mockrunner.mock.connector.cci;
002:
003:        import java.util.HashMap;
004:        import java.util.Map;
005:
006:        import javax.resource.ResourceException;
007:        import javax.resource.cci.ResultSetInfo;
008:
009:        /**
010:         * Mock implementation of <code>ResultSetInfo</code>.
011:         */
012:        public class MockResultSetInfo implements  ResultSetInfo {
013:            private Map deletesAreDetectedMap;
014:            private Map insertsAreDetectedMap;
015:            private Map updatesAreDetectedMap;
016:            private Map othersDeletesAreVisibleMap;
017:            private Map othersInsertsAreVisibleMap;
018:            private Map othersUpdatesAreVisibleMap;
019:            private Map ownDeletesAreVisibleMap;
020:            private Map ownInsertsAreVisibleMap;
021:            private Map ownUpdatesAreVisibleMap;
022:            private Map supportsResultSetTypeMap;
023:            private Map supportsResultTypeConcurrencyMap;
024:
025:            public MockResultSetInfo() {
026:                deletesAreDetectedMap = new HashMap();
027:                insertsAreDetectedMap = new HashMap();
028:                updatesAreDetectedMap = new HashMap();
029:                othersDeletesAreVisibleMap = new HashMap();
030:                othersInsertsAreVisibleMap = new HashMap();
031:                othersUpdatesAreVisibleMap = new HashMap();
032:                ownDeletesAreVisibleMap = new HashMap();
033:                ownInsertsAreVisibleMap = new HashMap();
034:                ownUpdatesAreVisibleMap = new HashMap();
035:                supportsResultSetTypeMap = new HashMap();
036:                supportsResultTypeConcurrencyMap = new HashMap();
037:            }
038:
039:            public boolean deletesAreDetected(int type)
040:                    throws ResourceException {
041:                Boolean deletesAreDetected = (Boolean) deletesAreDetectedMap
042:                        .get(new Integer(type));
043:                if (null == deletesAreDetected)
044:                    return true;
045:                return deletesAreDetected.booleanValue();
046:            }
047:
048:            public boolean insertsAreDetected(int type)
049:                    throws ResourceException {
050:                Boolean insertsAreDetected = (Boolean) insertsAreDetectedMap
051:                        .get(new Integer(type));
052:                if (null == insertsAreDetected)
053:                    return true;
054:                return insertsAreDetected.booleanValue();
055:            }
056:
057:            public boolean updatesAreDetected(int type)
058:                    throws ResourceException {
059:                Boolean updatesAreDetected = (Boolean) updatesAreDetectedMap
060:                        .get(new Integer(type));
061:                if (null == updatesAreDetected)
062:                    return true;
063:                return updatesAreDetected.booleanValue();
064:            }
065:
066:            public boolean othersDeletesAreVisible(int type)
067:                    throws ResourceException {
068:                Boolean othersDeletesAreVisible = (Boolean) othersDeletesAreVisibleMap
069:                        .get(new Integer(type));
070:                if (null == othersDeletesAreVisible)
071:                    return true;
072:                return othersDeletesAreVisible.booleanValue();
073:            }
074:
075:            public boolean othersInsertsAreVisible(int type)
076:                    throws ResourceException {
077:                Boolean othersInsertsAreVisible = (Boolean) othersInsertsAreVisibleMap
078:                        .get(new Integer(type));
079:                if (null == othersInsertsAreVisible)
080:                    return true;
081:                return othersInsertsAreVisible.booleanValue();
082:            }
083:
084:            public boolean othersUpdatesAreVisible(int type)
085:                    throws ResourceException {
086:                Boolean othersUpdatesAreVisible = (Boolean) othersUpdatesAreVisibleMap
087:                        .get(new Integer(type));
088:                if (null == othersUpdatesAreVisible)
089:                    return true;
090:                return othersUpdatesAreVisible.booleanValue();
091:            }
092:
093:            public boolean ownDeletesAreVisible(int type)
094:                    throws ResourceException {
095:                Boolean ownDeletesAreVisible = (Boolean) ownDeletesAreVisibleMap
096:                        .get(new Integer(type));
097:                if (null == ownDeletesAreVisible)
098:                    return true;
099:                return ownDeletesAreVisible.booleanValue();
100:            }
101:
102:            public boolean ownInsertsAreVisible(int type)
103:                    throws ResourceException {
104:                Boolean ownInsertsAreVisible = (Boolean) ownInsertsAreVisibleMap
105:                        .get(new Integer(type));
106:                if (null == ownInsertsAreVisible)
107:                    return true;
108:                return ownInsertsAreVisible.booleanValue();
109:            }
110:
111:            public boolean ownUpdatesAreVisible(int type)
112:                    throws ResourceException {
113:                Boolean ownUpdatesAreVisible = (Boolean) ownUpdatesAreVisibleMap
114:                        .get(new Integer(type));
115:                if (null == ownUpdatesAreVisible)
116:                    return true;
117:                return ownUpdatesAreVisible.booleanValue();
118:            }
119:
120:            public boolean supportsResultSetType(int type)
121:                    throws ResourceException {
122:                Boolean supportsResultSetType = (Boolean) supportsResultSetTypeMap
123:                        .get(new Integer(type));
124:                if (null == supportsResultSetType)
125:                    return true;
126:                return supportsResultSetType.booleanValue();
127:            }
128:
129:            public boolean supportsResultTypeConcurrency(int type,
130:                    int concurrency) throws ResourceException {
131:                Boolean supportsResultTypeConcurrency = (Boolean) supportsResultTypeConcurrencyMap
132:                        .get(new SupportsResultTypeConcurrencyKey(type,
133:                                concurrency));
134:                if (null == supportsResultTypeConcurrency)
135:                    return true;
136:                return supportsResultTypeConcurrency.booleanValue();
137:            }
138:
139:            public void setDeletesAreDetected(int type,
140:                    boolean deletesAreDetected) {
141:                deletesAreDetectedMap.put(new Integer(type), new Boolean(
142:                        deletesAreDetected));
143:            }
144:
145:            public void setInsertsAreDetected(int type,
146:                    boolean insertsAreDetected) {
147:                insertsAreDetectedMap.put(new Integer(type), new Boolean(
148:                        insertsAreDetected));
149:            }
150:
151:            public void setUpdatesAreDetected(int type,
152:                    boolean updatesAreDetected) {
153:                updatesAreDetectedMap.put(new Integer(type), new Boolean(
154:                        updatesAreDetected));
155:            }
156:
157:            public void setOthersDeletesAreVisible(int type,
158:                    boolean othersDeletesAreVisible) {
159:                othersDeletesAreVisibleMap.put(new Integer(type), new Boolean(
160:                        othersDeletesAreVisible));
161:            }
162:
163:            public void setOthersInsertsAreVisible(int type,
164:                    boolean othersInsertsAreVisible) {
165:                othersInsertsAreVisibleMap.put(new Integer(type), new Boolean(
166:                        othersInsertsAreVisible));
167:            }
168:
169:            public void setOthersUpdatesAreVisible(int type,
170:                    boolean othersUpdatesAreVisible) {
171:                othersUpdatesAreVisibleMap.put(new Integer(type), new Boolean(
172:                        othersUpdatesAreVisible));
173:            }
174:
175:            public void setOwnDeletesAreVisible(int type,
176:                    boolean ownDeletesAreVisible) {
177:                ownDeletesAreVisibleMap.put(new Integer(type), new Boolean(
178:                        ownDeletesAreVisible));
179:            }
180:
181:            public void setOwnInsertsAreVisible(int type,
182:                    boolean ownInsertsAreVisible) {
183:                ownInsertsAreVisibleMap.put(new Integer(type), new Boolean(
184:                        ownInsertsAreVisible));
185:            }
186:
187:            public void setOwnUpdatesAreVisible(int type,
188:                    boolean ownUpdatesAreVisible) {
189:                ownUpdatesAreVisibleMap.put(new Integer(type), new Boolean(
190:                        ownUpdatesAreVisible));
191:            }
192:
193:            public void setSupportsResultSetType(int type,
194:                    boolean supportsResultSetType) {
195:                supportsResultSetTypeMap.put(new Integer(type), new Boolean(
196:                        supportsResultSetType));
197:            }
198:
199:            public void setSupportsResultTypeConcurrency(int type,
200:                    int concurrency, boolean supportsResultTypeConcurrency) {
201:                supportsResultTypeConcurrencyMap
202:                        .put(new SupportsResultTypeConcurrencyKey(type,
203:                                concurrency), new Boolean(
204:                                supportsResultTypeConcurrency));
205:            }
206:
207:            private class SupportsResultTypeConcurrencyKey {
208:                private int type;
209:                private int concurrency;
210:
211:                public SupportsResultTypeConcurrencyKey(int type,
212:                        int concurrency) {
213:                    this .type = type;
214:                    this .concurrency = concurrency;
215:                }
216:
217:                public int getType() {
218:                    return type;
219:                }
220:
221:                public int getConcurrency() {
222:                    return concurrency;
223:                }
224:
225:                public boolean equals(Object object) {
226:                    if (null == object)
227:                        return false;
228:                    if (!object.getClass().equals(this .getClass()))
229:                        return false;
230:                    SupportsResultTypeConcurrencyKey other = (SupportsResultTypeConcurrencyKey) object;
231:                    return (this .getType() == other.getType())
232:                            && (this .getConcurrency() == other.getConcurrency());
233:                }
234:
235:                public int hashCode() {
236:                    return ((31 + type) * 31) + concurrency;
237:                }
238:            }
239:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.