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


001:        /*
002:         * Copyright 2005-2007 The Kuali Foundation.
003:         *
004:         *
005:         * Licensed under the Educational Community License, Version 1.0 (the "License");
006:         * you may not use this file except in compliance with the License.
007:         * You may obtain a copy of the License at
008:         *
009:         * http://www.opensource.org/licenses/ecl1.php
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:        package edu.iu.uis.eden.actionrequests;
018:
019:        import java.util.HashSet;
020:        import java.util.Set;
021:
022:        import org.junit.Ignore;
023:        import org.junit.Test;
024:        import org.kuali.workflow.test.WorkflowTestCase;
025:
026:        import edu.iu.uis.eden.KEWServiceLocator;
027:        import edu.iu.uis.eden.clientapp.WorkflowDocument;
028:        import edu.iu.uis.eden.clientapp.vo.ActionRequestVO;
029:        import edu.iu.uis.eden.clientapp.vo.NetworkIdVO;
030:        import edu.iu.uis.eden.messaging.MessageServiceNames;
031:        import edu.iu.uis.eden.routeheader.DocumentRouteHeaderValue;
032:
033:        /**
034:         * Tests the DocumentRequeuer route queue processor.
035:         *
036:         * @author ewestfal
037:         */
038:        public class DocumentRequeuerTest extends WorkflowTestCase {
039:
040:            protected void loadTestData() throws Exception {
041:                loadXmlFile("ActionRequestsConfig.xml");
042:            }
043:
044:            @Test
045:            public void testDocumentRequeueSingleNode() throws Exception {
046:                WorkflowDocument document = new WorkflowDocument(
047:                        new NetworkIdVO("ewestfal"),
048:                        SeqSetup.DOCUMENT_TYPE_NAME);
049:                document.routeDocument("");
050:                document = new WorkflowDocument(new NetworkIdVO("ewestfal"),
051:                        document.getRouteHeaderId());
052:                assertTrue(document.stateIsEnroute());
053:                ActionRequestVO[] requests = document.getActionRequests();
054:                assertEquals("Should be 2 requests.", 2, requests.length);
055:                // save off request ids
056:                Set<Long> requestIds = new HashSet<Long>();
057:                for (int index = 0; index < requests.length; index++) {
058:                    ActionRequestVO requestVO = requests[index];
059:                    requestIds.add(requestVO.getActionRequestId());
060:                }
061:
062:                DocumentRouteHeaderValue documentH = KEWServiceLocator
063:                        .getRouteHeaderService().getRouteHeader(
064:                                document.getRouteHeaderId());
065:                DocumentRequeuerService documentRequeuer = MessageServiceNames
066:                        .getDocumentRequeuerService(documentH.getDocumentType()
067:                                .getMessageEntity(), documentH
068:                                .getRouteHeaderId(), 0);
069:                documentRequeuer.requeueDocument(document.getRouteHeaderId());
070:
071:                // initiate a requeue of the document
072:                //       SpringServiceLocator.getRouteQueueService().requeueDocument(document.getRouteHeaderId(), DocumentRequeuerImpl.class.getName());
073:
074:                document = new WorkflowDocument(new NetworkIdVO("bmcgough"),
075:                        document.getRouteHeaderId());
076:                assertTrue(document.stateIsEnroute());
077:                requests = document.getActionRequests();
078:                assertEquals("Should be 2 requests.", 2, requests.length);
079:                for (int index = 0; index < requests.length; index++) {
080:                    ActionRequestVO requestVO = requests[index];
081:                    assertTrue("Request ids should be different.", !requestIds
082:                            .contains(requestVO.getActionRequestId()));
083:                }
084:                assertTrue(document.isApprovalRequested());
085:                document.approve("");
086:
087:                // now there should just be a pending request to ryan, let's requeue again, because of ignore previous = false we should still
088:                // have only one pending request to ryan
089:                //       SpringServiceLocator.getRouteQueueService().requeueDocument(document.getRouteHeaderId(), DocumentRequeuerImpl.class.getName());
090:                documentRequeuer.requeueDocument(document.getRouteHeaderId());
091:                document = new WorkflowDocument(new NetworkIdVO("rkirkend"),
092:                        document.getRouteHeaderId());
093:                assertTrue(document.stateIsEnroute());
094:                requests = document.getActionRequests();
095:                assertEquals("Should be 2 requests.", 2, requests.length);
096:                // there should only be one pending request to rkirkend
097:                boolean pendingToRkirkend = false;
098:                for (int index = 0; index < requests.length; index++) {
099:                    ActionRequestVO requestVO = requests[index];
100:                    if (requestVO.getUserVO().getNetworkId().equals("rkirkend")
101:                            && requestVO.isActivated()) {
102:                        assertFalse("rkirkend has too many requests!",
103:                                pendingToRkirkend);
104:                        pendingToRkirkend = true;
105:                    } else {
106:                        assertTrue(
107:                                "previous request to all others should be done.",
108:                                requestVO.isDone());
109:                    }
110:                }
111:                assertTrue(document.isApprovalRequested());
112:                //       WorkflowReports reports = new WorkflowReports();
113:                //       assertTrue(reports.isLastApproverAtNode(document.getRouteHeaderId(), new NetworkIdVO("rkirkend"), SeqSetup.WORKFLOW_DOCUMENT_NODE));
114:            }
115:
116:            @Ignore("This test needs to be implemented!")
117:            @Test
118:            public void testDocumentRequeueMultipleNodes() throws Exception {
119:                // TODO time permitting we should write a test here which attempts to requeue a document which is sitting at multiple nodes
120:            }
121:
122:            private class SeqSetup {
123:                public static final String DOCUMENT_TYPE_NAME = "DRSeqDocType";
124:                public static final String ADHOC_NODE = "AdHoc";
125:                public static final String WORKFLOW_DOCUMENT_NODE = "WorkflowDocument";
126:                public static final String WORKFLOW_DOCUMENT_2_NODE = "WorkflowDocument2";
127:            }
128:
129:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.