Source Code Cross Referenced for IntegrationTestCase.java in  » Test-Coverage » GroboUtils » net » sourceforge » groboutils » junit » v1 » 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 » Test Coverage » GroboUtils » net.sourceforge.groboutils.junit.v1 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * @(#)IntegrationTestCase.java
003:         *
004:         * Copyright (C) 2002-2004 Matt Albrecht
005:         * groboclown@users.sourceforge.net
006:         * http://groboutils.sourceforge.net
007:         *
008:         *  Permission is hereby granted, free of charge, to any person obtaining a
009:         *  copy of this software and associated documentation files (the "Software"),
010:         *  to deal in the Software without restriction, including without limitation
011:         *  the rights to use, copy, modify, merge, publish, distribute, sublicense,
012:         *  and/or sell copies of the Software, and to permit persons to whom the
013:         *  Software is furnished to do so, subject to the following conditions:
014:         *
015:         *  The above copyright notice and this permission notice shall be included in
016:         *  all copies or substantial portions of the Software.
017:         *
018:         *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
019:         *  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
020:         *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
021:         *  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
022:         *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
023:         *  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
024:         *  DEALINGS IN THE SOFTWARE.
025:         */
026:
027:        package net.sourceforge.groboutils.junit.v1;
028:
029:        import org.apache.log4j.Logger;
030:        import junit.framework.TestCase;
031:        import junit.framework.TestResult;
032:        import junit.framework.AssertionFailedError;
033:        import junit.framework.Assert;
034:
035:        import java.util.Hashtable;
036:
037:        /**
038:         * A TestCase specific for Integration tests.  It has the additional
039:         * functionality of soft validation through the AssertTestFactory class.
040:         *
041:         * @author     Matt Albrecht <a href="mailto:groboclown@users.sourceforge.net">groboclown@users.sourceforge.net</a>
042:         * @version    $Date: 2004/01/09 20:32:26 $
043:         * @since      March 28, 2002
044:         */
045:        public class IntegrationTestCase extends SubTestTestCase {
046:            private AssertTestFactory atf;
047:
048:            /**
049:             * Standard JUnit format for test constructors (pre JUnit 3.8).
050:             *
051:             * @param name the name of the test case.
052:             */
053:            public IntegrationTestCase(String name) {
054:                super (name);
055:
056:                this .atf = new AssertTestFactory(getName(), true);
057:            }
058:
059:            //-------------------------------------------------------------------------
060:            // Soft assert calls
061:
062:            /**
063:             * Asserts that a condtion is true.  If it isn't it throws an
064:             * AssertionFailedError.
065:             *
066:             * @param message text reported during failure.
067:             * @param condition must be true or an exception is raised.
068:             */
069:            public void softAssertTrue(String message, boolean condition) {
070:                addSubTest(this .atf.createAssertTrue(message, condition));
071:            }
072:
073:            /**
074:             * Asserts that a condition is true. If it isn't it throws an
075:             * AssertionFailedError.
076:             *
077:             * @param condition  must be true or an exception is raised.
078:             */
079:            public void softAssertTrue(boolean condition) {
080:                addSubTest(this .atf.createAssertTrue(condition));
081:            }
082:
083:            /**
084:             * Asserts that a condtion is false.  If it isn't it throws an
085:             * AssertionFailedError.
086:             *
087:             * @since 03-Nov-2002
088:             * @param message text reported during failure.
089:             * @param condition must be false or an exception is raised.
090:             */
091:            public void softAssertFalse(String message, boolean condition) {
092:                addSubTest(this .atf.createAssertFalse(message, condition));
093:            }
094:
095:            /**
096:             * Asserts that a condition is false. If it isn't it throws an
097:             * AssertionFailedError.
098:             *
099:             * @since 03-Nov-2002
100:             * @param condition  must be false or an exception is raised.
101:             */
102:            public void softAssertFalse(boolean condition) {
103:                addSubTest(this .atf.createAssertFalse(condition));
104:            }
105:
106:            /**
107:             * Fails a test with the given message.
108:             *
109:             * @param message text reported during failure.
110:             */
111:            public void softFail(String message) {
112:                addSubTest(this .atf.createFail(message));
113:            }
114:
115:            /**
116:             * Fails a test with no message.
117:             */
118:            public void softFail() {
119:                addSubTest(this .atf.createFail());
120:            }
121:
122:            /**
123:             * Asserts that two objects are equal (<tt>.equals()</tt>). If they
124:             * are not an AssertionFailedError is thrown.
125:             *
126:             * @param message text reported during failure.
127:             * @param expected  value expected from the test.
128:             * @param actual    actual value generated by the test.
129:             */
130:            public void softAssertEquals(String message, Object expected,
131:                    Object actual) {
132:                addSubTest(this .atf.createAssertEquals(message, expected,
133:                        actual));
134:            }
135:
136:            /**
137:             * Asserts that two objects are equal. If they are not an
138:             * AssertionFailedError is thrown.
139:             *
140:             * @param expected  value expected from the test.
141:             * @param actual    actual value generated by the test.
142:             */
143:            public void softAssertEquals(Object expected, Object actual) {
144:                addSubTest(this .atf.createAssertEquals(expected, actual));
145:            }
146:
147:            /**
148:             * Asserts that two objects are equal. If they are not an
149:             * AssertionFailedError is thrown.
150:             *
151:             * @since 03-Nov-2002
152:             * @param message text reported during failure.
153:             * @param expected  value expected from the test.
154:             * @param actual    actual value generated by the test.
155:             */
156:            public void softAssertEquals(String message, String expected,
157:                    String actual) {
158:                addSubTest(this .atf.createAssertEquals(message, expected,
159:                        actual));
160:            }
161:
162:            /**
163:             * Asserts that two objects are equal. If they are not an
164:             * AssertionFailedError is thrown.
165:             *
166:             * @since 03-Nov-2002
167:             * @param expected  value expected from the test.
168:             * @param actual    actual value generated by the test.
169:             */
170:            public void softAssertEquals(String expected, String actual) {
171:                addSubTest(this .atf.createAssertEquals(expected, actual));
172:            }
173:
174:            /**
175:             * Asserts that two doubles are equal concerning a delta. If the expected
176:             * value is infinity then the delta value is ignored.
177:             *
178:             * @param message text reported during failure.
179:             * @param expected  value expected from the test.
180:             * @param actual    actual value generated by the test.
181:             * @param delta     Description of the Parameter
182:             */
183:            public void softAssertEquals(String message, double expected,
184:                    double actual, double delta) {
185:                addSubTest(this .atf.createAssertEquals(message, expected,
186:                        actual, delta));
187:            }
188:
189:            /**
190:             * Asserts that two doubles are equal concerning a delta. If the expected
191:             * value is infinity then the delta value is ignored.
192:             *
193:             * @param expected  value expected from the test.
194:             * @param actual    actual value generated by the test.
195:             * @param delta     Description of the Parameter
196:             */
197:            public void softAssertEquals(double expected, double actual,
198:                    double delta) {
199:                addSubTest(this .atf.createAssertEquals(expected, actual, delta));
200:            }
201:
202:            /**
203:             * Asserts that two floats are equal concerning a delta. If the expected
204:             * value is infinity then the delta value is ignored.
205:             *
206:             * @param message text reported during failure.
207:             * @param expected  value expected from the test.
208:             * @param actual    actual value generated by the test.
209:             * @param delta     Description of the Parameter
210:             */
211:            public void softAssertEquals(String message, float expected,
212:                    float actual, float delta) {
213:                addSubTest(this .atf.createAssertEquals(message, expected,
214:                        actual, delta));
215:            }
216:
217:            /**
218:             * Asserts that two floats are equal concerning a delta. If the expected
219:             * value is infinity then the delta value is ignored.
220:             *
221:             * @param expected  value expected from the test.
222:             * @param actual    actual value generated by the test.
223:             * @param delta     Description of the Parameter
224:             */
225:            public void softAssertEquals(float expected, float actual,
226:                    float delta) {
227:                addSubTest(this .atf.createAssertEquals(expected, actual, delta));
228:            }
229:
230:            /**
231:             * Asserts that two longs are equal.
232:             *
233:             * @param message text reported during failure.
234:             * @param expected  value expected from the test.
235:             * @param actual    actual value generated by the test.
236:             */
237:            public void softAssertEquals(String message, long expected,
238:                    long actual) {
239:                addSubTest(this .atf.createAssertEquals(message, expected,
240:                        actual));
241:            }
242:
243:            /**
244:             * Asserts that two longs are equal.
245:             *
246:             * @param expected  value expected from the test.
247:             * @param actual    actual value generated by the test.
248:             */
249:            public void softAssertEquals(long expected, long actual) {
250:                addSubTest(this .atf.createAssertEquals(expected, actual));
251:            }
252:
253:            /**
254:             * Asserts that two booleans are equal.
255:             *
256:             * @param message text reported during failure.
257:             * @param expected  value expected from the test.
258:             * @param actual    actual value generated by the test.
259:             */
260:            public void softAssertEquals(String message, boolean expected,
261:                    boolean actual) {
262:                addSubTest(this .atf.createAssertEquals(message, expected,
263:                        actual));
264:            }
265:
266:            /**
267:             * Asserts that two booleans are equal.
268:             *
269:             * @param expected  value expected from the test.
270:             * @param actual    actual value generated by the test.
271:             */
272:            public void softAssertEquals(boolean expected, boolean actual) {
273:                addSubTest(this .atf.createAssertEquals(expected, actual));
274:            }
275:
276:            /**
277:             * Asserts that two bytes are equal.
278:             *
279:             * @param message text reported during failure.
280:             * @param expected  value expected from the test.
281:             * @param actual    actual value generated by the test.
282:             */
283:            public void softAssertEquals(String message, byte expected,
284:                    byte actual) {
285:                addSubTest(this .atf.createAssertEquals(message, expected,
286:                        actual));
287:            }
288:
289:            /**
290:             * Asserts that two bytes are equal.
291:             *
292:             * @param expected  value expected from the test.
293:             * @param actual    actual value generated by the test.
294:             */
295:            public void softAssertEquals(byte expected, byte actual) {
296:                addSubTest(this .atf.createAssertEquals(expected, actual));
297:            }
298:
299:            /**
300:             * Asserts that two chars are equal.
301:             *
302:             * @param message text reported during failure.
303:             * @param expected  value expected from the test.
304:             * @param actual    actual value generated by the test.
305:             */
306:            public void softAssertEquals(String message, char expected,
307:                    char actual) {
308:                addSubTest(this .atf.createAssertEquals(message, expected,
309:                        actual));
310:            }
311:
312:            /**
313:             * Asserts that two chars are equal.
314:             *
315:             * @param expected  value expected from the test.
316:             * @param actual    actual value generated by the test.
317:             */
318:            public void softAssertEquals(char expected, char actual) {
319:                addSubTest(this .atf.createAssertEquals(expected, actual));
320:            }
321:
322:            /**
323:             * Asserts that two shorts are equal.
324:             *
325:             * @param message text reported during failure.
326:             * @param expected  value expected from the test.
327:             * @param actual    actual value generated by the test.
328:             */
329:            public void softAssertEquals(String message, short expected,
330:                    short actual) {
331:                addSubTest(this .atf.createAssertEquals(message, expected,
332:                        actual));
333:            }
334:
335:            /**
336:             * Asserts that two shorts are equal.
337:             *
338:             * @param expected  value expected from the test.
339:             * @param actual    actual value generated by the test.
340:             */
341:            public void softAssertEquals(short expected, short actual) {
342:                addSubTest(this .atf.createAssertEquals(expected, actual));
343:            }
344:
345:            /**
346:             * Asserts that two ints are equal.
347:             *
348:             * @param message text reported during failure.
349:             * @param expected  value expected from the test.
350:             * @param actual    actual value generated by the test.
351:             */
352:            public void softAssertEquals(String message, int expected,
353:                    int actual) {
354:                addSubTest(this .atf.createAssertEquals(message, expected,
355:                        actual));
356:            }
357:
358:            /**
359:             * Asserts that two ints are equal.
360:             *
361:             * @param expected  value expected from the test.
362:             * @param actual    actual value generated by the test.
363:             */
364:            public void softAssertEquals(int expected, int actual) {
365:                addSubTest(this .atf.createAssertEquals(expected, actual));
366:            }
367:
368:            /**
369:             * Asserts that an object isn't null.
370:             *
371:             * @param message text reported during failure.
372:             * @param object   Description of the Parameter
373:             */
374:            public void softAssertNotNull(String message, Object object) {
375:                addSubTest(this .atf.createAssertNotNull(message, object));
376:            }
377:
378:            /**
379:             * Asserts that an object isn't null.
380:             *
381:             * @param object  Description of the Parameter
382:             */
383:            public void softAssertNotNull(Object object) {
384:                addSubTest(this .atf.createAssertNotNull(object));
385:            }
386:
387:            /**
388:             * Asserts that an object is null.
389:             *
390:             * @param message text reported during failure.
391:             * @param object   Description of the Parameter
392:             */
393:            public void softAssertNull(String message, Object object) {
394:                addSubTest(this .atf.createAssertNull(message, object));
395:            }
396:
397:            /**
398:             * Asserts that an object is null.
399:             *
400:             * @param object  Description of the Parameter
401:             */
402:            public void softAssertNull(Object object) {
403:                addSubTest(this .atf.createAssertNull(object));
404:            }
405:
406:            /**
407:             * Asserts that two objects refer to the same object. If they are not an
408:             * AssertionFailedError is thrown.
409:             *
410:             * @param message text reported during failure.
411:             * @param expected  value expected from the test.
412:             * @param actual    actual value generated by the test.
413:             */
414:            public void softAssertSame(String message, Object expected,
415:                    Object actual) {
416:                addSubTest(this .atf.createAssertSame(message, expected, actual));
417:            }
418:
419:            /**
420:             * Asserts that two objects refer to the same object. If they are not the
421:             * same an AssertionFailedError is thrown.
422:             *
423:             * @param expected  value expected from the test.
424:             * @param actual    actual value generated by the test.
425:             */
426:            public void softAssertSame(Object expected, Object actual) {
427:                addSubTest(this .atf.createAssertSame(expected, actual));
428:            }
429:
430:            /**
431:             * Asserts that two objects refer to the same object. If they are not an
432:             * AssertionFailedError is thrown.
433:             *
434:             * @since 03-Nov-2002
435:             * @param message text reported during failure.
436:             * @param expected  value expected from the test.
437:             * @param actual    actual value generated by the test.
438:             */
439:            public void softAssertNotSame(String message, Object expected,
440:                    Object actual) {
441:                addSubTest(this .atf.createAssertNotSame(message, expected,
442:                        actual));
443:            }
444:
445:            /**
446:             * Asserts that two objects refer to the same object. If they are not the
447:             * same an AssertionFailedError is thrown.
448:             *
449:             * @since 03-Nov-2002
450:             * @param expected  value expected from the test.
451:             * @param actual    actual value generated by the test.
452:             */
453:            public void softAssertNotSame(Object expected, Object actual) {
454:                addSubTest(this.atf.createAssertNotSame(expected, actual));
455:            }
456:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.