Source Code Cross Referenced for ExceptionMessagingTest.java in  » ERP-CRM-Financial » Kuali-Financial-System » edu » iu » uis » eden » messaging » exceptionhandling » 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 » ERP CRM Financial » Kuali Financial System » edu.iu.uis.eden.messaging.exceptionhandling 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2007 The Kuali Foundation
003:         *
004:         * Licensed under the Educational Community License, Version 1.0 (the "License");
005:         * you may not use this file except in compliance with the License.
006:         * You may obtain a copy of the License at
007:         *
008:         * http://www.opensource.org/licenses/ecl1.php
009:         *
010:         * Unless required by applicable law or agreed to in writing, software
011:         * distributed under the License is distributed on an "AS IS" BASIS,
012:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013:         * See the License for the specific language governing permissions and
014:         * limitations under the License.
015:         */
016:        package edu.iu.uis.eden.messaging.exceptionhandling;
017:
018:        import java.util.List;
019:
020:        import javax.xml.namespace.QName;
021:
022:        import org.junit.Test;
023:        import org.kuali.bus.services.KSBServiceLocator;
024:        import org.kuali.bus.test.KSBTestCase;
025:        import org.kuali.rice.RiceConstants;
026:        import org.kuali.rice.core.Core;
027:        import org.kuali.rice.test.TestUtilities;
028:
029:        import edu.iu.uis.eden.messaging.GlobalCallbackRegistry;
030:        import edu.iu.uis.eden.messaging.KEWJavaService;
031:        import edu.iu.uis.eden.messaging.PersistedMessage;
032:        import edu.iu.uis.eden.messaging.TestCallback;
033:        import edu.iu.uis.eden.messaging.remotedservices.TesetHarnessExplodingQueue;
034:
035:        /**
036:         * Tests various exception messaging cases
037:         * 
038:         * Millis to live - that a message with no home is still sending messages while it's time to live hasn't expired
039:         * Retry count - that a message configured with a retry count will send x number of messages before being marked exception
040:         * Being marked as exception - that a message in exception is in the route log and marked with a status of 'E'
041:         * Defuault retry count - that a message configured with no retry or time to live is retry the default number of times as 
042:         * 	noted in an app constant and a class default if that constant is not a number or doesn't exist
043:         * App Constant to determine the default time increment works (we need this to effectively test anyway)
044:         * Things work without the timeincrement constant in place
045:         * 
046:         * @author Kuali Rice Team (kuali-rice@googlegroups.com)
047:         *
048:         */
049:        public class ExceptionMessagingTest extends KSBTestCase {
050:
051:            private QName queueTimeToLiveServiceName = new QName("KEW",
052:                    "explodingQueueTimeLimit");
053:            private QName retryCountServiceName = new QName("KEW",
054:                    "testExplodingRetryCount");
055:            private TestCallback callback = new TestCallback();
056:
057:            @Override
058:            public void setUp() throws Exception {
059:                System.setProperty(
060:                        RiceConstants.ROUTE_QUEUE_TIME_INCREMENT_KEY, "500");
061:                System.setProperty(
062:                        RiceConstants.ROUTE_QUEUE_MAX_RETRY_ATTEMPTS_KEY, "5");
063:                //		System.setProperty(RiceConstants.IMMEDIATE_EXCEPTION_ROUTING, "false");
064:                super .setUp();
065:                GlobalCallbackRegistry.getCallbacks().clear();
066:                GlobalCallbackRegistry.getCallbacks().add(this .callback);
067:                TestCallback.clearCallbacks();
068:                TesetHarnessExplodingQueue.NUM_CALLS = 0;
069:            }
070:
071:            @Override
072:            public void tearDown() throws Exception {
073:                KSBServiceLocator.getScheduler().shutdown();
074:                super .tearDown();
075:            }
076:
077:            /**
078:             * test that service is in queue marked 'E' when the time to live is expired.
079:             * @throws Exception
080:             */
081:            @Test
082:            public void testTimeToLive() throws Exception {
083:
084:                KEWJavaService explodingQueue = (KEWJavaService) KSBServiceLocator
085:                        .getMessageHelper().getServiceAsynchronously(
086:                                this .queueTimeToLiveServiceName);
087:                explodingQueue.invoke("");
088:                TestUtilities.waitForExceptionRouting();
089:                //this service is on a 3 second wait the queue is on a 1 sec.
090:                Thread.sleep(10000);
091:
092:                //verify the entry is in exception routing
093:                List<PersistedMessage> messagesQueued = KSBServiceLocator
094:                        .getRouteQueueService().findByServiceName(
095:                                this .queueTimeToLiveServiceName, "invoke");
096:                PersistedMessage message = messagesQueued.get(0);
097:                assertEquals("Message should be in exception status",
098:                        RiceConstants.ROUTE_QUEUE_EXCEPTION, message
099:                                .getQueueStatus());
100:                assertTrue(
101:                        "Message expiration date should be equal to or earlier than last queue date",
102:                        message.getExpirationDate().getTime() <= message
103:                                .getQueueDate().getTime());
104:            }
105:
106:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.