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


001:        /*
002:         * Danet GmbH
003:         * Beratung und Software-Entwicklung
004:         * Geschäftstelle AN
005:         *
006:         * $Id: ProcDef.java,v 1.3 2007/03/27 21:59:42 mlipp Exp $
007:         *
008:         * $Log: ProcDef.java,v $
009:         * Revision 1.3  2007/03/27 21:59:42  mlipp
010:         * Fixed lots of checkstyle warnings.
011:         *
012:         * Revision 1.2  2007/02/27 14:34:22  drmlipp
013:         * Some refactoring to reduce cyclic dependencies.
014:         *
015:         * Revision 1.1.1.2  2004/08/18 15:18:46  drmlipp
016:         * Update to 1.2
017:         *
018:         * Revision 1.10  2004/01/27 11:45:33  lipp
019:         * Preserve newlines when reading process definitions.
020:         *
021:         * Revision 1.9  2003/06/05 09:00:32  schlue
022:         * Changed package name Bootstrap init unittests.
023:         *
024:         * Revision 1.8  2003/05/06 13:21:31  lipp
025:         * Resolved cyclic dependency.
026:         *
027:         * Revision 1.7  2003/04/25 20:05:32  lipp
028:         * Retrieving participants from SAX now.
029:         *
030:         * Revision 1.6  2003/04/24 20:51:21  lipp
031:         * Fixed some warnings.
032:         *
033:         * Revision 1.5  2003/04/24 15:08:42  lipp
034:         * Reading ApplicationDefinitiosn from SAX now.
035:         *
036:         * Revision 1.4  2003/04/23 14:28:12  lipp
037:         * Improved modelling of header data.
038:         *
039:         * Revision 1.3  2003/04/22 16:38:12  lipp
040:         * Retrieving resultSiganture from SAX.
041:         *
042:         * Revision 1.2  2003/04/22 14:35:35  lipp
043:         * Updated.
044:         *
045:         * Revision 1.1  2003/04/21 21:28:55  lipp
046:         * Added test.
047:         *
048:         */
049:        package domain;
050:
051:        import java.io.BufferedReader;
052:        import java.io.InputStream;
053:        import java.io.InputStreamReader;
054:
055:        import java.util.Date;
056:
057:        import de.danet.an.workflow.api.FormalParameter;
058:        import de.danet.an.workflow.api.Participant;
059:        import de.danet.an.workflow.api.ProcessDefinition;
060:        import de.danet.an.workflow.api.SAXEventBuffer;
061:        import de.danet.an.workflow.api.Participant.ParticipantType;
062:
063:        import de.danet.an.workflow.domain.ApplicationDefinition;
064:        import de.danet.an.workflow.domain.DefaultProcessDefinition;
065:
066:        import junit.framework.*;
067:
068:        /**
069:         * Zusammenstellung aller domain Tests für (Abstract)Process.
070:         * @author <a href="mailto:lipp@danet.de"></a>
071:         * @version 1.0
072:         */
073:        public class ProcDef extends TestCase {
074:
075:            private static final org.apache.commons.logging.Log logger = org.apache.commons.logging.LogFactory
076:                    .getLog(ProcDef.class);
077:
078:            /**
079:             * Konstruktor zum Erzeugen eines TestCase
080:             * @param name a <code>String</code> value
081:             */
082:            public ProcDef(String name) {
083:                super (name);
084:            }
085:
086:            /**
087:             * Stellt diese TestSuite zusammen.
088:             * @return a <code>Test</code> value
089:             */
090:            public static Test suite() {
091:                TestSuite suite = new TestSuite();
092:                suite.addTest(new ProcDef("read"));
093:                return suite;
094:            }
095:
096:            /**
097:             * Test for ProcessDefinition
098:             * @exception Exception if an error occurs
099:             */
100:            public void read() throws Exception {
101:                InputStream is = getClass().getResourceAsStream(
102:                        "/domain/testProc.xml");
103:                assertTrue(is != null);
104:                BufferedReader br = new BufferedReader(new InputStreamReader(
105:                        is, "ISO-8859-1"));
106:                StringBuffer sb = new StringBuffer();
107:                String st;
108:                while ((st = br.readLine()) != null) {
109:                    sb.append(st + "\n");
110:                }
111:                ProcessDefinition pd = new DefaultProcessDefinition(sb
112:                        .toString());
113:                assertTrue(pd.packageId().equals("unittests"));
114:                assertTrue(pd.packageName()
115:                        .equals("Initial workflow processes"));
116:                assertTrue(pd.processId().equals("account_neu"));
117:                assertTrue(pd.processName().equals("Account anlegen"));
118:                assertTrue(pd.processHeader().packageHeader().xpdlVersion()
119:                        .equals("0.09"));
120:                assertTrue(pd.processHeader().packageHeader().vendor().equals(
121:                        "Danet GmbH, GS AN"));
122:                assertTrue(pd.processHeader().packageHeader().created().equals(
123:                        "Sat Aug 24 15:12:01 CEST 2002"));
124:                assertTrue(pd.processHeader().created().equals("01.09.2001"));
125:                assertTrue(pd.processHeader().description().equals(
126:                        "Anlegen eines Accounts"));
127:                assertTrue(pd.processHeader().priority().equals("1"));
128:
129:                assertTrue(pd.contextSignature().get("packageString") == String.class);
130:                assertTrue(pd.contextSignature().get("packageFloat") == Double.class);
131:                assertTrue(pd.contextSignature().get("packageInteger") == Long.class);
132:                assertTrue(pd.contextSignature().get("packageDateTime") == Date.class);
133:                assertTrue(pd.contextSignature().get("packageBoolean") == Boolean.class);
134:                assertTrue(pd.contextSignature().get("packageXML") == org.w3c.dom.Element.class);
135:                assertTrue((pd.contextSignature().get("packageXMLDefined"))
136:                        .getClass().toString(), (pd.contextSignature()
137:                        .get("packageXMLDefined")) instanceof  SAXEventBuffer);
138:                assertTrue(pd.contextSignature().get("processString") == String.class);
139:
140:                assertTrue(pd.resultSignature().get("formalParam1") == null);
141:                assertTrue(pd.resultSignature().get("formalParam2") == String.class);
142:                assertTrue(pd.resultSignature().get("formalParam3") == String.class);
143:
144:                ApplicationDefinition appl = (ApplicationDefinition) pd
145:                        .applicationById("WebForm");
146:                assertTrue(appl != null);
147:                assertTrue(
148:                        appl.description(),
149:                        appl
150:                                .description()
151:                                .equals(
152:                                        "Bearbeitung einer Aktivität über ein Web-Formular      "));
153:                appl = (ApplicationDefinition) pd
154:                        .applicationById("WebFormPlus");
155:                assertTrue(appl != null);
156:                FormalParameter[] fps = appl.formalParameters();
157:                assertTrue(fps.length == 2);
158:                Participant p = pd.participantById("currentUser");
159:                assertTrue(p != null);
160:                assertTrue(p.getName().equals("Current User"));
161:                assertTrue(p.getParticipantType() == ParticipantType.HUMAN);
162:            }
163:
164:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.