Source Code Cross Referenced for ProcLifeCycleEngineTriggeredActivityTriggeringParentProcess.java in  » Workflow-Engines » wfmopen-2.1.1 » process » 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 » Workflow Engines » wfmopen 2.1.1 » process 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package process;
002:
003:        import java.util.Collection;
004:        import java.util.Iterator;
005:
006:        import junit.framework.Test;
007:        import junit.framework.TestSuite;
008:
009:        import de.danet.an.util.junit.EJBClientTest;
010:
011:        /**
012:         * Test the transitions of different activities and processes. 
013:         * The transitions are triggered by the engine.
014:         * @author <a href="mailto:weidauer@danet.de">Christian Weidauer</a>
015:         * @version 1.0
016:         */
017:        public class ProcLifeCycleEngineTriggeredActivityTriggeringParentProcess
018:                extends WfMOpenTestCase {
019:
020:            /**
021:             * Constructor of this TestCase
022:             * @param name a <code>String</code> value
023:             */
024:            public ProcLifeCycleEngineTriggeredActivityTriggeringParentProcess(
025:                    String name) {
026:                super (name);
027:            }
028:
029:            /**
030:             * Construct this test suite.
031:             * @return a <code>Test</code> value
032:             */
033:            public static Test suite() {
034:                TestSuite suite = new TestSuite();
035:                suite
036:                        .addTest(new ProcLifeCycleEngineTriggeredActivityTriggeringParentProcess(
037:                                "importProcessDefinitions"));
038:                suite
039:                        .addTest(new ProcLifeCycleEngineTriggeredActivityTriggeringParentProcess(
040:                                "checkP1T6T7"));
041:                suite
042:                        .addTest(new ProcLifeCycleEngineTriggeredActivityTriggeringParentProcess(
043:                                "checkP4T6T6"));
044:                suite
045:                        .addTest(new ProcLifeCycleEngineTriggeredActivityTriggeringParentProcess(
046:                                "checkP1T7T7"));
047:                return new EJBClientTest(plc, suite);
048:            }
049:
050:            /**
051:             * Initialisation.
052:             * The <code>setUp</code> method defines the way a state change is 
053:             * realized. Override this method to change this way.
054:             * @exception Exception if an error occurs
055:             */
056:            protected void setUp() throws Exception {
057:                xpdlFile = "/process/systestproc2.xml";
058:                super .setUp();
059:            }
060:
061:            //checkPxT5T4 already checked by checkP0T4T257 in parentProcess->activities
062:
063:            /**
064:             * Test a simple process definition. The process is terminated without 
065:             * being started. 
066:             * @exception Exception if an error occurs
067:             */
068:            public void checkP1T6T7() throws Exception {
069:                // create the process
070:                SmartWfProcess process = createProcess("st-process2", "P1");
071:                assertState(process, NOT_STARTED);
072:                Collection c = process.steps();
073:                Iterator it = c.iterator();
074:
075:                SmartWfActivity aCompleting = null;
076:                SmartWfActivity aTerminatedWhenCompleting = (SmartWfActivity) it
077:                        .next();
078:                ActivityNameAnalyser ana = new ActivityNameAnalyser(
079:                        aTerminatedWhenCompleting.name());
080:                if (ana.number().equals("1.1")) {
081:                    aCompleting = (SmartWfActivity) it.next();
082:                } else {
083:                    aCompleting = aTerminatedWhenCompleting;
084:                    aTerminatedWhenCompleting = (SmartWfActivity) it.next();
085:                }
086:
087:                process.setupWaitForState(RUNNING);
088:                aTerminatedWhenCompleting.setupWaitForState(RUNNING);
089:                aCompleting.setupWaitForState(RUNNING);
090:                process.start();
091:                process.waitForState();
092:                assertState(process, RUNNING);
093:                process.setupWaitForState(TERMINATED);
094:
095:                aTerminatedWhenCompleting.waitForState();
096:                aCompleting.waitForState();
097:                aCompleting.setupWaitForState(COMPLETED);
098:
099:                aTerminatedWhenCompleting.setupWaitForState(TERMINATED);
100:                aTerminatedWhenCompleting.terminate();
101:                aTerminatedWhenCompleting.waitForState();
102:                assertState(aTerminatedWhenCompleting, TERMINATED);
103:                assertState(aCompleting, RUNNING);
104:                assertState(process, RUNNING);
105:                //last activity (6) -> parent process (7)
106:                aCompleting.waitForState();
107:                assertState(aCompleting, COMPLETED);
108:                process.waitForState();
109:                assertState(process, TERMINATED);
110:
111:                removeProcess(process);
112:            }
113:
114:            /**
115:             * Test a simple process definition. The process is terminated without 
116:             * being started. 
117:             * @exception Exception if an error occurs
118:             */
119:            public void checkP1T7T7() throws Exception {
120:                // create the process
121:                SmartWfProcess process = createProcess("st-process2", "P1");
122:                assertState(process, NOT_STARTED);
123:                Collection c = process.steps();
124:                Iterator it = c.iterator();
125:
126:                SmartWfActivity aTerminating = (SmartWfActivity) it.next();
127:                SmartWfActivity aCompletedWhenTerminating = null;
128:                ActivityNameAnalyser ana = new ActivityNameAnalyser(
129:                        aTerminating.name());
130:                if (ana.number().equals("1.1")) {
131:                    aCompletedWhenTerminating = (SmartWfActivity) it.next();
132:                } else {
133:                    aCompletedWhenTerminating = aTerminating;
134:                    aTerminating = (SmartWfActivity) it.next();
135:                }
136:
137:                process.setupWaitForState(RUNNING);
138:                aCompletedWhenTerminating.setupWaitForState(COMPLETED);
139:                aTerminating.setupWaitForState(RUNNING);
140:                process.start();
141:                process.waitForState();
142:                assertState(process, RUNNING);
143:
144:                aCompletedWhenTerminating.waitForState();
145:                aTerminating.waitForState();
146:                assertState(aTerminating, RUNNING);
147:                //last activity (7) -> parent process (7)
148:                aTerminating.setupWaitForState(TERMINATED);
149:                aTerminating.terminate();
150:                aTerminating.waitForState();
151:                assertState(aTerminating, TERMINATED);
152:                assertState(process, TERMINATED);
153:
154:                removeProcess(process);
155:            }
156:
157:            /**
158:             * Test a simple process definition. The process is terminated without 
159:             * being started. 
160:             * @exception Exception if an error occurs
161:             */
162:            public void checkP4T6T6() throws Exception {
163:                // create the process
164:                SmartWfProcess process = createProcess("st-process2", "P4");
165:                assertState(process, NOT_STARTED);
166:                Collection c = process.steps();
167:                Iterator it = c.iterator();
168:
169:                SmartWfActivity aCompleting = null;
170:                SmartWfActivity aCompletedWhenCompleting = (SmartWfActivity) it
171:                        .next();
172:                ActivityNameAnalyser ana = new ActivityNameAnalyser(
173:                        aCompletedWhenCompleting.name());
174:                if (ana.number().equals("4.1")) {
175:                    aCompleting = (SmartWfActivity) it.next();
176:                } else {
177:                    aCompleting = aCompletedWhenCompleting;
178:                    aCompletedWhenCompleting = (SmartWfActivity) it.next();
179:                }
180:
181:                process.setupWaitForState(RUNNING);
182:                aCompletedWhenCompleting.setupWaitForState(COMPLETED);
183:                aCompleting.setupWaitForState(RUNNING);
184:                process.start();
185:                assertState(process, RUNNING);
186:                process.waitForState();
187:                process.setupWaitForState(COMPLETED);
188:
189:                aCompletedWhenCompleting.waitForState();
190:                aCompleting.waitForState();
191:                assertState(aCompleting, RUNNING);
192:                assertState(process, RUNNING);
193:                aCompleting.setupWaitForState(COMPLETED);
194:                //last activity (6) -> parent process (6)
195:                aCompleting.waitForState();
196:                assertState(aCompleting, COMPLETED);
197:                process.waitForState();
198:                assertState(process, COMPLETED);
199:
200:                removeProcess(process);
201:            }
202:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.