Source Code Cross Referenced for SubProcessRoutingTest.java in  » ERP-CRM-Financial » Kuali-Financial-System » edu » iu » uis » eden » engine » 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.engine 
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.engine;
018:
019:        import java.util.Iterator;
020:        import java.util.List;
021:
022:        import org.junit.Test;
023:        import org.kuali.workflow.test.WorkflowTestCase;
024:
025:        import edu.iu.uis.eden.EdenConstants;
026:        import edu.iu.uis.eden.KEWServiceLocator;
027:        import edu.iu.uis.eden.actionrequests.ActionRequestValue;
028:        import edu.iu.uis.eden.clientapp.WorkflowDocument;
029:        import edu.iu.uis.eden.clientapp.vo.NetworkIdVO;
030:        import edu.iu.uis.eden.clientapp.vo.RouteNodeInstanceVO;
031:        import edu.iu.uis.eden.engine.node.RouteNodeInstance;
032:
033:        public class SubProcessRoutingTest extends WorkflowTestCase {
034:
035:            private static final String DOCUMENT_TYPE_NAME = "SubProcessDocType";
036:            private static final String SUB_PROCESS_NODE = "MySubProcess";
037:            private static final String ACKNOWLEDGE_NODE = "Acknowledge";
038:            private static final String APPROVE_NODE = "Approve";
039:
040:            protected void loadTestData() throws Exception {
041:                loadXmlFile("EngineConfig.xml");
042:            }
043:
044:            @Test
045:            public void testSubProcessRoute() throws Exception {
046:                WorkflowDocument document = new WorkflowDocument(
047:                        new NetworkIdVO("ewestfal"), DOCUMENT_TYPE_NAME);
048:                document.saveRoutingData();
049:                assertTrue("Document should be initiated", document
050:                        .stateIsInitiated());
051:                assertEquals("Should be no action requests.", 0, document
052:                        .getActionRequests().length);
053:                assertEquals("Invalid route level.", new Integer(0), document
054:                        .getRouteHeader().getDocRouteLevel());
055:                document.routeDocument("");
056:                assertTrue("Document shoule be ENROUTE.", document
057:                        .stateIsEnroute());
058:
059:                List actionRequests = KEWServiceLocator
060:                        .getActionRequestService().findPendingByDoc(
061:                                document.getRouteHeaderId());
062:                assertEquals("Incorrect pending action requests.", 2,
063:                        actionRequests.size());
064:                boolean isAck = false;
065:                boolean isApprove = false;
066:                for (Iterator iterator = actionRequests.iterator(); iterator
067:                        .hasNext();) {
068:                    ActionRequestValue request = (ActionRequestValue) iterator
069:                            .next();
070:                    RouteNodeInstance nodeInstance = request.getNodeInstance();
071:                    assertNotNull("Node instance should be non null.",
072:                            nodeInstance);
073:                    if (request.getWorkflowUser().getAuthenticationUserId()
074:                            .getId().equals("bmcgough")) {
075:                        isAck = true;
076:                        assertEquals("Wrong request type.",
077:                                EdenConstants.ACTION_REQUEST_ACKNOWLEDGE_REQ,
078:                                request.getActionRequested());
079:                        assertEquals("Wrong node.", ACKNOWLEDGE_NODE,
080:                                nodeInstance.getRouteNode().getRouteNodeName());
081:                        assertNotNull("Should be in a sub process.",
082:                                nodeInstance.getProcess());
083:                        assertEquals("Wrong sub process.", SUB_PROCESS_NODE,
084:                                nodeInstance.getProcess().getRouteNode()
085:                                        .getRouteNodeName());
086:                        assertFalse("Sub process should be non-initial.",
087:                                nodeInstance.getProcess().isInitial());
088:                        assertFalse("Sub process should be non-active.",
089:                                nodeInstance.getProcess().isActive());
090:                        assertFalse("Sub process should be non-complete.",
091:                                nodeInstance.getProcess().isComplete());
092:                    } else if (request.getWorkflowUser()
093:                            .getAuthenticationUserId().getId().equals("temay")) {
094:                        isApprove = true;
095:                        assertEquals("Wrong request type.",
096:                                EdenConstants.ACTION_REQUEST_APPROVE_REQ,
097:                                request.getActionRequested());
098:                        assertEquals("Wrong node.", APPROVE_NODE, request
099:                                .getNodeInstance().getRouteNode()
100:                                .getRouteNodeName());
101:                        assertNotNull("Should be in a sub process.", request
102:                                .getNodeInstance().getProcess());
103:                        assertEquals("Wrong sub process.", SUB_PROCESS_NODE,
104:                                request.getNodeInstance().getProcess()
105:                                        .getRouteNode().getRouteNodeName());
106:                        assertFalse("Sub process should be non-initial.",
107:                                nodeInstance.getProcess().isInitial());
108:                        assertFalse("Sub process should be non-active.",
109:                                nodeInstance.getProcess().isActive());
110:                        assertFalse("Sub process should be non-complete.",
111:                                nodeInstance.getProcess().isComplete());
112:                    }
113:                }
114:                assertTrue(isAck);
115:                assertTrue(isApprove);
116:                document = new WorkflowDocument(new NetworkIdVO("bmcgough"),
117:                        document.getRouteHeaderId());
118:                assertTrue("Should have acknowledge.", document
119:                        .isAcknowledgeRequested());
120:                document.acknowledge("");
121:
122:                document = new WorkflowDocument(new NetworkIdVO("temay"),
123:                        document.getRouteHeaderId());
124:                document.approve("");
125:
126:                // find the subprocess and assert it is complete, not active, and not initial
127:                boolean foundSubProcess = false;
128:                RouteNodeInstanceVO[] nodeInstances = document
129:                        .getRouteNodeInstances();
130:                for (int index = 0; index < nodeInstances.length; index++) {
131:                    RouteNodeInstanceVO instanceVO = nodeInstances[index];
132:                    if (instanceVO.getName().equals(SUB_PROCESS_NODE)) {
133:                        foundSubProcess = true;
134:                        assertFalse("Sub process should be non-initial.",
135:                                instanceVO.isInitial());
136:                        assertFalse("Sub process should be non-active.",
137:                                instanceVO.isActive());
138:                        assertTrue("Sub process should be complete.",
139:                                instanceVO.isComplete());
140:                    }
141:                }
142:                assertTrue("Could not locate sub process node.",
143:                        foundSubProcess);
144:
145:                document = new WorkflowDocument(new NetworkIdVO("rkirkend"),
146:                        document.getRouteHeaderId());
147:                document.approve("");
148:
149:                document = new WorkflowDocument(new NetworkIdVO("ewestfal"),
150:                        document.getRouteHeaderId());
151:                assertTrue("Document should be final.", document.stateIsFinal());
152:            }
153:
154:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.