Source Code Cross Referenced for VariablesTestCase.java in  » ERP-CRM-Financial » Kuali-Financial-System » edu » iu » uis » eden » actions » 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.actions 
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:        // Created on Aug 24, 2006
018:        package edu.iu.uis.eden.actions;
019:
020:        import org.junit.Test;
021:        import org.kuali.workflow.test.WorkflowTestCase;
022:
023:        import edu.iu.uis.eden.clientapp.WorkflowDocument;
024:        import edu.iu.uis.eden.clientapp.vo.ActionRequestVO;
025:        import edu.iu.uis.eden.clientapp.vo.ActionTakenVO;
026:        import edu.iu.uis.eden.clientapp.vo.NetworkIdVO;
027:        import edu.iu.uis.eden.engine.node.Branch;
028:        import edu.iu.uis.eden.engine.node.BranchState;
029:        import edu.iu.uis.eden.exception.WorkflowException;
030:
031:        /**
032:         * Test case that tests setting and getting variables, both programmatically
033:         * and via the "SetVar" node; stolen directly from ApproveActionTest.testPreapprovals
034:         * @author Aaron Hamid (arh14 at cornell dot edu)
035:         */
036:        public class VariablesTestCase extends WorkflowTestCase {
037:
038:            private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger
039:                    .getLogger(VariablesTestCase.class);
040:
041:            protected void loadTestData() throws Exception {
042:                loadXmlFile("ActionsConfig.xml");
043:            }
044:
045:            private void dumpInfoAboutDoc(WorkflowDocument doc)
046:                    throws WorkflowException {
047:                LOG.info("\tDoc: class=" + doc.getDocumentType() + " title="
048:                        + doc.getTitle() + " status="
049:                        + doc.getStatusDisplayValue());
050:                LOG.info("\tActionRequests:");
051:                for (ActionRequestVO ar : doc.getActionRequests()) {
052:                    LOG.info("\t\tId: "
053:                            + ar.getActionRequestId()
054:                            + " UserId: "
055:                            + ar.getUserIdVO()
056:                            + " User: "
057:                            + (ar.getUserVO() != null ? ar.getUserVO()
058:                                    .getDisplayName() : null)
059:                            + " ActionRequested: "
060:                            + ar.getActionRequested()
061:                            + " ActionTaken: "
062:                            + (ar.getActionTaken() != null ? ar
063:                                    .getActionTaken().getActionTaken() : null)
064:                            + " NodeName: " + ar.getNodeName() + " Status:"
065:                            + ar.getStatus());
066:                }
067:                LOG.info("\tActionTakens:");
068:                for (ActionTakenVO at : doc.getActionsTaken()) {
069:                    LOG.info("\t\tId: "
070:                            + at.getActionTakenId()
071:                            + " User: "
072:                            + (at.getUserVO() != null ? at.getUserVO()
073:                                    .getDisplayName() : null)
074:                            + " ActionTaken: " + at.getActionTaken());
075:                }
076:                LOG.info("\tNodeNames:");
077:                for (String name : doc.getNodeNames()) {
078:                    LOG.info("\t\t" + name);
079:                }
080:            }
081:
082:            public void dumpBranch(Branch b) {
083:                LOG.info("Branch: " + b.getBranchId() + " " + b.getName());
084:                for (BranchState bs : b.getBranchState()) {
085:                    LOG.info(bs.getBranchStateId() + " " + bs.getKey() + " "
086:                            + bs.getValue());
087:                }
088:            }
089:
090:            @Test
091:            public void testVariables() throws Exception {
092:                WorkflowDocument doc = new WorkflowDocument(new NetworkIdVO(
093:                        "rkirkend"), "VariablesTest");
094:                doc.routeDocument("");
095:
096:                //rock some preapprovals and other actions...
097:                doc = new WorkflowDocument(new NetworkIdVO("ewestfal"), doc
098:                        .getRouteHeaderId());
099:                dumpInfoAboutDoc(doc);
100:                doc.setVariable("myexcellentvariable", "righton");
101:                doc.approve("");
102:                assertEquals("startedVariableValue", doc.getVariable("started"));
103:                assertEquals("startedVariableValue", doc
104:                        .getVariable("copiedVar"));
105:
106:                doc = new WorkflowDocument(new NetworkIdVO("user2"), doc
107:                        .getRouteHeaderId());
108:                assertEquals("righton", doc.getVariable("myexcellentvariable"));
109:                doc.setVariable("vartwo", "two");
110:                doc.setVariable("myexcellentvariable", "ichangedit");
111:                doc.acknowledge("");
112:
113:                doc = new WorkflowDocument(new NetworkIdVO("user3"), doc
114:                        .getRouteHeaderId());
115:                assertEquals("ichangedit", doc
116:                        .getVariable("myexcellentvariable"));
117:                assertEquals("two", doc.getVariable("vartwo"));
118:                doc.setVariable("another", "another");
119:                doc.setVariable("vartwo", null);
120:                doc.complete("");
121:
122:                //approve as the person the doc is routed to so we can move the documen on and hopefully to final
123:                doc = new WorkflowDocument(new NetworkIdVO("user1"), doc
124:                        .getRouteHeaderId());
125:                assertEquals("ichangedit", doc
126:                        .getVariable("myexcellentvariable"));
127:                assertEquals(null, doc.getVariable("vartwo"));
128:                assertEquals("another", doc.getVariable("another"));
129:                doc.approve("");
130:
131:                assertEquals("endedVariableValue", doc.getVariable("ended"));
132:                assertNotNull(doc.getVariable("google"));
133:                LOG.info(doc.getVariable("google"));
134:                assertEquals("documentContentendedVariableValue", doc
135:                        .getVariable("xpath"));
136:                LOG.info(doc.getVariable("xpath"));
137:
138:                assertEquals("aNewStartedVariableValue", doc
139:                        .getVariable("started"));
140:
141:                assertTrue("the document should be final", doc.stateIsFinal());
142:            }
143:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.