Source Code Cross Referenced for ProcessControllerImplTest.java in  » Workflow-Engines » bexee » bexee » core » 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 » bexee » bexee.core 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * $Id: ProcessControllerImplTest.java,v 1.15 2004/12/06 07:53:41 fornp1 Exp $
003:         *
004:         * Copyright (c) 2004 Patric Fornasier, Pawel Kowalski
005:         * Berne University of Applied Sciences
006:         * School of Engineering and Information Technology
007:         * All rights reserved.
008:         */
009:        package bexee.core;
010:
011:        import java.io.FileNotFoundException;
012:        import java.io.InputStream;
013:
014:        import javax.xml.namespace.QName;
015:        import javax.xml.rpc.encoding.XMLType;
016:
017:        import bexee.BexeeTestCase;
018:        import bexee.model.BPELDocumentException;
019:        import bexee.model.BPELProcessFactory;
020:        import bexee.model.activity.Invoke;
021:        import bexee.model.activity.Receive;
022:        import bexee.model.activity.Reply;
023:        import bexee.model.activity.Sequence;
024:        import bexee.model.activity.impl.InvokeImpl;
025:        import bexee.model.activity.impl.ReceiveImpl;
026:        import bexee.model.activity.impl.ReplyImpl;
027:        import bexee.model.activity.impl.SequenceImpl;
028:        import bexee.model.elements.Variable;
029:        import bexee.model.elements.Variables;
030:        import bexee.model.elements.impl.VariableImpl;
031:        import bexee.model.elements.impl.VariablesImpl;
032:        import bexee.model.process.BPELProcess;
033:        import bexee.model.process.Process;
034:        import bexee.model.process.impl.BPELProcessImpl;
035:        import bexee.model.process.impl.ProcessImpl;
036:
037:        /**
038:         * @version $Revision: 1.15 $, $Date: 2004/12/06 07:53:41 $
039:         * @author Patric Fornasier
040:         */
041:        public class ProcessControllerImplTest extends BexeeTestCase {
042:
043:            private ProcessInstance instance;
044:
045:            private ProcessController controller;
046:
047:            private BPELProcessFactory factory;
048:
049:            protected void setUp() throws Exception {
050:                super .setUp();
051:
052:                // create process instance
053:                factory = BPELProcessFactory.getInstance();
054:
055:                // create process controller
056:                controller = ProcessControllerFactory.createProcessController();
057:            }
058:
059:            protected void tearDown() throws Exception {
060:                super .tearDown();
061:            }
062:
063:            public void testProcessMessage() throws Exception {
064:
065:                BPELProcess bpelProcess = createReceiveReplyProcess();
066:                ProcessContext ctx = new ProcessContext();
067:
068:                instance = new ProcessInstance(bpelProcess, ctx);
069:
070:                // create BexeeMessage
071:                BexeeMessage message = new BexeeMessage();
072:                message.setOperation("process");
073:                String partValue = "inputvalue";
074:                message.putPart("value", partValue);
075:
076:                controller.processMessage(instance, message);
077:
078:                Object result = instance.getContext().getResult();
079:
080:                assertEquals(partValue, result);
081:            }
082:
083:            private BPELProcess createReceiveReplyProcess()
084:                    throws FileNotFoundException, BPELDocumentException {
085:                InputStream inputStream = getLoader().getResourceAsStream(
086:                        "outAndInProcess.xml");
087:                BPELProcess bpelProcess = factory
088:                        .createBPELProcess(inputStream);
089:                return bpelProcess;
090:            }
091:
092:            private BPELProcess createBPELProcess() {
093:
094:                BPELProcess bpelProcess = null;
095:                Receive receiveInput = null;
096:                Reply replyOutput = null;
097:
098:                // create Variables
099:                //
100:                Variables variables = new VariablesImpl();
101:
102:                // create input Variable
103:                //
104:                Variable inputVariable = new VariableImpl();
105:                inputVariable.setName("input");
106:                inputVariable.setMessageType(XMLType.XSD_STRING);
107:
108:                // create output Variable
109:                //
110:                Variable outputVariable = new VariableImpl();
111:                outputVariable.setName("output");
112:                outputVariable.setMessageType(XMLType.XSD_STRING);
113:
114:                // create sequence
115:                //
116:                Sequence sequence = new SequenceImpl();
117:
118:                // create creation receive
119:                //
120:                receiveInput = new ReceiveImpl();
121:                receiveInput.setName("receiveInput");
122:                receiveInput.setOperation("process");
123:                receiveInput.setVariable(inputVariable);
124:                receiveInput.setCreateInstance(true);
125:
126:                // create invoke
127:                //        
128:                Invoke invoke = new InvokeImpl();
129:                invoke.setName("versionInvoke");
130:                invoke.setPortType(new QName("Version"));
131:                invoke.setOperation("getVersion");
132:                invoke.setOutputVariable(outputVariable);
133:
134:                // create reply
135:                //
136:                replyOutput = new ReplyImpl();
137:                replyOutput.setName("replyOutput");
138:                replyOutput.setOperation("process");
139:                replyOutput.setVariable(outputVariable);
140:
141:                // compose the sequence
142:                //
143:                sequence.addActivity(receiveInput);
144:                sequence.addActivity(invoke);
145:                sequence.addActivity(replyOutput);
146:
147:                // create the process
148:                //
149:                Process process = new ProcessImpl();
150:                process.setName("bexeeExample");
151:
152:                // compose variables
153:                //
154:                variables.addVariable(inputVariable);
155:                variables.addVariable(outputVariable);
156:
157:                // add variables
158:                //
159:                process.setVariables(variables);
160:
161:                // add activity
162:                // 
163:                process.setActivity(sequence);
164:
165:                // create the BPELProcess and set the process element
166:                //
167:                bpelProcess = new BPELProcessImpl();
168:                bpelProcess.setProcess(process);
169:
170:                return bpelProcess;
171:            }
172:
173:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.